X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fpackages;h=5f0fad1d79560d383447db9a09467fd2b87876b0;hb=239baf8f19610ce459804f4537edd05718f29a0c;hp=77dcbf4656e313f33286dbef1afb231cab7bf803;hpb=8701ed06737ebb5f3457a8768f01243865e3ed7a;p=bootstrapfs.git diff --git a/plc.d/packages b/plc.d/packages index 77dcbf4..5f0fad1 100755 --- a/plc.d/packages +++ b/plc.d/packages @@ -108,43 +108,47 @@ case "$1" in mode=$1; shift - # on PLC there is a need to select the repos as there are quite a few in there - # would contain names or patterns relative to install-rpms - explicit_list=/var/www/html/install-rpms/PACKAGES + # hack for PLC + # there are some very old repos there, as well as some sensitive areas + # so by convention the repositories that have a 'PRESERVE' file won't + # be touched by the cross-flavour stuff + # i.e. no symlinks get created to or from there, + # and yumgroups is untouched # use argv if provided if [[ -n "$@" ]] ; then repositories="$@" - elif [ -f $explicit_list ] ; then - repositories="" - for name in $(grep -v '#' $explicit_list); do - repositories="$repositories /var/www/html/install-rpms/$name" - done else # use all subdirs in install-rpms by default repositories=/var/www/html/install-rpms/* fi + # filter out PRESERVE'd repos + cross_repositories="" + for repository in $repositories; do + [ -f $repository/PRESERVE ] || cross_repositories="$cross_repositories $repository" + done + ########## # deal with the sliceimage packages # symlink all instances of plain 'sliceimage-*rpm' in all repos # and cleanup old links - sirpms=$(find $repositories -name 'sliceimage*rpm' -a -type f) + sirpms=$(find $cross_repositories -name 'sliceimage*rpm' -a -type f) # for nicer upgrades, also remove symlinks from 5.0 - silinks=$(find $repositories '(' -name 'sliceimage*rpm' -o -name 'vserver*rpm' ')' -a -type l) + silinks=$(find $cross_repositories '(' -name 'sliceimage*rpm' -o -name 'vserver*rpm' ')' -a -type l) for silink in $silinks; do [ ! -e $silink ] && { echo removing old $silink; rm $silink; } done - for repo in $repositories; do + for repository in $cross_repositories; do for sirpm in $sirpms; do - # if in the repo we're dealing with, ignore - if [ "$(echo $sirpm | sed -e s,^$repo,,)" != $sirpm ] ; then + # if in the repository we're dealing with, ignore + if [ "$(echo $sirpm | sed -e s,^$repository,,)" != $sirpm ] ; then continue fi b=$(basename $sirpm) - link=$repo/$b + link=$repository/$b if [ ! -e $link ] ; then echo "creating symlink $link towards $sirpm" ln -s $sirpm $link @@ -154,12 +158,14 @@ case "$1" in ########## # now that the symlinks are OK, we can tweak yumgroups - for repository in $repositories; do + for repository in $cross_repositories; do hack_yumgroups $repository done ########## sign plain packages for repository in $repositories ; do + # skip non-directory + [ -d $repository ] || continue # the rpms that need signing new_rpms= # and the corresponding stamps