[bash-completion] Fix ant completion when complete-ant-cmd.pl is N/A (#729771). Fix bash < 4 _filedir_xspec uppercase
Ville Skyttä
scop at fedoraproject.org
Mon Aug 15 21:57:16 UTC 2011
commit bdf5539ecd044c564e5a53cb152f9548d7295af8
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Tue Aug 16 00:56:55 2011 +0300
Fix ant completion when complete-ant-cmd.pl is N/A (#729771).
Fix bash < 4 _filedir_xspec uppercase expansion issue (#726220).
Drop _filedir_xspec self-parsing with bash >= 4 for speedups (#479936).
Do install triggers with lua where available to speed up package install.
Add completion for sum (#717341).
bash-completion-1.3-selfparse-479936.patch | 196 ++++++++++++++++++++++++++++
bash-completion-1.3-sum-717341.patch | 25 ++++
bash-completion-1.3-xspec-726220.patch | 25 ++++
bash-completion-1.3-yeswehave.patch | 15 ++-
bash-completion.spec | 42 +++++-
5 files changed, 297 insertions(+), 6 deletions(-)
---
diff --git a/bash-completion-1.3-selfparse-479936.patch b/bash-completion-1.3-selfparse-479936.patch
new file mode 100644
index 0000000..9c46e30
--- /dev/null
+++ b/bash-completion-1.3-selfparse-479936.patch
@@ -0,0 +1,196 @@
+diff -up bash-completion-1.3/bash_completion~ bash-completion-1.3/bash_completion
+--- bash-completion-1.3/bash_completion~ 2011-08-15 22:31:12.425983498 +0300
++++ bash-completion-1.3/bash_completion 2011-08-15 22:39:37.107327165 +0300
+@@ -64,68 +64,6 @@ shopt -s extglob progcomp
+ # Make directory commands see only directories
+ complete -d pushd
+
+-# The following section lists completions that are redefined later
+-# Do NOT break these over multiple lines.
+-#
+-# START exclude -- do NOT remove this line
+-# bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510
+-complete -f -X '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat
+-complete -f -X '!*.@(zip|[ejw]ar|exe|pk3|wsz|zargo|xpi|sxw|o[tx]t|od[fgpst]|epub|apk)' unzip zipinfo
+-complete -f -X '*.Z' compress znew
+-# zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510
+-complete -f -X '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat unpigz
+-complete -f -X '!*.Z' uncompress
+-# lzcmp, lzdiff intentionally not here, see Debian: #455510
+-complete -f -X '!*.@(tlz|lzma)' lzcat lzegrep lzfgrep lzgrep lzless lzmore unlzma
+-complete -f -X '!*.@(?(t)xz|tlz|lzma)' unxz xzcat
+-complete -f -X '!*.lrz' lrunzip
+-complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx)' ee
+-complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm)' xv qiv
+-complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.bz2|.BZ2|.Z))' gv ggv kghostview
+-complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' xdvi kdvi
+-complete -f -X '!*.dvi' dvips dviselect dvitype dvipdf advi dvipdfm dvipdfmx
+-complete -f -X '!*.[pf]df' acroread gpdf xpdf
+-complete -f -X '!*.@(?(e)ps|pdf)' kpdf
+-complete -f -X '!*.@(@(?(e)ps|?(E)PS|[pf]df|[PF]DF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|fdf)' evince
+-complete -f -X '!*.@(okular|@(?(e|x)ps|?(E|X)PS|pdf|PDF|dvi|DVI|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|epub|EPUB|odt|ODT|fb?(2)|FB?(2)|mobi|MOBI|g3|G3|chm|CHM|fdf|FDF)?(.?(gz|GZ|bz2|BZ2)))' okular
+-complete -f -X '!*.@(?(e)ps|pdf)' ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr
+-complete -f -X '!*.texi*' makeinfo texi2html
+-complete -f -X '!*.@(?(la)tex|texi|dtx|ins|ltx|dbj)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi
+-complete -f -X '!*.mp3' mpg123 mpg321 madplay
+-complete -f -X '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|t[ps]|T[PS]|m2t?(s)|M2T?(S)|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))?(.part)' xine aaxine fbxine
+-complete -f -X '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|t[ps]|T[PS]|m2t?(s)|M2T?(S)|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM|iso|ISO)|+([0-9]).@(vdr|VDR))?(.part)' kaffeine dragon
+-complete -f -X '!*.@(avi|asf|wmv)' aviplay
+-complete -f -X '!*.@(rm?(j)|ra?(m)|smi?(l))' realplay
+-complete -f -X '!*.@(mpg|mpeg|avi|mov|qt)' xanim
+-complete -f -X '!*.@(ogg|m3u|flac|spx)' ogg123
+-complete -f -X '!*.@(mp3|ogg|pls|m3u)' gqmpeg freeamp
+-complete -f -X '!*.fig' xfig
+-complete -f -X '!*.@(mid?(i)|cmf)' playmidi
+-complete -f -X '!*.@(mid?(i)|rmi|rcp|[gr]36|g18|mod|xm|it|x3m|s[3t]m|kar)' timidity
+-complete -f -X '!*.@(m[eo]d|s[3t]m|xm|it)' modplugplay modplug123
+-complete -f -X '*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
+-complete -f -X '!*.@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR])' wine
+-complete -f -X '!*.@(zip|z|gz|tgz)' bzme
+-# konqueror not here on purpose, it's more than a web/html browser
+-complete -f -X '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany
+-complete -f -X '!*.@(sxw|stw|sxg|sgl|doc?([mx])|dot?([mx])|rtf|txt|htm|html|?(f)odt|ott|odm)' oowriter
+-complete -f -X '!*.@(sxi|sti|pps?(x)|ppt?([mx])|pot?([mx])|?(f)odp|otp)' ooimpress
+-complete -f -X '!*.@(sxc|stc|xls?([bmx])|xlw|xlt?([mx])|[ct]sv|?(f)ods|ots)' oocalc
+-complete -f -X '!*.@(sxd|std|sda|sdd|?(f)odg|otg)' oodraw
+-complete -f -X '!*.@(sxm|smf|mml|odf)' oomath
+-complete -f -X '!*.odb' oobase
+-complete -f -X '!*.[rs]pm' rpm2cpio
+-complete -f -X '!*.aux' bibtex
+-complete -f -X '!*.po' poedit gtranslator kbabel lokalize
+-complete -f -X '!*.@([Pp][Rr][Gg]|[Cc][Ll][Pp])' harbour gharbour hbpp
+-complete -f -X '!*.[Hh][Rr][Bb]' hbrun
+-complete -f -X '!*.ly' lilypond ly2dvi
+-complete -f -X '!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))' cdiff
+-complete -f -X '!*.lyx' lyx
+-complete -f -X '!@(*.@(ks|jks|jceks|p12|pfx|bks|ubr|gkr|cer|crt|cert|p7b|pkipath|pem|p10|csr|crl)|cacerts)' portecle
+-complete -f -X '!*.@(mp[234c]|og[ag]|@(fl|a)ac|m4[abp]|spx|tta|w?(a)v|wma|aif?(f)|asf|ape)' kid3 kid3-qt
+-# FINISH exclude -- do not remove this line
+-
+ # start of section containing compspecs that can be handled within bash
+
+ # user commands see only users
+@@ -1582,25 +1520,17 @@ for i in a2ps awk bash bc bison cat colo
+ done
+ unset i
+
++declare -A _xspecs
+ _filedir_xspec()
+ {
+- local IFS cur xspec
+-
+- IFS=$'\n'
++ local cur
+ COMPREPLY=()
+ _get_comp_words_by_ref cur
+
+ _expand || return 0
+
+- # get first exclusion compspec that matches this command
+- xspec=$( awk "/^complete[ \t]+.*[ \t]${1##*/}([ \t]|\$)/ { print \$0; exit }" \
+- "$BASH_COMPLETION" )
+- # prune to leave nothing but the -X spec
+- xspec=${xspec#*-X }
+- xspec=${xspec%% *}
+-
++ local IFS=$'\n' xspec=${_xspecs[${1##*/}]} tmp
+ local -a toks
+- local tmp
+
+ toks=( ${toks[@]-} $(
+ compgen -d -- "$(quote_readline "$cur")" | {
+@@ -1633,28 +1563,73 @@ _filedir_xspec()
+ [ ${#toks[@]} -ne 0 ] && _compopt_o_filenames
+ COMPREPLY=( "${toks[@]}" )
+ }
+-list=( $( sed -ne '/^# START exclude/,/^# FINISH exclude/p' "$BASH_COMPLETION" | \
+- # read exclusion compspecs
+- (
+- while read line
+- do
+- # ignore compspecs that are commented out
+- if [ "${line#\#}" != "$line" ]; then continue; fi
+- line=${line%# START exclude*}
+- line=${line%# FINISH exclude*}
+- line=${line##*\'}
+- list=( "${list[@]}" $line )
++
++_install_xspec()
++{
++ local xspec=$1 cmd
++ shift
++ for cmd in $@; do
++ _xspecs[$cmd]=$xspec
+ done
+- printf '%s ' "${list[@]}"
+- )
+- ) )
+-# remove previous compspecs
+-if [ ${#list[@]} -gt 0 ]; then
+- eval complete -r ${list[@]}
+- # install new compspecs
+- eval complete -F _filedir_xspec "${list[@]}"
+-fi
+-unset list
++ complete -F _filedir_xspec $@
++}
++# bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510
++_install_xspec '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat
++_install_xspec '!*.@(zip|[ejw]ar|exe|pk3|wsz|zargo|xpi|sxw|o[tx]t|od[fgpst]|epub|apk)' unzip zipinfo
++_install_xspec '*.Z' compress znew
++# zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510
++_install_xspec '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat unpigz
++_install_xspec '!*.Z' uncompress
++# lzcmp, lzdiff intentionally not here, see Debian: #455510
++_install_xspec '!*.@(tlz|lzma)' lzcat lzegrep lzfgrep lzgrep lzless lzmore unlzma
++_install_xspec '!*.@(?(t)xz|tlz|lzma)' unxz xzcat
++_install_xspec '!*.lrz' lrunzip
++_install_xspec '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx)' ee
++_install_xspec '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm)' xv qiv
++_install_xspec '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.bz2|.BZ2|.Z))' gv ggv kghostview
++_install_xspec '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' xdvi kdvi
++_install_xspec '!*.dvi' dvips dviselect dvitype dvipdf advi dvipdfm dvipdfmx
++_install_xspec '!*.[pf]df' acroread gpdf xpdf
++_install_xspec '!*.@(?(e)ps|pdf)' kpdf
++_install_xspec '!*.@(@(?(e)ps|?(E)PS|[pf]df|[PF]DF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|fdf)' evince
++_install_xspec '!*.@(okular|@(?(e|x)ps|?(E|X)PS|pdf|PDF|dvi|DVI|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|epub|EPUB|odt|ODT|fb?(2)|FB?(2)|mobi|MOBI|g3|G3|chm|CHM|fdf|FDF)?(.?(gz|GZ|bz2|BZ2)))' okular
++_install_xspec '!*.@(?(e)ps|pdf)' ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr
++_install_xspec '!*.texi*' makeinfo texi2html
++_install_xspec '!*.@(?(la)tex|texi|dtx|ins|ltx|dbj)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi
++_install_xspec '!*.mp3' mpg123 mpg321 madplay
++_install_xspec '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|t[ps]|T[PS]|m2t?(s)|M2T?(S)|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))?(.part)' xine aaxine fbxine
++_install_xspec '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|t[ps]|T[PS]|m2t?(s)|M2T?(S)|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM|iso|ISO)|+([0-9]).@(vdr|VDR))?(.part)' kaffeine dragon
++_install_xspec '!*.@(avi|asf|wmv)' aviplay
++_install_xspec '!*.@(rm?(j)|ra?(m)|smi?(l))' realplay
++_install_xspec '!*.@(mpg|mpeg|avi|mov|qt)' xanim
++_install_xspec '!*.@(ogg|m3u|flac|spx)' ogg123
++_install_xspec '!*.@(mp3|ogg|pls|m3u)' gqmpeg freeamp
++_install_xspec '!*.fig' xfig
++_install_xspec '!*.@(mid?(i)|cmf)' playmidi
++_install_xspec '!*.@(mid?(i)|rmi|rcp|[gr]36|g18|mod|xm|it|x3m|s[3t]m|kar)' timidity
++_install_xspec '!*.@(m[eo]d|s[3t]m|xm|it)' modplugplay modplug123
++_install_xspec '*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
++_install_xspec '!*.@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR])' wine
++_install_xspec '!*.@(zip|z|gz|tgz)' bzme
++# konqueror not here on purpose, it's more than a web/html browser
++_install_xspec '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany
++_install_xspec '!*.@(sxw|stw|sxg|sgl|doc?([mx])|dot?([mx])|rtf|txt|htm|html|?(f)odt|ott|odm)' oowriter
++_install_xspec '!*.@(sxi|sti|pps?(x)|ppt?([mx])|pot?([mx])|?(f)odp|otp)' ooimpress
++_install_xspec '!*.@(sxc|stc|xls?([bmx])|xlw|xlt?([mx])|[ct]sv|?(f)ods|ots)' oocalc
++_install_xspec '!*.@(sxd|std|sda|sdd|?(f)odg|otg)' oodraw
++_install_xspec '!*.@(sxm|smf|mml|odf)' oomath
++_install_xspec '!*.odb' oobase
++_install_xspec '!*.[rs]pm' rpm2cpio
++_install_xspec '!*.aux' bibtex
++_install_xspec '!*.po' poedit gtranslator kbabel lokalize
++_install_xspec '!*.@([Pp][Rr][Gg]|[Cc][Ll][Pp])' harbour gharbour hbpp
++_install_xspec '!*.[Hh][Rr][Bb]' hbrun
++_install_xspec '!*.ly' lilypond ly2dvi
++_install_xspec '!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))' cdiff
++_install_xspec '!*.lyx' lyx
++_install_xspec '!@(*.@(ks|jks|jceks|p12|pfx|bks|ubr|gkr|cer|crt|cert|p7b|pkipath|pem|p10|csr|crl)|cacerts)' portecle
++_install_xspec '!*.@(mp[234c]|og[ag]|@(fl|a)ac|m4[abp]|spx|tta|w?(a)v|wma|aif?(f)|asf|ape)' kid3 kid3-qt
++unset -f _install_xspec
+
+ # source completion directory definitions
+ if [[ -d $BASH_COMPLETION_COMPAT_DIR && -r $BASH_COMPLETION_COMPAT_DIR && \
diff --git a/bash-completion-1.3-sum-717341.patch b/bash-completion-1.3-sum-717341.patch
new file mode 100644
index 0000000..ba42db2
--- /dev/null
+++ b/bash-completion-1.3-sum-717341.patch
@@ -0,0 +1,25 @@
+From e7b3abf689e9608aa60e6a4504df136022987633 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Wed, 29 Jun 2011 00:22:54 +0300
+Subject: [PATCH] sum: New (generic long option) completion (RedHat: #717341).
+
+---
+ bash_completion | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/bash_completion b/bash_completion
+index e5577e3..eae72eb 100644
+--- a/bash_completion
++++ b/bash_completion
+@@ -1696,7 +1696,7 @@ for i in a2ps awk bash bc bison cat colordiff cp csplit \
+ curl cut date df diff dir du enscript env expand fmt fold gperf gprof \
+ grep grub head indent irb ld ldd less ln ls m4 md5sum mkdir mkfifo mknod \
+ mv netstat nl nm objcopy objdump od paste patch pr ptx readelf rm rmdir \
+- sed seq sha{,1,224,256,384,512}sum shar sort split strip tac tail tee \
++ sed seq sha{,1,224,256,384,512}sum shar sort split strip sum tac tail tee \
+ texindex touch tr uname unexpand uniq units vdir wc wget who; do
+ have $i && complete -F _longopt -o default $i
+ done
+--
+1.7.2.5
+
diff --git a/bash-completion-1.3-xspec-726220.patch b/bash-completion-1.3-xspec-726220.patch
new file mode 100644
index 0000000..6526e7e
--- /dev/null
+++ b/bash-completion-1.3-xspec-726220.patch
@@ -0,0 +1,25 @@
+From 75309e9f254ee4e5e31e85e18c782e64707a6d22 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Mon, 15 Aug 2011 21:55:19 +0300
+Subject: [PATCH] _filedir_xspec: Don't expand $xspec while uppercasing on bash-3 (RedHat: #726220).
+
+---
+ bash_completion | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/bash_completion b/bash_completion
+index 6601937..1844e81 100644
+--- a/bash_completion
++++ b/bash_completion
+@@ -1616,7 +1616,7 @@ _filedir_xspec()
+ fi
+ [[ ${BASH_VERSINFO[0]} -ge 4 ]] && \
+ xspec="$matchop($xspec|${xspec^^})" || \
+- xspec="$matchop($xspec|$(printf %s $xspec | tr '[:lower:]' '[:upper:]'))"
++ xspec="$matchop($xspec|$(tr '[:lower:]' '[:upper:]' <<<$xspec))"
+
+ toks=( ${toks[@]-} $(
+ eval compgen -f -X "!$xspec" -- "\$(quote_readline "\$cur")" | {
+--
+1.7.2.5
+
diff --git a/bash-completion-1.3-yeswehave.patch b/bash-completion-1.3-yeswehave.patch
index 7945304..9b77c09 100644
--- a/bash-completion-1.3-yeswehave.patch
+++ b/bash-completion-1.3-yeswehave.patch
@@ -1,6 +1,6 @@
diff -up bash-completion-1.3/bash_completion.orig bash-completion-1.3/bash_completion
--- bash-completion-1.3/bash_completion.orig 2011-02-06 21:16:00.000000000 +0200
-+++ bash-completion-1.3/bash_completion 2011-04-12 21:34:55.527355045 +0300
++++ bash-completion-1.3/bash_completion 2011-08-15 12:52:42.040790631 +0300
@@ -171,7 +171,11 @@ have()
unset -v have
# Completions for system administrator commands are installed as well in
@@ -14,3 +14,16 @@ diff -up bash-completion-1.3/bash_completion.orig bash-completion-1.3/bash_compl
have="yes"
}
+diff -up bash-completion-1.3/completions/ant.orig bash-completion-1.3/completions/ant
+--- bash-completion-1.3/completions/ant.orig 2011-01-21 11:36:11.000000000 +0200
++++ bash-completion-1.3/completions/ant 2011-08-15 12:54:52.717060687 +0300
+@@ -57,7 +57,8 @@ _ant()
+ -- "$cur" ) )
+ fi
+ }
+-have complete-ant-cmd.pl && \
++# https://bugzilla.redhat.com/729771
++PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type complete-ant-cmd.pl &>/dev/null && \
+ complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant
+ }
+
diff --git a/bash-completion.spec b/bash-completion.spec
index 54bc4b2..909180b 100644
--- a/bash-completion.spec
+++ b/bash-completion.spec
@@ -3,7 +3,7 @@
Name: bash-completion
Version: 1.3
-Release: 4%{?dist}
+Release: 5%{?dist}
Epoch: 1
Summary: Programmable completion for Bash
@@ -19,14 +19,20 @@ Source3: %{name}-1.3-filedir.bash
Patch0: %{name}-1.3-helpersdir.patch
# Non-upstream: see comments in patch
Patch1: %{name}-1.3-yeswehave.patch
-# From upstream post 1.3 git
+# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=d066ace
Patch2: %{name}-1.3-gendiff.patch
-# From upstream post 1.3 git
+# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=f1b9580
Patch3: %{name}-1.3-manpager-689180.patch
-# From upstream post 1.3 git
+# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=e10848b
Patch4: %{name}-1.3-libreoffice-692548.patch
-# From upstream post 1.3 git
+# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=2eb713f
Patch5: %{name}-1.3-latexdbj-678122.patch
+# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=75309e9
+Patch6: %{name}-1.3-xspec-726220.patch
+# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=d74e169
+Patch7: %{name}-1.3-selfparse-479936.patch
+# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=e7b3abf
+Patch8: %{name}-1.3-sum-717341.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -35,7 +41,12 @@ BuildRequires: dejagnu
BuildRequires: screen
BuildRequires: tcllib
%endif
+%if 0%{?fedora} || 0%{?rhel} > 5
+# For Patch7
+Requires: bash >= 4
+%else
Requires: bash >= 3.2
+%endif
# For symlinking in triggers, #490768
Requires: coreutils
@@ -52,6 +63,12 @@ of the programmable completion feature of bash.
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
+%if 0%{?fedora} || 0%{?rhel} > 5
+# bash >= 4 only
+%patch7 -p1
+%endif
+%patch8 -p1
install -pm 644 %{SOURCE2} .
@@ -156,9 +173,17 @@ rm -rf $RPM_BUILD_ROOT
# conditional is apparently evaluated too early (at spec parse time when arg 2
# is never defined)?
%define bashcomp_trigger() \
+%if 0%{?fedora} || 0%{?rhel} > 5\
+%triggerin -p <lua> -- %{?2}%{!?2:%1}\
+if not posix.access("%{_sysconfdir}/bash_completion.d/%1") then\
+ posix.symlink("%{_datadir}/%{name}/%1",\
+ "%{_sysconfdir}/bash_completion.d/%1")\
+end\
+%else\
%triggerin -- %{?2}%{!?2:%1}\
[ -e %{_sysconfdir}/bash_completion.d/%1 ] || \\\
ln -s %{_datadir}/%{name}/%1 %{_sysconfdir}/bash_completion.d || :\
+%endif\
%triggerun -- %{?2}%{!?2:%1}\
[ $2 -gt 0 ]%{?3: || [ -x %3 ]}%{?4: || [ -x %4 ]}%{?5: || [ -x %5 ]} || \\\
rm -f %{_sysconfdir}/bash_completion.d/%1 || :\
@@ -384,6 +409,13 @@ fi
%changelog
+* Mon Aug 15 2011 Ville Skyttä <ville.skytta at iki.fi> - 1:1.3-5
+- Fix ant completion when complete-ant-cmd.pl is N/A (#729771).
+- Fix bash < 4 _filedir_xspec uppercase expansion issue (#726220).
+- Drop _filedir_xspec self-parsing with bash >= 4 for speedups (#479936).
+- Do install triggers with lua where available to speed up package install.
+- Add completion for sum (#717341).
+
* Tue May 10 2011 Ville Skyttä <ville.skytta at iki.fi> - 1:1.3-4
- Work around problems caused by Adobe Reader overriding _filedir (#677446).
More information about the scm-commits
mailing list