Check for presence of RPM symlink
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 4 Feb 2013 10:08:06 +0000 (10:08 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 4 Feb 2013 10:08:06 +0000 (10:08 +0000)
Besides age, check for presence of symlink from RPM Packages
directory.

update-archive/update-yum-archive.sh

index 1e3f633..f280e64 100755 (executable)
@@ -86,9 +86,17 @@ for vdist in centos/5.5 rhel/5.5 centos/6; do
           for arch in $architectures; do
             mkdir -p $d/${arch}/Packages
             for f in $distdir/RPMS/${arch}/*.rpm $distdir/RPMS/noarch/*.rpm; do
+              b=`basename $f`
               if test -f $f; then
+                mustsign=false
                age=`stat --printf='%Y' $f`
                if expr $now - $age \< $signage >/dev/null; then
+                  mustsign=true
+                fi
+                if test ! -f $d/${arch}/Packages/$b; then
+                 mustsign=true
+                fi
+                if $mustsign; then
                   ln -sf $f $d/${arch}/Packages/
                  if rpm -K $f|grep -q ' gpg' >/dev/null; then
                    echo "Already signed $f"