Changeset 2f2a643


Ignore:
Timestamp:
Jul 17, 2009, 9:53:52 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
435d6b2
Parents:
130633c
git-author:
Nelson Elhage <nelhage@mit.edu> (07/17/09 21:51:35)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/17/09 21:53:52)
Message:
locker-update: Add --beta and --dry-run options.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/locker-update

    r56e4869 r2f2a643  
    11#!/bin/bash
    2 NEWVERSION="$1"
     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
    326
    427# Run this as 'locker-update NEW-VERSION' to upgrade the barnowl.real
    528# symlink in all arch/ directories to point to the new version.
    629
    7 if [ -z "$NEWVERSION" ]; then
    8     echo "Usage: $0 new-version" 1>&2
    9     exit -1;
    10 fi
     30E=
     31test -n "$dryrun" && E=echo
    1132
    1233cd /mit/barnowl/arch/
     
    1435for i in *; do
    1536    if [ -L "$i" ]; then
    16         echo "Skipping $i as a symbolic link..."
     37        echo "# Skipping $i as a symbolic link..."
     38    elif [ "$i" = "common" ]; then
     39        echo "# Skipping 'common'..."
     40    elif ! [ -e "$i/bin/$NEWVERSION" ]; then
     41        echo "# New version $NEWVERSION not built for arch $i...";
    1742    else
    18         if [ "$i" = "common" ]; then
    19             echo "Skipping 'common'..."
     43        echo "# $i"
     44        if test -n "$beta"; then
     45            $E ln -sf "../../common/bin/barnowl-beta" "$i/bin/barnowl-beta"
     46            $E ln -sf "$NEWVERSION" "$i/bin/barnowl.real-beta"
    2047        else
    21             if ! [ -e "$i/bin/$NEWVERSION" ]; then
    22                 echo "New version $NEWVERSION not built for arch $i...";
    23             else
    2448                # Sanity -- make sure the 'barnowl' symlink is correct.
    25                 ln -sf "../../common/bin/barnowl" "$i/bin/barnowl"
    26                 ln -sf "$NEWVERSION" "$i/bin/barnowl.real"
    27             fi
     49            $E ln -sf "../../common/bin/barnowl" "$i/bin/barnowl"
     50            $E ln -sf "$NEWVERSION" "$i/bin/barnowl.real"
    2851        fi
    2952    fi
Note: See TracChangeset for help on using the changeset viewer.