1st draft
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 28 Feb 2013 09:03:53 +0000 (10:03 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 28 Feb 2013 09:03:53 +0000 (10:03 +0100)
scripts/sfa-stable-debian.sh [new file with mode: 0644]

diff --git a/scripts/sfa-stable-debian.sh b/scripts/sfa-stable-debian.sh
new file mode 100644 (file)
index 0000000..f6a01d5
--- /dev/null
@@ -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