From: Thierry Parmentelat Date: Thu, 28 Feb 2013 09:03:53 +0000 (+0100) Subject: 1st draft X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7d97d0305475bd16e6ddbd5efac66af46721fcdc;p=infrastructure.git 1st draft --- diff --git a/scripts/sfa-stable-debian.sh b/scripts/sfa-stable-debian.sh new file mode 100644 index 0000000..f6a01d5 --- /dev/null +++ b/scripts/sfa-stable-debian.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# usage e.g. $0 1.0-20 +[[ -z "$@" ]] && { echo Usage $0 stable ; exit 1 ; } +stable=$1; shift +[[ -n "$@" ]] && { echo Usage $0 stable ; exit 1 ; } +stable=$(echo $stable | sed -e s,/,,g) +stabledot=$(echo $stable | sed -e s,-,.,g) +for dir in $(ls -d $stable/*[24]) ; do + base=$(echo $dir | sed -e s,/,,g -e s,--,,g -e s,sfa-,,g -e s,$stabledot,,g) + stablelink="stable-$base" + echo Linking $stablelink to $dir + [ -h $stablelink ] && rm $stablelink + [ -e $stablelink ] && { echo "found not-a-link $base - ignored" ; continue ; } + ln -s $dir $stablelink +done