X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=plc.d%2Fpackages;h=0108cde76b99a62e8666d6e2166b6828a057134a;hb=1dca97c8ec500331c22d81dd7e77ed6a85971288;hp=a3a112e78d111c6b1935397091e480a91e426a70;hpb=98461cd7062469a9676e4b5776d13431850504a0;p=nodeimage.git diff --git a/plc.d/packages b/plc.d/packages index a3a112e..0108cde 100755 --- a/plc.d/packages +++ b/plc.d/packages @@ -108,33 +108,46 @@ case "$1" in mode=$1; shift - if [[ -z "$@" ]] ; then - # use all subdirs in install-rpms by default + # 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 + + # use argv if provided + if [[ -n "$@" ]] ; then + repositories="$@" + cross_repositories="$@" + elif [ -f $explicit_list ] ; then + cross_repositories="" + for name in $(grep -v '#' $explicit_list); do + cross_repositories="$cross_repositories /var/www/html/install-rpms/$name" + done repositories=/var/www/html/install-rpms/* else - # else use argv - repositories="$@" + # use all subdirs in install-rpms by default + repositories=/var/www/html/install-rpms/* + cross_repositories=/var/www/html/install-rpms/* fi ########## # 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) - silinks=$(find $repositories -name 'sliceimage*rpm' -a -type l) + sirpms=$(find $cross_repositories -name 'sliceimage*rpm' -a -type f) + # for nicer upgrades, also remove symlinks from 5.0 + 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 @@ -144,7 +157,7 @@ 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