]> git.pld-linux.org Git - packages/bash-completion.git/blame - bash-completion-rpm-cache.patch
- split and rediff patches for easier upstream merge
[packages/bash-completion.git] / bash-completion-rpm-cache.patch
CommitLineData
24e31c9e
ER
1--- bash_completion/bash_completion 2005-01-04 08:37:42.000000000 +0200
2+++ bash_completion 2006-03-01 22:00:59.000000000 +0200
3@@ -1734,8 +1734,14 @@
4 {
5 local ver nodig nosig
6
7- if [ -r /var/log/rpmpkgs -a \
8- /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then
9+ # refresh cache if writable
10+ if [ /var/log/rpmpkgs -ot /var/lib/rpm/Packages -a -w /var/log/rpmpkgs ]; then
11+ # we grab the output to local variable to prevent possible race
12+ local tmp=$(rpm -qa $nodig $nosig --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' | LC_ALL=C sort)
13+ echo "$tmp" > /var/log/rpmpkgs
14+ fi
15+
16+ if [ -r /var/log/rpmpkgs -a /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then
17 # using RHL 7.2 or later - this is quicker than querying the DB
18 COMPREPLY=( $( sed -ne \
19 's|^\('$cur'.*\)-[0-9a-zA-Z._]\+-[0-9a-z.@]\+.*\.rpm$|\1|p' \
This page took 0.053655 seconds and 4 git commands to generate.