mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
usr/lib/byobu/release: use /etc/issue first, much, much faster,
thanks to the suggestion from Daniel Hahler, LP: #674275
This commit is contained in:
commit
089e56e8ea
2 changed files with 17 additions and 7 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -14,6 +14,8 @@ byobu (3.9) unreleased; urgency=low
|
|||
usr/share/byobu/profiles/byoburc, usr/share/byobu/profiles/common,
|
||||
usr/share/man/man1/byobu.1: clean up the broken xdg changes,
|
||||
maintain both the xdg dir and a symlink for now; LP: #674217
|
||||
* usr/lib/byobu/release: use /etc/issue first, much, much faster,
|
||||
thanks to the suggestion from Daniel Hahler, LP: #674275
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 10 Nov 2010 18:29:06 -0600
|
||||
|
||||
|
|
|
@ -26,8 +26,22 @@ if [ "$1" = "--detail" ]; then
|
|||
fi
|
||||
|
||||
if [ -n "$DISTRO" ]; then
|
||||
# skip down to the bottom
|
||||
# user defined
|
||||
true
|
||||
elif [ -r "/etc/issue" ]; then
|
||||
# lsb_release is *really* slow; try to use /etc/issue first
|
||||
issue=$(grep -m1 "^[A-Za-z]" /etc/issue)
|
||||
case "$issue" in
|
||||
Ubuntu*)
|
||||
DISTRO=$(echo "$issue" | sed "s/ \\\.*$//")
|
||||
;;
|
||||
Debian*)
|
||||
DISTRO="Debian $(cat /etc/debian_version)"
|
||||
;;
|
||||
*)
|
||||
DISTRO=$(echo "$issue" | sed "s/ [^0-9]* / /" | awk '{print $1 " " $2}')
|
||||
;;
|
||||
esac
|
||||
elif which lsb_release >/dev/null 2>&1; then
|
||||
if [ "$1" = "--detail" ]; then
|
||||
lsb_release -a 2>/dev/null
|
||||
|
@ -48,12 +62,6 @@ elif which lsb_release >/dev/null 2>&1; then
|
|||
DISTRO="$i $r"
|
||||
;;
|
||||
esac
|
||||
elif [ -r "/etc/palm-build-info" ]; then
|
||||
# Palm Pre hack
|
||||
DISTRO=$(grep "^PRODUCT_VERSION_STRING=Palm " /etc/palm-build-info | sed "s/^.*=Palm //")
|
||||
elif [ -r "/etc/issue" ]; then
|
||||
# Otherwise, grab part of /etc/issue, ideally the distro and version
|
||||
DISTRO=$(grep -m1 "^[A-Za-z]" /etc/issue | sed "s/ [^0-9]* / /" | awk '{print $1 " " $2}')
|
||||
else
|
||||
DISTRO="Byobu"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue