]> git.pld-linux.org Git - packages/bash-completion.git/commitdiff
- updated rpmpkgs.txt patch to refresh cache when rpmdb is newer (improves performance)
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 3 Jan 2006 19:37:59 +0000 (19:37 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bash-completion-FHS.patch -> 1.2

bash-completion-FHS.patch

index 8a4d6f0e440c910cb4de9618252815ab2ed7ea96..1528b17648f2dcf87e1c8f7b4f89ef38866c6522 100644 (file)
@@ -1,13 +1,17 @@
---- bash_completion/bash_completion~   2005-01-04 08:37:42.000000000 +0200
-+++ bash_completion/bash_completion    2005-01-09 17:24:06.000000000 +0200
-@@ -1616,12 +1616,12 @@
+--- bash_completion/bash_completion    2005-01-04 08:37:42.000000000 +0200
++++ /tmp/bash_completion       2006-01-02 20:18:52.000000000 +0200
+@@ -1718,12 +1723,16 @@
  {
        local i
  
 -      if [ -r /var/log/rpmpkgs -a \
 -              /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then
-+      if [ -r /var/cache/rpmpkgs.txt -a \
-+              /var/cache/rpmpkgs.txt -nt /var/lib/rpm/Packages ]; then
++      # refresh cache if writable
++      if [ -w /var/cache/rpmpkgs.txt -a /var/cache/rpmpkgs.txt -ot /var/lib/rpm/Packages ]; then
++              rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 | LC_ALL=C sort > /var/cache/rpmpkgs.txt
++      fi
++
++      if [ -r /var/cache/rpmpkgs.txt -a /var/cache/rpmpkgs.txt -nt /var/lib/rpm/Packages ]; then
                # using RHL 7.2 or later - this is quicker than querying the DB
                COMPREPLY=( $( sed -ne \
                's|^\('$cur'.*\)-[0-9a-zA-Z._]\+-[0-9a-z.@]\+.*\.rpm$|\1|p' \
This page took 0.051244 seconds and 4 git commands to generate.