release-1.10release-1.6release-1.7release-1.8release-1.9
Last change
on this file since 0be790a was
0be790a,
checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
|
Also create symlinks properly for zcrypt
|
-
Property mode set to
100755
|
File size:
1.8 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 | |
---|
[0ee43c8] | 33 | B= |
---|
| 34 | test -n "$beta" && B=-beta |
---|
| 35 | |
---|
[5c81472] | 36 | cd /mit/barnowl/arch/ |
---|
| 37 | |
---|
[751ae8c] | 38 | update_symlink() { |
---|
| 39 | local dir="$1" |
---|
| 40 | local target="$2" |
---|
| 41 | local link="$3" |
---|
| 42 | if [ -e "$dir/$target" ]; then |
---|
| 43 | # update the symlink |
---|
| 44 | $E ln -sf "$target" "$dir/$link" |
---|
| 45 | else |
---|
| 46 | # delete the symlink |
---|
| 47 | $E rm -f "$dir/$link" |
---|
| 48 | fi |
---|
| 49 | } |
---|
| 50 | |
---|
[5c81472] | 51 | for i in *; do |
---|
| 52 | if [ -L "$i" ]; then |
---|
[2f2a643] | 53 | echo "# Skipping $i as a symbolic link..." |
---|
| 54 | elif [ "$i" = "common" ]; then |
---|
| 55 | echo "# Skipping 'common'..." |
---|
| 56 | elif ! [ -e "$i/bin/$NEWVERSION" ]; then |
---|
| 57 | echo "# New version $NEWVERSION not built for arch $i..."; |
---|
[5c81472] | 58 | else |
---|
[2f2a643] | 59 | echo "# $i" |
---|
[0ee43c8] | 60 | |
---|
| 61 | # Sanity -- make sure the 'barnowl' symlink is correct. |
---|
| 62 | $E ln -sf "../../common/bin/barnowl$B" "$i/bin/barnowl$B" |
---|
[751ae8c] | 63 | update_symlink "$i/bin" "$NEWVERSION" "barnowl.real$B" |
---|
| 64 | update_symlink "$i/bin" "$NEWVERSION.zephyr3" "barnowl.real$B.zephyr3" |
---|
| 65 | update_symlink "$i/bin" "$NEWVERSION.zephyr4" "barnowl.real$B.zephyr4" |
---|
[0ee43c8] | 66 | |
---|
[0be790a] | 67 | update_symlink "$i/bin" "zcrypt${NEWVERSION#barnowl}" "zcrypt" |
---|
| 68 | update_symlink "$i/bin" "zcrypt${NEWVERSION#barnowl}.zephyr3" "zcrypt.zephyr3" |
---|
| 69 | update_symlink "$i/bin" "zcrypt${NEWVERSION#barnowl}.zephyr4" "zcrypt.zephyr4" |
---|
[5c81472] | 70 | fi |
---|
| 71 | done; |
---|
Note: See
TracBrowser
for help on using the repository browser.