- Borrow/improve/adapt to Fedora some patches from Mandriva: improved

support for getent and rpm --eval, better rpm backup file avoidance,
    lzma support.
- Patch/unpatch to fix gzip and bzip2 options completion.
- Patch to add --rsyncable to gzip options completion.
- Add and trigger-install support for lzop.
- Associate *.sqlite with sqlite3.
This commit is contained in:
Ville Skyttä 2008-09-11 18:20:09 +00:00
parent be46a5350f
commit d7d3d8af08
9 changed files with 283 additions and 10 deletions

View File

@ -9,12 +9,3 @@
# renice(8) completion # 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]}

View File

@ -0,0 +1,28 @@
diff -up bash_completion/bash_completion~ bash_completion/bash_completion
--- bash_completion/bash_completion~ 2006-03-01 18:20:18.000000000 +0200
+++ bash_completion/bash_completion 2008-09-07 12:25:42.000000000 +0300
@@ -8379,19 +8379,19 @@ _getent()
COMPREPLY=( $( compgen -A hostname $cur ) )
return 0
;;
- protocols)
- COMPREPLY=( $( getent protocols | awk '{print $1}' | grep "^$cur" ) )
+ protocols|networks|ahosts|ahostsv4|ahostsv6|rpc)
+ COMPREPLY=( $( getent $prev | awk '{print $1}' | grep "^$cur" ) )
return 0
;;
- networks)
- COMPREPLY=( $( getent networks | awk '{print $1}' | grep "^$cur" ) )
+ aliases|shadow)
+ COMPREPLY=( $( getent $prev | cut -d : -f 1 | grep "^$cur" ) )
return 0
;;
esac
if [ $COMP_CWORD -eq 1 ]; then
- COMPREPLY=( $( compgen -W 'passwd group hosts services protocols networks' -- $cur ) )
+ COMPREPLY=( $( compgen -W 'passwd group hosts services protocols networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc shadow' -- $cur ) )
fi
} &&
complete -F _getent getent

View File

@ -0,0 +1,21 @@
diff -up bash_completion/bash_completion~ bash_completion/bash_completion
--- bash_completion/bash_completion~ 2006-03-01 18:20:18.000000000 +0200
+++ bash_completion/bash_completion 2008-09-11 01:29:49.000000000 +0300
@@ -3281,7 +3281,7 @@ complete -F _mysqladmin mysqladmin
have gzip &&
_gzip()
{
- local cur prev xspec IFS=$'\t\n'
+ local cur prev xspec
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
@@ -3290,7 +3290,7 @@ _gzip()
--stdout --decompress --force --help --list \
--license --no-name --name --quiet --recursive \
--suffix --test --verbose --version --fast \
- --best' -- $cur ) )
+ --best --rsyncable' -- $cur ) )
return 0
fi

View File

@ -0,0 +1,84 @@
diff -up bash_completion/bash_completion~ bash_completion/bash_completion
--- bash_completion/bash_completion~ 2006-03-01 18:20:18.000000000 +0200
+++ bash_completion/bash_completion 2008-09-10 19:02:25.000000000 +0300
@@ -796,7 +796,7 @@ _man()
# weed out directory path names and paths to man pages
COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
# strip suffix from man pages
- COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2)} )
+ COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|lzma)} )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
[[ "$prev" != [0-9ln] ]] && _filedir '[0-9ln]'
@@ -1971,7 +1971,7 @@ _rpm()
elif [[ ${COMP_WORDS[1]} == -b* ]]; then
_filedir 'spec'
else
- _filedir '@(tgz|tar.@(gz|bz2))'
+ _filedir '@(tgz|tar.@(gz|bz2|lzma))'
fi
;;
--re@(build|compile))
@@ -1983,7 +1983,7 @@ _rpm()
fi
;;
--tarbuild)
- _filedir '@(tgz|tar.@(gz|bz2))'
+ _filedir '@(tgz|tar.@(gz|bz2|lzma))'
;;
--@(re|add)sign)
_filedir 'rpm'
@@ -3356,6 +3356,44 @@ _bzip2()
} &&
complete -F _bzip2 $filenames bzip2
+# lzma(1) completion
+#
+have lzma &&
+_lzma()
+{
+ local cur prev xspec
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-c -d -f -h -k -L -q -s \
+ -v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \
+ --help --decompress --compress --keep --force \
+ --test --stdout --quiet --verbose --license \
+ --version --small --fast --best --text' -- $cur ) )
+ return 0
+ fi
+
+ xspec="*.lzma"
+ if [[ "$prev" == --* ]]; then
+ [[ "$prev" == --decompress || \
+ "$prev" == --list || \
+ "$prev" == --test ]] && xspec="!"$xspec
+ [[ "$prev" == --compress ]] && xspec=
+ elif [[ "$prev" == -* ]]; then
+ [[ "$prev" == -*[dt]* ]] && xspec="!"$xspec
+ [[ "$prev" == -*z* ]] && xspec=
+ fi
+
+ _expand || return 0
+
+ COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
+ $( compgen -d -- $cur ) )
+} &&
+complete -F _lzma $filenames lzma
+
# openssl(1) completion
#
have openssl && {
@@ -6968,7 +7006,7 @@ _info()
fi;
done
# strip suffix from info pages
- COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2)} )
+ COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|lzma)} )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
return 0

