From df5cfae6d4d2e85e819c6a4e58862e35bbe65c74 Mon Sep 17 00:00:00 2001 From: Jeff Sheltren Date: Jun 24 2007 17:46:10 +0000 Subject: Update to latest bash-completion and spec Remove unused patches --- diff --git a/.cvsignore b/.cvsignore index 1c0eed3..e658700 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -bash-completion-20050721.tar.bz2 +bash-completion-20060301.tar.bz2 diff --git a/bash-completion-20050721-bash31quoting.patch b/bash-completion-20050721-bash31quoting.patch deleted file mode 100644 index b031404..0000000 --- a/bash-completion-20050721-bash31quoting.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- bash_completion/bash_completion~ 2005-07-21 22:21:22.000000000 +0300 -+++ bash_completion/bash_completion 2006-01-08 17:31:57.000000000 +0200 -@@ -661,4 +661,4 @@ - COMPREPLY=( $( compgen -W "$( echo $( smbclient -d 0 -NL $host | -- sed -ne '/^['$'\t '']*Sharename/,/^$/p' | -- sed -ne '3,$s|^[^A-Za-z]*\([^'$'\t '']*\).*$|//'$host'/\1|p' ) )" -- "$cur" ) ) -+ sed -ne '/^[\t ]*Sharename/,/^$/p' | -+ sed -ne '3,$s|^[^A-Za-z]*\([^\t ]*\).*$|//'$host'/\1|p' ) )" -- "$cur" ) ) - fi -@@ -2398,5 +2398,5 @@ - # expand path (if present) to global known hosts file -- global_kh=$( eval echo $( sed -ne 's/^[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['$'\t '']*\(.*\)$/\1/p' ${config[@]} ) ) -+ global_kh=$( eval echo $( sed -ne 's/^[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee][\t ]*\(.*\)$/\1/p' ${config[@]} ) ) - # expand path (if present) to user known hosts file -- user_kh=$( eval echo $( sed -ne 's/^[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['$'\t '']*\(.*\)$/\1/p' ${config[@]} ) ) -+ user_kh=$( eval echo $( sed -ne 's/^[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee][\t ]*\(.*\)$/\1/p' ${config[@]} ) ) - fi -@@ -2476,3 +2476,3 @@ - if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then -- hosts=$( compgen -W "$( sed -ne "s/^[Hh][Oo][Ss][Tt]["$'\t '"]*\([^*?]*\)$/\1/p" ${config[@]} )" -- $ocur ) -+ hosts=$( compgen -W '$( sed -ne "s/^[Hh][Oo][Ss][Tt][\t ]*\([^*?]*\)$/\1/p" ${config[@]} )' -- $ocur ) - COMPREPLY=( ${COMPREPLY[@]} $hosts ) -@@ -5860,3 +5860,3 @@ - dict $host $port $1 2>/dev/null | sed -ne \ -- 's/^['$'\t '']['$'\t '']*\([^'$'\t '']*\).*$/\1/p' -+ 's/^[\t ][\t ]*\([^\t ]*\).*$/\1/p' - } ---- bash_completion/contrib/sitecopy~ 2005-01-03 04:44:22.000000000 +0200 -+++ bash_completion/contrib/sitecopy 2006-01-08 17:35:19.000000000 +0200 -@@ -20,7 +20,7 @@ - ;; - *) - if [ -r ~/.sitecopyrc ]; then -- COMPREPLY=( $( compgen -W "$(grep '^["$'\t '"]*site' ~/.sitecopyrc | awk '{print $2}')" -- $cur ) ) -+ COMPREPLY=( $( compgen -W "$(grep '^[\t ]*site' ~/.sitecopyrc | awk '{print $2}')" -- $cur ) ) - fi - ;; - esac diff --git a/bash-completion-20050721-cvs-stat.patch b/bash-completion-20050721-cvs-stat.patch deleted file mode 100644 index ed36bd7..0000000 --- a/bash-completion-20050721-cvs-stat.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- bash_completion~ 2005-07-21 22:21:22.000000000 +0300 -+++ bash_completion 2005-09-21 17:25:01.000000000 +0300 -@@ -1544,7 +1544,7 @@ - @(rtag|rfreeze)) - mode=rtag - ;; -- st?(atus)) -+ st?(at?(us))) - mode=status - ;; - @(tag|freeze)) -@@ -1697,7 +1697,7 @@ - commit diff delete edit export \ - freeze get history import log new \ - patch rcs rdiff release remove \ -- rfreeze rlog rm rtag status tag \ -+ rfreeze rlog rm rtag stat status tag \ - unedit up update -H -Q -q -b -d -e \ - -f -l -n -t -r -v -w -x -z --help \ - --version' -- $cur ) ) diff --git a/bash-completion-20050721-mtr.patch b/bash-completion-20050721-mtr.patch deleted file mode 100644 index 302cce0..0000000 --- a/bash-completion-20050721-mtr.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- bash_completion~ 2005-07-21 22:21:22.000000000 +0300 -+++ bash_completion 2006-02-04 21:05:17.000000000 +0200 -@@ -2492,3 +2492,3 @@ - complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 \ -- ping fping telnet host nslookup rsh rlogin ftp dig ssh-installkeys -+ ping fping telnet host nslookup rsh rlogin ftp dig ssh-installkeys mtr - diff --git a/bash-completion-20060301-debian.patch b/bash-completion-20060301-debian.patch new file mode 100644 index 0000000..1cfc478 --- /dev/null +++ b/bash-completion-20060301-debian.patch @@ -0,0 +1,20 @@ +--- bash_completion~ 2007-02-28 01:11:44.000000000 +0200 ++++ bash_completion 2007-02-28 01:11:44.000000000 +0200 +@@ -806,7 +806,7 @@ + [ $UNAME = GNU -o $UNAME = Linux -o $UNAME = Darwin \ + -o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \ + -o $UNAME = OpenBSD ] && \ +-complete -F _man $filenames man ++complete -F _man $filenames man apropos whatis + + # renice(8) completion + # +@@ -3325,7 +3323,7 @@ + have bzip2 && + _bzip2() + { +- local cur prev xspec ++ local cur prev xspec IFS=$'\t\n' + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} diff --git a/bash-completion-20060301-scp-apos-217178.patch b/bash-completion-20060301-scp-apos-217178.patch new file mode 100644 index 0000000..e931bd8 --- /dev/null +++ b/bash-completion-20060301-scp-apos-217178.patch @@ -0,0 +1,18 @@ +--- bash_completion~ 2006-03-01 18:20:18.000000000 +0200 ++++ bash_completion 2006-12-26 14:01:59.000000000 +0200 +@@ -2589,6 +2589,7 @@ + COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \ + command ls -aF1d "$path*" 2>/dev/null | \ + sed -e 's/[][(){}<>",:;^&!$&=?`|\ ]/\\\\\\&/g' \ ++ -e "s/'/\\\\\\\\\\\\&/g" \ + -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) ) + return 0 + fi +@@ -2597,6 +2598,7 @@ + COMPREPLY=( ${COMPREPLY[@]} $( command ls -aF1d $cur* \ + 2>/dev/null | sed \ + -e 's/[][(){}<>",:;^&!$&=?`|\ ]/\\&/g' \ ++ -e "s/'/\\\\&/g" \ + -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) ) + return 0 + } diff --git a/bash-completion-mock b/bash-completion-mock index 96e7218..767ebda 100644 --- a/bash-completion-mock +++ b/bash-completion-mock @@ -2,19 +2,28 @@ _mock() { - local cur prev + local cur prev commands cfgdir COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + commands='rebuild chroot init clean shell' + cfgdir=/etc/mock + + count=0 + for i in ${COMP_WORDS[@]} ; do + [ $count -eq $COMP_CWORD ] && break + [ "$i" == --configdir ] && cfgdir="${COMP_WORDS[((count+1))]}" + count=$((++count)) + done case $prev in - --@(result|state)dir) + --@(config|result|state)dir) _filedir -d return 0 ;; -r) - COMPREPLY=( $( command ls /etc/mock | \ + COMPREPLY=( $( command ls $cfgdir | \ sed -ne 's/^\('$cur'.*\)\.cfg$/\1/p') ) return 0 ;; @@ -23,9 +32,11 @@ _mock() ;; esac + # TODO: process $commands if [[ "$cur" == -* ]] ; then COMPREPLY=( $( compgen -W '--version -h --help -r --no-clean --arch \ - --debug --resultdir --statedir --uniqueext' -- $cur ) ) + --debug --resultdir --statedir --uniqueext --configdir --quiet \ + --autocache --rebuildcache' -- $cur ) ) else _filedir '?(no)src.rpm' fi diff --git a/bash-completion.profile b/bash-completion.profile deleted file mode 100644 index 3264537..0000000 --- a/bash-completion.profile +++ /dev/null @@ -1,14 +0,0 @@ -# check for bash (and that we haven't already been sourced, see eg. #174355) -[ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return - -# skip non-interactive shells -[[ $- == *i* ]] || return - -# check for correct version of bash -bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.} -if [ -r /etc/bash_completion ] && \ - [ $bmajor -eq 2 -a $bminor '>' 04 -o $bmajor -gt 2 ] ; then - # source completion code - . /etc/bash_completion -fi -unset bash bminor bmajor diff --git a/bash-completion.spec b/bash-completion.spec index 214d360..be0a16b 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -1,19 +1,17 @@ Name: bash-completion -Version: 20050721 -Release: 4%{?dist}.1 +Version: 20060301 +Release: 4%{?dist} Summary: Programmable completion for Bash Group: System Environment/Shells License: GPL URL: http://www.caliban.org/bash/ Source0: http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2 -Source1: %{name}.profile Source2: %{name}-mock Source3: %{name}-repomanage Source4: %{name}-plague-client -Patch0: %{name}-20050721-cvs-stat.patch -Patch1: %{name}-20050721-bash31quoting.patch -Patch2: %{name}-20050721-mtr.patch +Patch0: %{name}-20060301-scp-apos-217178.patch +Patch1: %{name}-20060301-debian.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -27,8 +25,8 @@ of the programmable completion feature of bash 2. %prep %setup -q -n bash_completion %patch0 -%patch1 -p1 -%patch2 +%patch1 +f=Changelog ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f install -pm 644 %{SOURCE2} contrib/mock install -pm 644 %{SOURCE3} contrib/plague-client install -pm 644 %{SOURCE3} contrib/repomanage @@ -41,8 +39,7 @@ install -pm 644 %{SOURCE3} contrib/repomanage rm -rf $RPM_BUILD_ROOT %{name}-ghosts.list install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/profile.d install -pm 644 bash_completion $RPM_BUILD_ROOT%{_sysconfdir} -install -pm 644 %{SOURCE1} \ - $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/bash_completion.sh +install -pm 644 bash_completion.sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name} install -pm 644 contrib/* $RPM_BUILD_ROOT%{_datadir}/%{name} install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d @@ -58,138 +55,121 @@ cd - rm -rf $RPM_BUILD_ROOT +%define do_triggerin() if [ ! -e %{_sysconfdir}/bash_completion.d/%1 ] ; then ln -s %{_datadir}/%{name}/%1 %{_sysconfdir}/bash_completion.d || : ; fi +%define do_triggerun() [ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/%1 || : + +# Not handled (yet?): +# bitkeeper, dsniff, harbour, larch, lisp, p4, povray, sitecopy + %triggerin -- bittorrent -if [ ! -e %{_sysconfdir}/bash_completion.d/bittorrent ] ; then - ln -s %{_datadir}/%{name}/bittorrent %{_sysconfdir}/bash_completion.d -fi +%do_triggerin bittorrent %triggerun -- bittorrent -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/bittorrent +%do_triggerun bittorrent %triggerin -- cksfv -if [ ! -e %{_sysconfdir}/bash_completion.d/cksfv ] ; then - ln -s %{_datadir}/%{name}/cksfv %{_sysconfdir}/bash_completion.d -fi +%do_triggerin cksfv %triggerun -- cksfv -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/cksfv +%do_triggerun cksfv %triggerin -- clisp -if [ ! -e %{_sysconfdir}/bash_completion.d/clisp ] ; then - ln -s %{_datadir}/%{name}/clisp %{_sysconfdir}/bash_completion.d -fi +%do_triggerin clisp %triggerun -- clisp -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/clisp +%do_triggerun clisp %triggerin -- freeciv -if [ ! -e %{_sysconfdir}/bash_completion.d/freeciv ] ; then - ln -s %{_datadir}/%{name}/freeciv %{_sysconfdir}/bash_completion.d -fi +%do_triggerin freeciv %triggerun -- freeciv -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/freeciv +%do_triggerun freeciv %triggerin -- gcc-gnat -if [ ! -e %{_sysconfdir}/bash_completion.d/gnatmake ] ; then - ln -s %{_datadir}/%{name}/gnatmake %{_sysconfdir}/bash_completion.d -fi +%do_triggerin gnatmake %triggerun -- gcc-gnat -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/gnatmake +%do_triggerun gnatmake + +%triggerin -- gcl +%do_triggerin gcl +%triggerun -- gcl +%do_triggerun gcl %triggerin -- gkrellm -if [ ! -e %{_sysconfdir}/bash_completion.d/gkrellm ] ; then - ln -s %{_datadir}/%{name}/gkrellm %{_sysconfdir}/bash_completion.d -fi +%do_triggerin gkrellm %triggerun -- gkrellm -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/gkrellm +%do_triggerun gkrellm + +%triggerin -- lilypond +%do_triggerin lilypond +%triggerun -- lilypond +%do_triggerun lilypond %triggerin -- mailman -if [ ! -e %{_sysconfdir}/bash_completion.d/mailman ] ; then - ln -s %{_datadir}/%{name}/mailman %{_sysconfdir}/bash_completion.d -fi +%do_triggerin mailman %triggerun -- mailman -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/mailman +%do_triggerun mailman %triggerin -- mcrypt -if [ ! -e %{_sysconfdir}/bash_completion.d/mcrypt ] ; then - ln -s %{_datadir}/%{name}/mcrypt %{_sysconfdir}/bash_completion.d -fi +%do_triggerin mcrypt %triggerun -- mcrypt -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/mcrypt +%do_triggerun mcrypt + +%triggerin -- mercurial +%do_triggerin hg +%triggerun -- mercurial +%do_triggerun hg %triggerin -- mock -if [ ! -e %{_sysconfdir}/bash_completion.d/mock ] ; then - ln -s %{_datadir}/%{name}/mock %{_sysconfdir}/bash_completion.d -fi +%do_triggerin mock %triggerun -- mock -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/mock +%do_triggerun mock %triggerin -- mtx -if [ ! -e %{_sysconfdir}/bash_completion.d/mtx ] ; then - ln -s %{_datadir}/%{name}/mtx %{_sysconfdir}/bash_completion.d -fi +%do_triggerin mtx %triggerun -- mtx -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/mtx +%do_triggerun mtx + +%triggerin -- perl-SVK +%do_triggerin svk +%triggerun -- perl-SVK +%do_triggerun svk %triggerin -- plague-client -if [ ! -e %{_sysconfdir}/bash_completion.d/plague-client ] ; then - ln -s %{_datadir}/%{name}/plague-client %{_sysconfdir}/bash_completion.d -fi +%do_triggerin plague-client %triggerun -- plague-client -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/plague-client +%do_triggerun plague-client %triggerin -- ruby-ri -if [ ! -e %{_sysconfdir}/bash_completion.d/ri ] ; then - ln -s %{_datadir}/%{name}/ri %{_sysconfdir}/bash_completion.d -fi +%do_triggerin ri %triggerun -- ruby-ri -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/ri +%do_triggerun ri %triggerin -- sbcl -if [ ! -e %{_sysconfdir}/bash_completion.d/sbcl ] ; then - ln -s %{_datadir}/%{name}/sbcl %{_sysconfdir}/bash_completion.d -fi +%do_triggerin sbcl %triggerun -- sbcl -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/sbcl +%do_triggerun sbcl %triggerin -- snownews -if [ ! -e %{_sysconfdir}/bash_completion.d/snownews ] ; then - ln -s %{_datadir}/%{name}/snownews %{_sysconfdir}/bash_completion.d -fi +%do_triggerin snownews %triggerun -- snownews -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/snownews - -%triggerin -- subversion -if [ ! -e %{_sysconfdir}/bash_completion.d/subversion ] ; then - ln -s %{_datadir}/%{name}/subversion %{_sysconfdir}/bash_completion.d -fi -%triggerun -- subversion -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/subversion +%do_triggerun snownews %triggerin -- unace -if [ ! -e %{_sysconfdir}/bash_completion.d/unace ] ; then - ln -s %{_datadir}/%{name}/unace %{_sysconfdir}/bash_completion.d -fi +%do_triggerin unace %triggerun -- unace -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/unace +%do_triggerun unace %triggerin -- unixODBC -if [ ! -e %{_sysconfdir}/bash_completion.d/isql ] ; then - ln -s %{_datadir}/%{name}/isql %{_sysconfdir}/bash_completion.d -fi +%do_triggerin isql %triggerun -- unixODBC -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/isql +%do_triggerun isql %triggerin -- unrar -if [ ! -e %{_sysconfdir}/bash_completion.d/unrar ] ; then - ln -s %{_datadir}/%{name}/unrar %{_sysconfdir}/bash_completion.d -fi +%do_triggerin unrar %triggerun -- unrar -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/unrar +%do_triggerun unrar %triggerin -- yum-utils -if [ ! -e %{_sysconfdir}/bash_completion.d/repomanage ] ; then - ln -s %{_datadir}/%{name}/repomanage %{_sysconfdir}/bash_completion.d -fi +%do_triggerin repomanage %triggerun -- yum-utils -[ $2 -gt 0 ] || rm -f %{_sysconfdir}/bash_completion.d/repomanage +%do_triggerun repomanage %files -f %{name}-ghosts.list @@ -202,9 +182,20 @@ fi %changelog -* Sun Feb 12 2006 Ville Skyttä - 20050721-4.1 -- Revert back to expanded triggers, rpmbuild < 4.4 doesn't like the - macroized syntax. +* Sun Jun 24 2007 Jeff Sheltren - 20060301-4 +- Update triggers to work with older versions of RPM + +* Wed Feb 28 2007 Ville Skyttä - 20060301-3 +- Fix scp with single quotes (#217178). +- Borrow fix for bzip2 w/spaces, and apropos and whatis support from Debian. + +* Thu Aug 31 2006 Ville Skyttä - 20060301-2 +- Trigger-install support for gcl, lilypond, mercurial and svk. +- Improve mock completion a bit. + +* Thu Mar 2 2006 Ville Skyttä - 20060301-1 +- 20060301, patches and profile.d scriptlet applied/included upstream. +- Convert docs to UTF-8. * Wed Feb 8 2006 Ville Skyttä - 20050721-4 - Don't source ourselves in non-interactive shells (#180419, Behdad Esfahbod). diff --git a/sources b/sources index 4711a45..a4c62cd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4de9f0dee0663f08b5e24f64490e642e bash-completion-20050721.tar.bz2 +ed95a89f57357a42b8e4eb95487bf9d0 bash-completion-20060301.tar.bz2