mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
* bin/updates-available, byobu, byobu-export, byobu-status,
screen-launcher-install: remove hardcoded /usr/bin paths; some users install without root privileges and want to run from a location other than /usr/bin, LP: #385762 Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
23438453b6
commit
ca8a4eca9e
6 changed files with 22 additions and 18 deletions
|
@ -18,8 +18,8 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if [ "$1" = "--detail" -o "$1" = "--short" ]; then
|
if [ "$1" = "--detail" -o "$1" = "--short" ]; then
|
||||||
if [ -x "/usr/bin/apt-get" ]; then
|
if which apt-get >/dev/null; then
|
||||||
detail=`/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade`
|
detail=`apt-get -s -o Debug::NoLocking=true upgrade`
|
||||||
if [ "$1" = "--detail" ]; then
|
if [ "$1" = "--detail" ]; then
|
||||||
printf "$detail"
|
printf "$detail"
|
||||||
else
|
else
|
||||||
|
@ -97,16 +97,16 @@ ionice -c3 -p $$ >/dev/null 2>&1 || true
|
||||||
if [ -x /usr/lib/update-notifier/apt-check ]; then
|
if [ -x /usr/lib/update-notifier/apt-check ]; then
|
||||||
# If apt-check binary exists, use it
|
# If apt-check binary exists, use it
|
||||||
/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;/ /" > $mycache &
|
/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;/ /" > $mycache &
|
||||||
elif [ -x /usr/bin/apt-get ]; then
|
elif which apt-get 2>/dev/null; then
|
||||||
# If apt-get exists, use it
|
# If apt-get exists, use it
|
||||||
/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst > $mycache &
|
apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst > $mycache &
|
||||||
elif [ -x /usr/bin/zypper ]; then
|
elif which zypper; then
|
||||||
# If zypper exists, use it
|
# If zypper exists, use it
|
||||||
/usr/bin/zypper --no-refresh lu --best-effort | grep 'v |' | wc -l > $mycache &
|
zypper --no-refresh lu --best-effort | grep 'v |' | wc -l > $mycache &
|
||||||
elif [ -x /usr/bin/yum ]; then
|
elif which yum; then
|
||||||
# If yum exists, use it
|
# If yum exists, use it
|
||||||
# TODO: We need a better way of counting updates available from a RH expert
|
# TODO: We need a better way of counting updates available from a RH expert
|
||||||
/usr/bin/yum list updates | egrep -v "Updated Packages|Loaded plugins" | wc -l > $mycache &
|
yum list updates | egrep -v "Updated Packages|Loaded plugins" | wc -l > $mycache &
|
||||||
else
|
else
|
||||||
# If we're here, we have no idea
|
# If we're here, we have no idea
|
||||||
print_updates "?"
|
print_updates "?"
|
||||||
|
|
10
byobu
10
byobu
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
OLDPKG="screen-profiles"
|
OLDPKG="screen-profiles"
|
||||||
PKG="byobu"
|
PKG="byobu"
|
||||||
SCREEN_REAL="/usr/bin/screen"
|
SCREEN_REAL="screen"
|
||||||
|
|
||||||
# Upgrade old config dir to the new name
|
# Upgrade old config dir to the new name
|
||||||
[ -d "$HOME/.$OLDPKG" -a ! -e "$HOME/.$PKG" ] && mv -f "$HOME/.$OLDPKG" "$HOME/.$PKG"
|
[ -d "$HOME/.$OLDPKG" -a ! -e "$HOME/.$PKG" ] && mv -f "$HOME/.$OLDPKG" "$HOME/.$PKG"
|
||||||
|
@ -49,7 +49,7 @@ DEFAULT_PROFILE="light"
|
||||||
|
|
||||||
# Ensure that the user has selected a screen profile
|
# Ensure that the user has selected a screen profile
|
||||||
profile="$HOME/.$PKG/profile"
|
profile="$HOME/.$PKG/profile"
|
||||||
[ -h "$profile" ] || /usr/bin/select-screen-profile -s "$DEFAULT_PROFILE"
|
[ -h "$profile" ] || select-screen-profile -s "$DEFAULT_PROFILE"
|
||||||
|
|
||||||
# Previously, profiles were prepended with ubuntu-.
|
# Previously, profiles were prepended with ubuntu-.
|
||||||
# This is no longer the case, for cross-distro compatibility.
|
# This is no longer the case, for cross-distro compatibility.
|
||||||
|
@ -60,12 +60,12 @@ if [ -h "$profile" -a ! -r "$profile" ]; then
|
||||||
if [ -r "$newsrc" ]; then
|
if [ -r "$newsrc" ]; then
|
||||||
ln -sf "$newsrc" "$profile"
|
ln -sf "$newsrc" "$profile"
|
||||||
else
|
else
|
||||||
/usr/bin/select-screen-profile -s "$DEFAULT_PROFILE"
|
select-screen-profile -s "$DEFAULT_PROFILE"
|
||||||
fi
|
fi
|
||||||
elif stat "$profile" | head -n1 | grep -qs ".*->.*plain'$"; then
|
elif stat "$profile" | head -n1 | grep -qs ".*->.*plain'$"; then
|
||||||
ln -sf "/usr/share/$PKG/profiles/NONE" "$profile"
|
ln -sf "/usr/share/$PKG/profiles/NONE" "$profile"
|
||||||
else
|
else
|
||||||
/usr/bin/select-screen-profile -s "$DEFAULT_PROFILE"
|
select-screen-profile -s "$DEFAULT_PROFILE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ if grep -qs "^[^#]" "$HOME/.$PKG/windows"; then
|
||||||
DEFAULT_WINDOW=
|
DEFAULT_WINDOW=
|
||||||
else
|
else
|
||||||
# User has no default windows, so launch motd+shell
|
# User has no default windows, so launch motd+shell
|
||||||
DEFAULT_WINDOW="$SHELL /usr/bin/motd+shell"
|
DEFAULT_WINDOW="$SHELL motd+shell"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure that the user's $SCREENRC at least exists
|
# Ensure that the user's $SCREENRC at least exists
|
||||||
|
|
|
@ -220,7 +220,7 @@ PROFILE="$DIR/.screenrc"
|
||||||
STATUS="$DIR/.$PKG/status"
|
STATUS="$DIR/.$PKG/status"
|
||||||
mkdir -p "$DIR/.$PKG/bin"
|
mkdir -p "$DIR/.$PKG/bin"
|
||||||
touch "$DIR/.$PKG/profile"
|
touch "$DIR/.$PKG/profile"
|
||||||
[ -x /usr/bin/dpkg-query ] && /usr/bin/dpkg-query --show --showformat '${Package} ${Version}\n' $PKG > "$DIR/.$PKG/version"
|
dpkg-query --show --showformat '${Package} ${Version}\n' $PKG > "$DIR/.$PKG/version" 2>/dev/null || true
|
||||||
echo "http://launchpad.net/$PKG" >> "$DIR/.$PKG/version"
|
echo "http://launchpad.net/$PKG" >> "$DIR/.$PKG/version"
|
||||||
|
|
||||||
# Copy status scripts
|
# Copy status scripts
|
||||||
|
|
|
@ -68,8 +68,8 @@ case "$P" in
|
||||||
;;
|
;;
|
||||||
--detail)
|
--detail)
|
||||||
VER=
|
VER=
|
||||||
if [ -x "/usr/bin/dpkg-query" ]; then
|
if which dpkg-query >/dev/null; then
|
||||||
VER=`/usr/bin/dpkg-query --show $PKG | awk '{print "-" $2 }'`
|
VER=`dpkg-query --show $PKG | awk '{print "-" $2 }'`
|
||||||
fi
|
fi
|
||||||
printf "$PKG$VER Detailed Status Navigation\n Expand all - zr\t\tCollapse all - zm\n Expand one - zo\t\tCollapse one - zc\n\n"
|
printf "$PKG$VER Detailed Status Navigation\n Expand all - zr\t\tCollapse all - zm\n Expand one - zo\t\tCollapse one - zc\n\n"
|
||||||
for i in `ls "$DIR"`; do
|
for i in `ls "$DIR"`; do
|
||||||
|
|
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -2,8 +2,12 @@ byobu (2.10) unreleased; urgency=low
|
||||||
|
|
||||||
* byobu: don't create an extra shell, if the user has some default
|
* byobu: don't create an extra shell, if the user has some default
|
||||||
windows specified
|
windows specified
|
||||||
|
* bin/updates-available, byobu, byobu-export, byobu-status,
|
||||||
|
screen-launcher-install: remove hardcoded /usr/bin paths; some users
|
||||||
|
install without root privileges and want to run from a location other
|
||||||
|
than /usr/bin, LP: #385762
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 10 Jun 2009 14:18:23 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 10 Jun 2009 20:46:16 -0500
|
||||||
|
|
||||||
byobu (2.9-0ubuntu1) karmic; urgency=low
|
byobu (2.9-0ubuntu1) karmic; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ PKG="byobu"
|
||||||
|
|
||||||
install_screen_launcher() {
|
install_screen_launcher() {
|
||||||
dest=$1
|
dest=$1
|
||||||
launcher="/usr/bin/screen-launcher"
|
launcher="screen-launcher"
|
||||||
launcher_line="\`echo \$- | grep -qs i\` && [ -x $launcher ] && $launcher"
|
launcher_line="\`echo \$- | grep -qs i\` && [ -x $launcher ] && $launcher"
|
||||||
# Add it at the end
|
# Add it at the end
|
||||||
echo "$launcher_line" >> "$dest"
|
echo "$launcher_line" >> "$dest"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue