Merge branch 'master' of ssh://git.onelab.eu/git/bootstrapfs
[bootstrapfs.git] / plc.d / packages
index 60f3c84..cd32f2b 100755 (executable)
@@ -64,6 +64,15 @@ EOF
     popd >& /dev/null
 }
 
+#################### xxx fixme xxx
+# I'm seeing weird things with f14 nodes and an f8 myplc server
+# I suspect that the f8-based createrepo binary does not do the right thing,
+# as the node (onelab09.pl.sophia.inria.fr) issues a lot of 
+# 'package does not match intended content'
+# before reaching this conclusion I have entirely rebuilt the server-side yum repos
+# by (*) checking the gpg keys (*) yum reinstalling all noderepos 
+# and on top of that manually re-running createrepo
+# of course the node had gone through yum clean all as well
 ####################
 case "$1" in
     start|force)
@@ -94,7 +103,7 @@ case "$1" in
        vslinks=$(find $repositories -name 'vserver*rpm' -a -type l)
 
        for vslink in $vslinks; do
-           [ ! -e $vslink ] && echo removing old $vslink
+           [ ! -e $vslink ] && { echo removing old $vslink; rm $vslink; }
        done
 
        for repo in $repositories; do
@@ -107,6 +116,7 @@ case "$1" in
                link=$repo/$b
                if [ ! -e $link ] ; then
                    echo "creating symlink $link towards $vsrpm"
+                   ln -s $vsrpm $link
                fi
            done
        done
@@ -160,7 +170,9 @@ case "$1" in
                    --define "_gpg_path /etc/planetlab" \
                    --define "_gpg_name $PLC_MAIL_SUPPORT_ADDRESS" \
                    --resign $new_rpms && touch $new_stamps
-               check
+#              check
+               # if we sign at least one package then we need to reindex
+               need_createrepo=true
            fi
 
            # Update repository index / yum metadata. 
@@ -168,10 +180,11 @@ case "$1" in
            if [ -n "$need_createrepo" ] ; then
                if [ -f $repository/yumgroups.xml ] ; then
                    createrepo --quiet -g yumgroups.xml $repository 
+                   check
                else
                    createrepo --quiet $repository
+                   check
                fi
-               check
            fi
        done
 
@@ -194,6 +207,12 @@ case "$1" in
            find $repository -type l | xargs rm
        done
        ;;
+    # (use this only if you have noderepos installed)
+    superclean)
+       find /var/www/html/install-rpms -name signed-stamps | xargs rm -rf
+       rpm -aq | grep noderepo | xargs yum -y reinstall
+       shift
+       ;;
     *)
         echo "Usage: $0 start|force|clean [repo ..]"
        ;;