]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-hrmib-cache
- teach rpm how to read /proc files
[packages/rpm.git] / rpm-hrmib-cache
CommitLineData
265fe8d6 1#!/bin/sh
541a0296 2build_hrmib_cache() {
62cdf60a
ER
3 # skip if no rpm(1), touch(1), xargs(1)
4 [ -x /bin/rpm -a -x /bin/touch -a -x /bin/xargs ] || return
b678ebfd 5
541a0296
ER
6 export LC_ALL=C
7 umask 002
fcab2bde 8
541a0296 9 mydir=/var/cache/hrmib
1c410f1d
ER
10
11 echo >&2 "Populating $mydir with initial contents"
541a0296 12 mkdir -p $mydir || return
62cdf60a 13 echo $mydir/* | xargs rm -f
265fe8d6 14
33b60b5c 15 buf=$(rpm --nodigest --nosignature -qa --qf '%{N}-%{V}-%{R}.%{ARCH} %{INSTALLTIME:date}\n')
541a0296 16 echo "$buf" | while read nvra idate; do
2f8e2ddc 17 touch -d "$idate" "$mydir/$nvra"
541a0296
ER
18 done
19 touch $mydir
20}
b678ebfd 21
541a0296 22build_hrmib_cache
This page took 0.056497 seconds and 4 git commands to generate.