]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion-rpm-cache.patch
- fix /sbin/service completion
[packages/bash-completion.git] / bash-completion-rpm-cache.patch
1 support rpm (jbj rpm 4.4.7+) hrmib exports for rpm -qa filter (via %_hrmib_path /var/cache/hrmib)
2 add version+release+arch to installed packages filter
3
4 --
5 Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
6
7 --- bash-completion-1.1/contrib/rpm~    2009-10-09 15:49:31.000000000 +0300
8 +++ bash-completion-1.1/contrib/rpm     2009-10-10 23:49:53.931350555 +0300
9 @@ -7,15 +7,21 @@
10  {
11      local nodig="$1" nosig="$2"
12  
13 +    # if rpm (4.4.7+) is configured to export it's rpmdb to /var/cache/hrmib (%_hrmib_path)
14 +    if [ -d /var/cache/hrmib -a -r /var/cache/hrmib ]; then
15 +        COMPREPLY=( $( LC_ALL=C command ls -1 /var/cache/hrmib | sed -ne '/^'$cur'/p') )
16 +        return
17 +    fi
18 +
19      if [ -r /var/log/rpmpkgs -a \
20          /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then
21          # using RHL 7.2 or later - this is quicker than querying the DB
22          COMPREPLY=( $( sed -ne \
23 -            's|^\('$cur'[^[:space:]]*\)-[^[:space:]-]\+-[^[:space:]-]\+\.rpm$|\1|p' \
24 +            's|^\('$cur'.*\)\.rpm$|\1|p' \
25              /var/log/rpmpkgs ) )
26      else
27          _rpm_nodigsig
28 -        COMPREPLY=( $( rpm -qa $nodig $nosig --qf='%{NAME} ' "$cur*" ) )
29 +        COMPREPLY=( $( rpm -qa $nodig $nosig --qf '%{name}-%{version}-%{release}.%{arch}\n' "$cur*" ) )
30      fi
31  }
32  
This page took 0.021238 seconds and 3 git commands to generate.