]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm-hrmib-cache
- teach rpm how to read /proc files
[packages/rpm.git] / rpm-hrmib-cache
index 3ac84c0e5844c015579c05f59699c5154e7e47b5..8ee25bb410e2bfff1b92a9531faefcd1d2f6becf 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 build_hrmib_cache() {
-       # skip if no rpm(1) or touch(1)
-       [ -x /bin/rpm -a -x /bin/touch ] || return
+       # skip if no rpm(1), touch(1), xargs(1)
+       [ -x /bin/rpm -a -x /bin/touch -a -x /bin/xargs ] || return
 
        export LC_ALL=C
        umask 002
@@ -10,17 +10,11 @@ build_hrmib_cache() {
 
        echo >&2 "Populating $mydir with initial contents"
        mkdir -p $mydir || return
-       rm -f $mydir/*
+       echo $mydir/* | xargs rm -f
 
-       buf=$(rpm --nodigest --nosignature -qa --qf '%{name}-%{version}-%{release}.%{arch} %{installtime:date}\n')
+       buf=$(rpm --nodigest --nosignature -qa --qf '%{N}-%{V}-%{R}.%{ARCH} %{INSTALLTIME:date}\n')
        echo "$buf" | while read nvra idate; do
-       case $nvra in
-               gpg-pubkey-*)
-               ;;
-       *)
                touch -d "$idate" "$mydir/$nvra"
-               ;;
-       esac
        done
        touch $mydir
 }
This page took 0.027629 seconds and 4 git commands to generate.