Changeset 751ae8c for scripts


Ignore:
Timestamp:
Apr 26, 2010, 7:52:03 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
Children:
0be790a
Parents:
0fd5bd5
git-author:
David Benjamin <davidben@mit.edu> (04/24/10 19:01:10)
git-committer:
Nelson Elhage <nelhage@mit.edu> (04/26/10 19:52:03)
Message:
If the targets do not exist, remove the link

This should correctly handle locker-updates to versions before and after
the soname migration.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/locker-update

    ra4b0572 r751ae8c  
    3636cd /mit/barnowl/arch/
    3737
     38update_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
    3851for i in *; do
    3952    if [ -L "$i" ]; then
     
    4861        # Sanity -- make sure the 'barnowl' symlink is correct.
    4962        $E ln -sf "../../common/bin/barnowl$B" "$i/bin/barnowl$B"
    50         [ -e "$i/bin/$NEWVERSION" ]         && $E ln -sf "$NEWVERSION"         "$i/bin/barnowl.real$B"
    51         [ -e "$i/bin/$NEWVERSION.zephyr3" ] && $E ln -sf "$NEWVERSION.zephyr3" "$i/bin/barnowl.real$B.zephyr3"
    52         [ -e "$i/bin/$NEWVERSION.zephyr4" ] && $E ln -sf "$NEWVERSION.zephyr4" "$i/bin/barnowl.real$B.zephyr4"
     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"
    5366
    5467        $E ln -sf "zcrypt${NEWVERSION#barnowl}" "$i/bin/zcrypt"
Note: See TracChangeset for help on using the changeset viewer.