X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=rpm-hrmib-cache;h=8ee25bb410e2bfff1b92a9531faefcd1d2f6becf;hb=7f7a3f24d8f0c9b730ccb97e0038514af07f0cb5;hp=3ac84c0e5844c015579c05f59699c5154e7e47b5;hpb=2f8e2ddc9de4ae5f3cde6f7507cfc3d3944b903e;p=packages%2Frpm.git diff --git a/rpm-hrmib-cache b/rpm-hrmib-cache index 3ac84c0..8ee25bb 100644 --- a/rpm-hrmib-cache +++ b/rpm-hrmib-cache @@ -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 }