source: scripts/locker-update @ 0fd5bd5

release-1.6release-1.7release-1.8release-1.9
Last change on this file since 0fd5bd5 was a4b0572, checked in by Nelson Elhage <nelhage@mit.edu>, 12 years ago
locker-update: Create zephyr{3,4} symlinks as-needed Checks existence of target files before creating any
  • Property mode set to 100755
File size: 1.4 KB
Line 
1#!/bin/bash
2beta=
3dryrun=
4
5usage() {
6    echo "Usage: $0 [--dry-run|-n] [--beta|-b] NEW-VERSION" >&2
7    exit 1;
8}
9
10for arg in "$@"; do
11    case $arg in
12        --beta|-b)
13            beta=1 ;;
14        --dry-run|-n)
15            dryrun=1 ;;
16        -*)
17            usage ;;
18        *)
19            test -n "$NEWVERSION" && usage
20            NEWVERSION="$arg"
21            ;;
22    esac
23done
24
25test -z "$NEWVERSION" && usage
26
27# Run this as 'locker-update NEW-VERSION' to upgrade the barnowl.real
28# symlink in all arch/ directories to point to the new version.
29
30E=
31test -n "$dryrun" && E=echo
32
33B=
34test -n "$beta" && B=-beta
35
36cd /mit/barnowl/arch/
37
38for i in *; do
39    if [ -L "$i" ]; then
40        echo "# Skipping $i as a symbolic link..."
41    elif [ "$i" = "common" ]; then
42        echo "# Skipping 'common'..."
43    elif ! [ -e "$i/bin/$NEWVERSION" ]; then
44        echo "# New version $NEWVERSION not built for arch $i...";
45    else
46        echo "# $i"
47
48        # Sanity -- make sure the 'barnowl' symlink is correct.
49        $E ln -sf "../../common/bin/barnowl$B" "$i/bin/barnowl$B"
50        [ -e "$i/bin/$NEWVERSION" ]         && $E ln -sf "$NEWVERSION"         "$i/bin/barnowl.real$B"
51        [ -e "$i/bin/$NEWVERSION.zephyr3" ] && $E ln -sf "$NEWVERSION.zephyr3" "$i/bin/barnowl.real$B.zephyr3"
52        [ -e "$i/bin/$NEWVERSION.zephyr4" ] && $E ln -sf "$NEWVERSION.zephyr4" "$i/bin/barnowl.real$B.zephyr4"
53
54        $E ln -sf "zcrypt${NEWVERSION#barnowl}" "$i/bin/zcrypt"
55    fi
56done;
Note: See TracBrowser for help on using the repository browser.