Changeset 2f2a643 for scripts/locker-update
- Timestamp:
- Jul 17, 2009, 9:53:52 PM (15 years ago)
- Branches:
- master, release-1.10, 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/locker-update
r56e4869 r2f2a643 1 1 #!/bin/bash 2 NEWVERSION="$1" 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 3 26 4 27 # Run this as 'locker-update NEW-VERSION' to upgrade the barnowl.real 5 28 # symlink in all arch/ directories to point to the new version. 6 29 7 if [ -z "$NEWVERSION" ]; then 8 echo "Usage: $0 new-version" 1>&2 9 exit -1; 10 fi 30 E= 31 test -n "$dryrun" && E=echo 11 32 12 33 cd /mit/barnowl/arch/ … … 14 35 for i in *; do 15 36 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..."; 17 42 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" 20 47 else 21 if ! [ -e "$i/bin/$NEWVERSION" ]; then22 echo "New version $NEWVERSION not built for arch $i...";23 else24 48 # 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" 28 51 fi 29 52 fi
Note: See TracChangeset
for help on using the changeset viewer.