]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- move to function as i plan to inline this script to %post
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 20 Feb 2008 16:48:01 +0000 (16:48 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-hrmib-cache -> 1.5

rpm-hrmib-cache

index 37363f36e25f3ca150a114834bd92da339b960f3..3d7de1f87085bc98c71056202f3af2ad8849b0d3 100644 (file)
@@ -1,24 +1,26 @@
 #!/bin/sh
-# skip if no rpm(1) or touch(1)
-[ -x /bin/rpm -a -x /bin/touch ] || exit 0
+build_hrmib_cache() {
+       # skip if no rpm(1) or touch(1)
+       [ -x /bin/rpm -a -x /bin/touch ] || return
 
-export LC_ALL=C
-umask 002
+       export LC_ALL=C
+       umask 002
 
-mydir=/var/cache/hrmib
-mkdir -p $mydir || exit 0
-rm -f $mydir/*
+       mydir=/var/cache/hrmib
+       mkdir -p $mydir || return
+       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
+       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
+build_hrmib_cache
This page took 0.046209 seconds and 4 git commands to generate.