release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change
on this file since 4193918 was
2f2a643,
checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
|
locker-update: Add --beta and --dry-run options.
|
-
Property mode set to
100755
|
File size:
1.3 KB
|
Rev | Line | |
---|
[5c81472] | 1 | #!/bin/bash |
---|
[2f2a643] | 2 | beta= |
---|
| 3 | dryrun= |
---|
| 4 | |
---|
| 5 | usage() { |
---|
| 6 | echo "Usage: $0 [--dry-run|-n] [--beta|-b] NEW-VERSION" >&2 |
---|
| 7 | exit 1; |
---|
| 8 | } |
---|
| 9 | |
---|
| 10 | for 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 |
---|
| 23 | done |
---|
| 24 | |
---|
| 25 | test -z "$NEWVERSION" && usage |
---|
[5c81472] | 26 | |
---|
[56e4869] | 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 | |
---|
[2f2a643] | 30 | E= |
---|
| 31 | test -n "$dryrun" && E=echo |
---|
[5c81472] | 32 | |
---|
| 33 | cd /mit/barnowl/arch/ |
---|
| 34 | |
---|
| 35 | for i in *; do |
---|
| 36 | if [ -L "$i" ]; then |
---|
[2f2a643] | 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..."; |
---|
[5c81472] | 42 | else |
---|
[2f2a643] | 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" |
---|
[5c81472] | 47 | else |
---|
[56e4869] | 48 | # Sanity -- make sure the 'barnowl' symlink is correct. |
---|
[2f2a643] | 49 | $E ln -sf "../../common/bin/barnowl" "$i/bin/barnowl" |
---|
| 50 | $E ln -sf "$NEWVERSION" "$i/bin/barnowl.real" |
---|
[5c81472] | 51 | fi |
---|
| 52 | fi |
---|
| 53 | done; |
---|
Note: See
TracBrowser
for help on using the repository browser.