mode=$1; shift
- if [[ -z "$@" ]] ; then
- # use all subdirs in install-rpms by default
- repositories=/var/www/html/install-rpms/*
- else
- # else use argv
+ # 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="$@"
+ 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
##########
# 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)
+ # for nicer upgrades, also remove symlinks from 5.0
+ silinks=$(find $repositories '(' -name 'sliceimage*rpm' -o -name 'vserver*rpm' ')' -a -type l)
for silink in $silinks; do
[ ! -e $silink ] && { echo removing old $silink; rm $silink; }