From 7ebfc135cb9ea8bc963e804c772bb82a3789d6d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 11 Oct 2009 14:27:59 +0000 Subject: [PATCH] - up to 1.1-release Changed files: bash-completion-psheader.patch -> 1.3 bash-completion-rpm-cache.patch -> 1.10 bash-completion-service.patch -> 1.3 bash-completion.spec -> 1.154 --- bash-completion-psheader.patch | 36 --------------------- bash-completion-rpm-cache.patch | 55 +++++++++++++-------------------- bash-completion-service.patch | 19 ------------ bash-completion.spec | 44 ++++++++++---------------- 4 files changed, 39 insertions(+), 115 deletions(-) delete mode 100644 bash-completion-psheader.patch delete mode 100644 bash-completion-service.patch diff --git a/bash-completion-psheader.patch b/bash-completion-psheader.patch deleted file mode 100644 index ee088a1..0000000 --- a/bash-completion-psheader.patch +++ /dev/null @@ -1,36 +0,0 @@ -skip sed run for ps output filtering as ps itself can omit the headers - --- -Signed-off-by: Elan Ruusamäe - ---- bash-completion/bash_completion~ 2009-05-24 01:07:50.000000000 +0300 -+++ bash-completion/bash_completion 2009-05-24 01:12:42.638288264 +0300 -@@ -447,7 +447,7 @@ - } || - _pids() - { -- COMPREPLY=( $( compgen -W '$( command ps axo pid | sed 1d )' -- $cur ) ) -+ COMPREPLY=( $( compgen -W '$( command ps axo pid= )' -- $cur ) ) - } - - # This function completes on process group IDs. -@@ -459,7 +459,7 @@ - } || - _pgids() - { -- COMPREPLY=( $( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur )) -+ COMPREPLY=( $( compgen -W '$( command ps axo pgid= )' -- $cur )) - } - - # This function completes on process names. -@@ -482,8 +482,8 @@ - # for now. - # Not using "ps axo comm" because under some Linux kernels, it - # truncates command names (see e.g. http://bugs.debian.org/497540#19) -- COMPREPLY=( $( compgen -W '$( command ps axo command | \ -- sed -e "1d; s/ .*//; s:.*/::; s/:$//;" \ -+ COMPREPLY=( $( compgen -W '$( command ps axo command= | \ -+ sed -e "s/ .*//; s:.*/::; s/:$//;" \ - -e "s/^[[(-]//; s/[])]$//" \ - -e "s/^$//")' \ - -- $cur ) ) diff --git a/bash-completion-rpm-cache.patch b/bash-completion-rpm-cache.patch index 99f2a7f..17dc5d0 100644 --- a/bash-completion-rpm-cache.patch +++ b/bash-completion-rpm-cache.patch @@ -4,40 +4,29 @@ add version+release+arch to installed packages filter -- Signed-off-by: Elan Ruusamäe ---- bash-completion/contrib/rpm~ 2009-07-21 06:28:45.000000000 +0300 -+++ bash-completion/contrib/rpm 2009-07-21 06:37:08.381279143 +0300 -@@ -6,17 +6,31 @@ - # - _rpm_installed_packages() +--- bash-completion-1.1/contrib/rpm~ 2009-10-09 15:49:31.000000000 +0300 ++++ bash-completion-1.1/contrib/rpm 2009-10-10 23:49:53.931350555 +0300 +@@ -7,15 +7,21 @@ { -- local ver nodig="$1" nosig="$2" -+ local nodig="$1" nosig="$2" -+ -+ # if rpm (4.4.7+) is configured to export it's rpmdb to /var/cache/hrmib (%_hrmib_path) -+ if [ -d /var/cache/hrmib -a -r /var/cache/hrmib ]; then -+ COMPREPLY=( $( LC_ALL=C command ls -1 /var/cache/hrmib | sed -ne '/^'$cur'/p') ) -+ return -+ fi -+ -+ # refresh cache if writable. -+ if [ -w /var/log/rpmpkgs -a /var/log/rpmpkgs -ot /var/lib/rpm/Packages ]; then -+ # we grab the output to local variable to prevent possible race -+ _rpm_nodigsig -+ local tmp=$(rpm -qa $nodig $nosig --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n') -+ echo "$tmp" > /var/log/rpmpkgs -+ fi + local nodig="$1" nosig="$2" - if [ -r /var/log/rpmpkgs -a \ - /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then - # using RHL 7.2 or later - this is quicker than querying the DB - COMPREPLY=( $( sed -ne \ -- 's|^\('$cur'[^[:space:]]*\)-[^[:space:]-]\+-[^[:space:]-]\+\.rpm$|\1|p' \ -+ 's|^\('$cur'.*\)\.rpm$|\1|p' \ - /var/log/rpmpkgs ) ) - else - _rpm_nodigsig -- COMPREPLY=( $( rpm -qa $nodig $nosig --qf='%{NAME} ' "$cur*" ) ) -+ COMPREPLY=( $( rpm -qa $nodig $nosig --qf '%{name}-%{version}-%{release}.%{arch}\n' "$cur*" ) ) - fi ++ # if rpm (4.4.7+) is configured to export it's rpmdb to /var/cache/hrmib (%_hrmib_path) ++ if [ -d /var/cache/hrmib -a -r /var/cache/hrmib ]; then ++ COMPREPLY=( $( LC_ALL=C command ls -1 /var/cache/hrmib | sed -ne '/^'$cur'/p') ) ++ return ++ fi ++ + if [ -r /var/log/rpmpkgs -a \ + /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then + # using RHL 7.2 or later - this is quicker than querying the DB + COMPREPLY=( $( sed -ne \ +- 's|^\('$cur'[^[:space:]]*\)-[^[:space:]-]\+-[^[:space:]-]\+\.rpm$|\1|p' \ ++ 's|^\('$cur'.*\)\.rpm$|\1|p' \ + /var/log/rpmpkgs ) ) + else + _rpm_nodigsig +- COMPREPLY=( $( rpm -qa $nodig $nosig --qf='%{NAME} ' "$cur*" ) ) ++ COMPREPLY=( $( rpm -qa $nodig $nosig --qf '%{name}-%{version}-%{release}.%{arch}\n' "$cur*" ) ) + fi } diff --git a/bash-completion-service.patch b/bash-completion-service.patch deleted file mode 100644 index b8e5fa7..0000000 --- a/bash-completion-service.patch +++ /dev/null @@ -1,19 +0,0 @@ -match Usage filters from PLD Linux initscripts -sample initscript template can be found from here: - -http://svn.pld-linux.org/cgi-bin/viewsvn/rc-scripts/trunk/rc.d/init.d/template.init?rev=HEAD&view=log - --- -Signed-off-by: Elan Ruusamäe - ---- bash-completion-1.0/bash_completion~ 2009-05-12 12:05:37.000000000 +0300 -+++ bash-completion-1.0/bash_completion 2009-05-12 12:07:58.771759678 +0300 -@@ -751,7 +751,7 @@ - _services - else - COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ -- s/^.*Usage.*{\(.*\)}.*$/\1/p" \ -+ s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \ - $sysvdir/${prev##*/} 2>/dev/null`' -- $cur ) ) - fi - diff --git a/bash-completion.spec b/bash-completion.spec index 220ee06..83a6179 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -4,24 +4,19 @@ # - use mkinitrd and update for geninitrd # - can we have duplicate trigger on pwdutils pkg? merge files? # - fix vim not to mark this file as bash -%define snap 20090917 -%define rel 0.4 Summary: bash-completion offers programmable completion for bash Summary(pl.UTF-8): Programowalne uzupełnianie nazw dla basha Name: bash-completion -Version: 1.0 -Release: 3.%{snap}.%{rel} +Version: 1.1 +Release: 1 Epoch: 1 License: GPL Group: Applications/Shells -#Source0: http://bash-completion.alioth.debian.org/files/%{name}-%{version}.tar.gz -Source0: %{name}.tar.bz2 -# Source0-md5: ab8de6cd1b8c921ec6aa0b641364e4d0 +Source0: http://bash-completion.alioth.debian.org/files/%{name}-%{version}.tar.gz +# Source0-md5: 593d3edcf287b9e9d735049bd4d3f229 Source1: %{name}-poldek.sh Source2: %{name}.sh Patch0: %{name}-rpm-cache.patch -Patch1: %{name}-service.patch -Patch2: %{name}-psheader.patch URL: http://bash-completion.alioth.debian.org/ Requires(triggerpostun): sed >= 4.0 Requires: bash >= 2.05a-3 @@ -40,15 +35,10 @@ wbudowanych rozszerzeniach basha 2.04 lub późniejszego umożliwiającego kompletowanie parametrów linii poleceń. %prep -%setup -q -n %{name} +%setup -q %patch0 -p1 -%patch1 -p1 -%patch2 -p1 cp -a %{SOURCE1} contrib/poldek -# this is dir -rm -r doc/html~ - # cleanup backups after patching find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f @@ -61,7 +51,7 @@ mv contrib/{_,}yum rm contrib/apache2ctl # No PLD package or no such binary to complete on -rm contrib/{harbour,larch,lisp,modules,monodevelop,p4,cowsay,cpan2dist} +rm contrib/{larch,lisp,modules,monodevelop,p4,cowsay,cpan2dist} rm contrib/{cfengine,mkinitrd,repomanage,rpmcheck} rm contrib/{kldload,pkg_install,portupgrade,pkgtools} # FreeBSD Stuff rm contrib/{apt-build,dselect,mock,reportbug,sysv-rc,update-alternatives} @@ -71,18 +61,18 @@ rm contrib/configure # split freeciv-client,freeciv-server as we have these in separate packages mv contrib/freeciv . -%{__sed} -ne '1,/complete -F _civserver civserver/p' freeciv > contrib/freeciv-server -%{__sed} -ne '1,3p;/civclient/,$p' freeciv > contrib/freeciv-client -if [ $(md5sum freeciv | awk '{print $1}') != "2d3df0051726f87c11795b7292c332fc" ]; then +%{__sed} -ne '/civserver completion/,/complete -F _civserver civserver/p;/# Local/,/# ex:/p' freeciv > contrib/freeciv-server +%{__sed} -ne '/civclient completion/,/complete -F _civclient civclient/p;/# Local/,/# ex:/p' freeciv > contrib/freeciv-client +if [ $(md5sum freeciv | awk '{print $1}') != "aaaba09338c01cf3c14bbd1bdcb0897f" ]; then : check that split out contrib/freeciv-{client,server} are ok and update md5sum exit 1 fi # split munin as we have subpackage for node mv contrib/munin-node . -%{__sed} -ne '1,/complete -F _munin-update munin-update/p' munin-node > contrib/munin -%{__sed} -ne '1,3p;/munin-node-configure/,$p' munin-node > contrib/munin-node -if [ $(md5sum munin-node | awk '{print $1}') != "05a418afed08983a852145e472d5b2e9" ]; then +%{__sed} -ne '1,2p;/have munin-update /,/complete -F _munin-update/p;/have munin-run /,/complete -F _munin-run/p;/# Local/,/# ex:/p' munin-node > contrib/munin +%{__sed} -ne '1,2p;/have munin-node-configure /,/complete -F _munin-node-configure/p;/# Local/,/# ex:/p' munin-node > contrib/munin-node +if [ $(md5sum munin-node | awk '{print $1}') != "78a95bb707452778355af992e8fe30fa" ]; then : check that split out contrib/munin{,-node} are ok and update md5sum exit 1 fi @@ -90,8 +80,8 @@ fi # we have lastlog in sysvinit package mv contrib/shadow . %{__sed} -ne '1,/complete -F _faillog faillog/p' shadow > contrib/shadow -%{__sed} -ne '1,3p;/lastlog/,$p' shadow > contrib/sysvinit -if [ $(md5sum shadow | awk '{print $1}') != "4dfef3151921fd9644566a3244038f85" ]; then +%{__sed} -ne '1,2p;/have lastlog/,$p' shadow > contrib/sysvinit +if [ $(md5sum shadow | awk '{print $1}') != "c62642a786329aa07702b0c09965a9e8" ]; then : check that split out contrib/{shadow,sysvinit} are ok and update md5sum exit 1 fi @@ -124,7 +114,7 @@ fi cp -a bash_completion $RPM_BUILD_ROOT%{_sysconfdir} cp -a contrib/* $RPM_BUILD_ROOT%{_datadir}/%{name} -install %{SOURCE2} $RPM_BUILD_ROOT/etc/shrc.d +cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/shrc.d # Take care of contrib files for a in contrib/*; do @@ -226,7 +216,6 @@ fi\ %bashcomp_trigger lftp %bashcomp_trigger libxml2-progs xmllint %bashcomp_trigger lilo -%bashcomp_trigger lilypond %bashcomp_trigger links %bashcomp_trigger lvm2 lvm %bashcomp_trigger lzma,xz lzma @@ -270,6 +259,7 @@ fi\ %bashcomp_trigger rcs %bashcomp_trigger rdesktop %bashcomp_trigger resolvconf +%bashcomp_trigger rfkill %bashcomp_trigger rpm %bashcomp_trigger rrdtool %bashcomp_trigger rsync @@ -360,7 +350,6 @@ fi\ %{_datadir}/%{name}/ldapvi %{_datadir}/%{name}/lftp %{_datadir}/%{name}/lilo -%{_datadir}/%{name}/lilypond %{_datadir}/%{name}/links %{_datadir}/%{name}/lvm %{_datadir}/%{name}/lzma @@ -398,6 +387,7 @@ fi\ %{_datadir}/%{name}/rcs %{_datadir}/%{name}/rdesktop %{_datadir}/%{name}/resolvconf +%{_datadir}/%{name}/rfkill %{_datadir}/%{name}/ri %{_datadir}/%{name}/rpcdebug %{_datadir}/%{name}/rpm -- 2.43.0