Skip to content

Commit

Permalink
common: Factor out function to get OS name
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Dave Chinner <david@fromorbit.com>
  • Loading branch information
jankara authored and dchinner committed Dec 21, 2015
1 parent aa60a2a commit 9420351
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions common/rc
Original file line number Diff line number Diff line change
Expand Up @@ -2188,21 +2188,27 @@ _full_platform_details()
echo "$os/$platform $host $kernel"
}

_get_os_name()
{
if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
echo 'irix'
elif [ "`uname`" == "Linux" ]; then
echo 'linux'
else
echo Unknown operating system: `uname`
exit
fi
}

_link_out_file()
{
if [ -z "$1" -o -z "$2" ]; then
echo Error must pass src and dst.
exit
fi
rm -f $2
if [ "`uname`" == "IRIX64" ] || [ "`uname`" == "IRIX" ]; then
ln -s $1.irix $2
elif [ "`uname`" == "Linux" ]; then
ln -s $1.linux $2
else
echo Error test $seq does not run on the operating system: `uname`
exit
fi
SUFFIX=$(_get_os_name())
ln -s $1.$SUFFIX $2
}

_die()
Expand Down

0 comments on commit 9420351

Please sign in to comment.