]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-hrmib-cache
- tabs
[packages/rpm.git] / rpm-hrmib-cache
1 #!/bin/sh
2 build_hrmib_cache() {
3         # skip if no rpm(1) or touch(1)
4         [ -x /bin/rpm -a -x /bin/touch ] || return
5
6         export LC_ALL=C
7         umask 002
8
9         mydir=/var/cache/hrmib
10
11         echo >&2 "Populating $mydir with initial contents"
12         mkdir -p $mydir || return
13         rm -f $mydir/*
14
15         buf=$(rpm --nodigest --nosignature -qa --qf '%{name}-%{version}-%{release}.%{arch} %{installtime:date}\n')
16         echo "$buf" | while read nvra idate; do
17         case $nvra in
18                 gpg-pubkey-*)
19                 ;;
20         *)
21                 touch -d "$idate" "$mydir/$nvra"
22                 ;;
23         esac
24         done
25         touch $mydir
26 }
27
28 build_hrmib_cache
This page took 0.026443 seconds and 4 git commands to generate.