#!/bin/sh # skip if no rpm(1) or touch(1) [ -x /bin/rpm -a -x /bin/touch ] || exit 0 export LC_ALL=C umask 002 mydir=/var/cache/hrmib mkdir -p $mydir || exit 0 rm -f $mydir/* buf=$(rpm --nodigest --nosignature -qa --qf '%{name}-%{version}-%{release}.%{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 exit 0