for Ubuntu LTS, use -d, but use -r -i for other os's

This commit is contained in:
Dustin Kirkland 2009-03-28 12:37:16 -05:00
commit 39553928df
2 changed files with 12 additions and 3 deletions

View file

@ -22,8 +22,17 @@ p="release"
grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0 grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0
if which lsb_release >/dev/null; then if which lsb_release >/dev/null; then
echo $(lsb_release -s -i) $(lsb_release -s -r) # If lsb_release is available, use it
if lsb_release -s -d | grep -qs "^Ubuntu .*\..*\..*$"; then
# Use the -d if an Ubuntu LTS
lsb_release -s -d
else
# But for other distros the description
# is too long, so build from -i and -r
echo $(lsb_release -s -i) $(lsb_release -s -r)
fi
elif [ -r "/etc/issue" ]; then elif [ -r "/etc/issue" ]; then
# Otherwise, grab part of /etc/issue
head -n1 /etc/issue | awk '{print $1}' head -n1 /etc/issue | awk '{print $1}'
else else
echo "Unknown" echo "Unknown"

4
debian/changelog vendored
View file

@ -8,7 +8,7 @@ screen-profiles (1.41) unreleased; urgency=low
get-orig-source get-orig-source
* bin/release: determine release from /etc/issue if lsb-release not found; * bin/release: determine release from /etc/issue if lsb-release not found;
don't use fully qualified path for lsb_release as it seems this has moved don't use fully qualified path for lsb_release as it seems this has moved
around (see Dapper) around (see Dapper); for Ubuntu use -d, but use -r -i for other os's
* licenses updated to GPLv3 (dropped "or later" clause) * licenses updated to GPLv3 (dropped "or later" clause)
* screen-profiles-export: new script, for exporting a profile to systems * screen-profiles-export: new script, for exporting a profile to systems
where screen-profiles are not installed where screen-profiles are not installed
@ -19,7 +19,7 @@ screen-profiles (1.41) unreleased; urgency=low
[ James Wilcox ] [ James Wilcox ]
* bin/updates-available: support SUSE's zypper * bin/updates-available: support SUSE's zypper
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 28 Mar 2009 12:05:56 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Sat, 28 Mar 2009 12:23:27 -0500
screen-profiles (1.40-0ubuntu1) jaunty; urgency=low screen-profiles (1.40-0ubuntu1) jaunty; urgency=low