View File

@ -0,0 +1,43 @@
diff -up bash_completion/bash_completion~ bash_completion/bash_completion
--- bash_completion/bash_completion~ 2006-03-01 18:20:18.000000000 +0200
+++ bash_completion/bash_completion 2008-09-07 12:12:11.000000000 +0300
@@ -348,10 +348,10 @@ _services()
local sysvdir famdir
[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
famdir=/etc/xinetd.d
- COMPREPLY=( $( builtin echo $sysvdir/!(*.rpmsave|*.rpmorig|*~|functions)) )
+ COMPREPLY=( $( builtin echo $sysvdir/!(*.rpmsave|*.rpmorig|*.rpmnew|*~|functions)) )
if [ -d $famdir ]; then
- COMPREPLY=( ${COMPREPLY[@]} $( builtin echo $famdir/!(*.rpmsave|*.rpmorig|*~)) )
+ COMPREPLY=( ${COMPREPLY[@]} $( builtin echo $famdir/!(*.rpmsave|*.rpmorig|*.rpmnew|*~)) )
fi
COMPREPLY=( $( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- $cur ) )
@@ -8679,7 +8679,7 @@ _update_rc_d()
[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \
|| sysvdir=/etc/init.d
- services=( $(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm*)) )
+ services=( $(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpmsave|*.rpmorig|*.rpmnew)) )
services=( ${services[@]#$sysvdir/} )
options=( -f -n )
@@ -8745,7 +8745,7 @@ _invoke_rc_d()
[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \
|| sysvdir=/etc/init.d
- services=( $(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm*)) )
+ services=( $(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpmsave|*.rpmorig|*.rpmnew)) )
services=( ${services[@]#$sysvdir/} )
options=( --help --quiet --force --try-anyway --disclose-deny --query --no-fallback )
@@ -9281,7 +9281,7 @@ unset list
if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \
-x $BASH_COMPLETION_DIR ]; then
for i in $BASH_COMPLETION_DIR/*; do
- [[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|.rpm*) ]] &&
+ [[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpmsave|*.rpmorig|*.rpmnew) ]] &&
[ \( -f $i -o -h $i \) -a -r $i ] && . $i
done
fi

View File

@ -0,0 +1,25 @@
diff -up bash_completion/bash_completion~ bash_completion/bash_completion
--- bash_completion/bash_completion~ 2006-03-01 18:20:18.000000000 +0200
+++ bash_completion/bash_completion 2008-09-07 12:34:55.000000000 +0300
@@ -1809,7 +1809,7 @@ _rpm()
--import' -- $cur ) )
;;
*)
- COMPREPLY=( $( compgen -W '-b -e -F -i -q -t -U -V' \
+ COMPREPLY=( $( compgen -W '-b -e -E -F -i -q -t -U -V' \
-- $cur ) )
;;
esac
@@ -1822,10 +1822,10 @@ _rpm()
_filedir -d
return 0
;;
- --eval)
+ --eval|-E)
# get a list of macros
COMPREPLY=( $( sed -ne 's|^\(%'${cur#\%}'[^ '$'\t'']*\).*$|\1|p' \
- /usr/lib/rpm/macros ) )
+ /usr/lib/rpm/macros /usr/lib/rpm/redhat/macros /etc/rpm/*macros ~/.rpmmacros ) )
return 0
;;
--pipe)

View File

@ -0,0 +1,11 @@
diff -up bash_completion/bash_completion~ bash_completion/bash_completion
--- bash_completion/bash_completion~ 2006-03-01 18:20:18.000000000 +0200
+++ bash_completion/bash_completion 2008-09-07 13:33:40.000000000 +0300
@@ -115,6 +115,7 @@ complete -f -X '!*.@(sxd|std|sda|sdd|odg
complete -f -X '!*.@(sxm|smf|mml|odf)' oomath
complete -f -X '!*.odb' oobase
complete -f -X '!*.rpm' rpm2cpio
+complete -f -X '!*.sqlite' sqlite3
# FINISH exclude -- do not remove this line
# start of section containing compspecs that can be handled within bash

43
bash-completion-lzop Normal file
View File

@ -0,0 +1,43 @@
# bash completion for lzop(1) -*- sh -*-
#
have lzop &&
_lzop()
{
local cur prev xspec IFS=$' \t\n'
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-d -x -l -I -t -V -h -L -q -v -c \
-o -p -f -n -N -P -S -U -1 -2 -3 -4 -5 -6 -7 -8 -9 \
--fast --best --decompress --uncompress --extract \
--test --list --ls --info --sysinfo --license --help \
--version --stdout --output --path --force --no-name \
--no-checksum --name --no-mode --no-time --suffix \
--keep --unlink --delete --crc32 --no-warn --quiet \
--silent --ignore-warn --verbose --no-stdin --filter \
--checksum --no-color --mono --color' -- $cur ) )
return 0
fi
xspec="*.?(t)lzo"
if [[ "$prev" == --* ]]; then
[[ "$prev" == --@(de|un)compress || \
"$prev" == --list || \
"$prev" == --test ]] && xspec="!"$xspec
[[ "$prev" == --force ]] && xspec=
elif [[ "$prev" == -* ]]; then
[[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec
[[ "$prev" == -*f* ]] && xspec=
elif [ "$prev" = '>' ]; then
xspec=
fi
_expand || return 0
COMPREPLY=( $( compgen -f -X "$xspec" -- $cur ) \
$( compgen -d -- $cur ) )
} &&
complete -F _lzop $filenames lzop

View File

@ -1,12 +1,13 @@
Name: bash-completion Name: bash-completion
Version: 20060301 Version: 20060301
Release: 12 Release: 13
Summary: Programmable completion for Bash Summary: Programmable completion for Bash
Group: System Environment/Shells Group: System Environment/Shells
License: GPLv2+ License: GPLv2+
URL: http://www.caliban.org/bash/ URL: http://www.caliban.org/bash/
Source0: http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2 Source0: http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
Source1: %{name}-lzop
Source2: %{name}-mock Source2: %{name}-mock
Source3: %{name}-repomanage Source3: %{name}-repomanage
Source4: %{name}-plague-client Source4: %{name}-plague-client
@ -16,6 +17,12 @@ Patch2: %{name}-20060301-perl-299571.patch
Patch3: %{name}-20060301-jpeg2000-304771.patch Patch3: %{name}-20060301-jpeg2000-304771.patch
Patch4: %{name}-20060301-mediafiles-444467.patch Patch4: %{name}-20060301-mediafiles-444467.patch
Patch5: %{name}-20060301-svn-filenames-430059.patch Patch5: %{name}-20060301-svn-filenames-430059.patch
Patch6: %{name}-20060301-gzip.patch
Patch7: %{name}-20060301-lzma.patch
Patch8: %{name}-20060301-rpm-backups.patch
Patch9: %{name}-20060301-rpm-eval.patch
Patch10: %{name}-20060301-getent.patch
Patch11: %{name}-20060301-sqlite.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
@ -34,7 +41,14 @@ of the programmable completion feature of bash 2.
%patch3 %patch3
%patch4 %patch4
%patch5 %patch5
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
f=Changelog ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f f=Changelog ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
install -pm 644 %{SOURCE1} contrib/lzop
install -pm 644 %{SOURCE2} contrib/mock install -pm 644 %{SOURCE2} contrib/mock
install -pm 644 %{SOURCE3} contrib/repomanage install -pm 644 %{SOURCE3} contrib/repomanage
install -pm 644 %{SOURCE4} contrib/plague-client install -pm 644 %{SOURCE4} contrib/plague-client
@ -114,6 +128,11 @@ rm -rf $RPM_BUILD_ROOT
%triggerun -- lilypond %triggerun -- lilypond
%do_triggerun lilypond %do_triggerun lilypond
%triggerin -- lzop
%do_triggerin lzop
%triggerun -- lzop
%do_triggerun lzop
%triggerin -- mailman %triggerin -- mailman
%do_triggerin mailman %do_triggerin mailman
%triggerun -- mailman %triggerun -- mailman
@ -200,6 +219,14 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Thu Sep 11 2008 Ville Skyttä <ville.skytta at iki.fi> - 20060301-13
- Borrow/improve/adapt to Fedora some patches from Mandriva: improved support
for getent and rpm --eval, better rpm backup file avoidance, lzma support.
- Patch/unpatch to fix gzip and bzip2 options completion.
- Patch to add --rsyncable to gzip options completion.
- Add and trigger-install support for lzop.
- Associate *.sqlite with sqlite3.
* Wed Jul 23 2008 Ville Skyttä <ville.skytta at iki.fi> - 20060301-12 * Wed Jul 23 2008 Ville Skyttä <ville.skytta at iki.fi> - 20060301-12
- Fix plague-client completion install (#456355, Ricky Zhou). - Fix plague-client completion install (#456355, Ricky Zhou).
- Trigger-install support for sitecopy. - Trigger-install support for sitecopy.