-#!/bin/sh
+#!/bin/bash
# usage e.g. $0 1.0-20
[[ -z "$@" ]] && { echo Usage $0 stable ; exit 1 ; }
stable=$1; shift
stabledot=$(echo $stable | sed -e s,-,.,g)
for dir in $(ls -d $stable/*[24]) ; do
base=$(echo $dir | sed -e s,$stable,,g -e s,$stabledot,,g -e s,/sfa--,,g)
- stablelink="stable-$base"
+ version=$(echo $dir | cut -c1)
+ stablelink="stable-sfa$version-$base"
echo Linking $stablelink to $dir
[ -h $stablelink ] && rm $stablelink
[ -e $stablelink ] && { echo "found not-a-link $base - ignored" ; continue ; }