#!/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
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
}