Package: bash-completion
Version: 1:1.0-2
Severity: normal
Tags: patch
The checks for GNUish userland are made unportably by using a hardcoded
list of uname values. It should use GNU/* and match other systems like
GNU/kFreeBSD or GNU/kOpenSolaris.
Also, the check for sed relies on comparing uname with "Linux" but it's
actually a userland issue.
Patch attached.
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-libre2-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages bash-completion depends on:
ii bash 3.2-5 The GNU Bourne Again SHell
bash-completion recommends no packages.
bash-completion suggests no packages.
-- no debconf information
diff -ur bash-completion-1.0.old/bash_completion bash-completion-1.0/bash_completion
--- bash-completion-1.0.old/bash_completion 2009-04-02 22:01:39.000000000 +0200
+++ bash-completion-1.0/bash_completion 2009-05-19 20:08:55.000000000 +0200
@@ -53,6 +53,11 @@
UNAME=${UNAME/CYGWIN_*/Cygwin}
RELEASE=$( uname -r )
+case ${UNAME} in
+ Linux|GNU|GNU/*) USERLAND=GNU ;;
+ *) USERLAND=${UNAME} ;;
+esac
+
# features supported by bash 2.05 and higher
if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} > 04 ]] ||
[ ${BASH_VERSINFO[0]} -gt 2 ]; then
@@ -188,7 +193,7 @@
# use GNU sed if we have it, since its extensions are still used in our code
#
-[ $UNAME != Linux ] && have gsed && alias sed=gsed
+[ $USERLAND != GNU ] && have gsed && alias sed=gsed
# This function checks whether a given readline variable
# is `on'.
@@ -939,7 +944,7 @@
# man(1) completion
#
-[ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \
+[ $USERLAND = GNU -o $UNAME = Darwin \
-o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
-o $UNAME = OpenBSD ] &&
_man()
@@ -969,7 +974,7 @@
UNAME=$( uname -s )
# strip OS type and version under Cygwin
UNAME=${UNAME/CYGWIN_*/Cygwin}
- if [ $UNAME = GNU -o $UNAME = Linux -o $UNAME = FreeBSD \
+ if [ $USERLAND = GNU -o $UNAME = FreeBSD \
-o $UNAME = Cygwin ]; then
manpath=$( manpath 2>/dev/null || command man --path )
else
@@ -1011,7 +1016,7 @@
return 0
}
-[ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \
+[ $USERLAND = GNU -o $UNAME = Darwin \
-o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
-o $UNAME = OpenBSD ] && \
complete -F _man $filenames man apropos whatis
@@ -1408,7 +1413,7 @@
# Red Hat & Debian GNU/Linux if{up,down} completion
#
-[ $UNAME = Linux ] && { have ifup || have ifdown; } &&
+[ $USERLAND = GNU ] && { have ifup || have ifdown; } &&
_ifupdown()
{
local cur
@@ -1424,7 +1429,7 @@
return 0
} &&
complete -F _ifupdown ifup ifdown
-[ $UNAME = Linux ] && have ifstatus && complete -F _ifupdown ifstatus
+[ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus
# Linux ipsec(8) completion (for FreeS/WAN)
#
@@ -4362,7 +4367,7 @@
fi
} &&
complete $filenames -F _gcc gcc g++ c++ g77 gcj gpc
-[ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Cygwin ] && \
+[ $USERLAND = GNU -o $UNAME = Cygwin ] && \
[ -n "${have:-}" ] && complete $filenames -F _gcc cc
# Linux cardctl(8) completion
Only in bash-completion-1.0: bash_completion~
_______________________________________________
Bash-completion-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel