source: scripts/locker-update @ 0ee43c8

release-1.10release-1.6release-1.7release-1.8release-1.9
Last change on this file since 0ee43c8 was 0ee43c8, checked in by Nelson Elhage <nelhage@mit.edu>, 14 years ago
Unify the beta and non-beta code paths
  • Property mode set to 100755
File size: 1.2 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 ln -sf "$NEWVERSION" "$i/bin/barnowl.real$B"
51
52        $E ln -sf "zcrypt${NEWVERSION#barnowl}" "$i/bin/zcrypt"
53    fi
54done;
Note: See TracBrowser for help on using the repository browser.