f37 -> f39
[infrastructure.git] / scripts / sfa-stable-fedora.sh
1 #!/bin/sh
2 # usage e.g. $0 1.0-20
3 [[ -z "$@" ]] && { echo Usage $0 stable ; exit 1 ; }
4 stable=$1; shift
5 [[ -n "$@" ]] && { echo Usage $0 stable ; exit 1 ; }
6 stable=$(echo $stable | sed -e s,/,,g)
7 for dir in $(ls -d $stable/*[24]) ; do
8   base=$(echo $dir | sed -e s,/,,g -e s,--,,g -e s,sfa-,,g -e s,$stable,,g)
9   version=$(echo $dir | cut -c1)
10   stablelink="stable-sfa$version-$base"
11   echo Linking $stablelink to $dir
12   [ -h $stablelink ] && rm $stablelink
13   [ -e $stablelink ] && { echo "found not-a-link $base - ignored" ; continue  ; }
14   ln -s $dir $stablelink
15 done