]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-hrmib-cache
- move to function as i plan to inline this script to %post
[packages/rpm.git] / rpm-hrmib-cache
CommitLineData
265fe8d6 1#!/bin/sh
541a0296
ER
2build_hrmib_cache() {
3 # skip if no rpm(1) or touch(1)
4 [ -x /bin/rpm -a -x /bin/touch ] || return
b678ebfd 5
541a0296
ER
6 export LC_ALL=C
7 umask 002
fcab2bde 8
541a0296
ER
9 mydir=/var/cache/hrmib
10 mkdir -p $mydir || return
11 rm -f $mydir/*
265fe8d6 12
541a0296
ER
13 buf=$(rpm --nodigest --nosignature -qa --qf '%{name}-%{version}-%{release}.%{arch} %{installtime:date}\n')
14 echo "$buf" | while read nvra idate; do
15 case $nvra in
16 gpg-pubkey-*)
17 ;;
18 *)
19 touch -d "$idate" "$mydir/$nvra"
20 ;;
21 esac
22 done
23 touch $mydir
24}
b678ebfd 25
541a0296 26build_hrmib_cache
This page took 0.036517 seconds and 4 git commands to generate.