Changeset 1050 for locker/sbin/build-update
- Timestamp:
- Apr 3, 2009, 12:51:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
locker/sbin/build-update
r746 r1050 97 97 set -e -o noclobber 98 98 99 die () { echo "$1" >&2; rm .scripts-security-upd-lock; exit 1; } 99 die () { echo "[$PWD] die: $1" >&2; rm .scripts-security-upd-lock; exit 1; } 100 aiee () { echo "[$PWD] AIEE: $1" >&2; exit 2; } 100 101 101 102 patchdir=$(dirname "$0") 103 lockername="$1${1:-$USER}" 102 104 103 105 >.scripts-security-upd-lock || die "error: Unable to obtain update lock." … … 130 132 echo "[$PWD] dry run OK, applying update" 131 133 132 mv .scripts-version .scripts-version.old 133 patch -stN --no-backup-if-mismatch -p2 <"$patchdir/update.diff" || :134 xargs rm -f <"$patchdir/files.delete" 135 tar -xzf "$patchdir/newfiles.tar.gz" 134 mv .scripts-version .scripts-version.old || aiee "Failed to back up scripts-version" 135 patch -stN --no-backup-if-mismatch -p2 <"$patchdir/update.diff" || aiee "patch did not apply" 136 xargs rm -f <"$patchdir/files.delete" || aiee "Failed to remove files" 137 tar -xzf "$patchdir/newfiles.tar.gz" || aiee "Failed to extract new files" 136 138 [ -e "$patchdir/extra/postpatch.sh" ] && . "$patchdir/extra/postpatch.sh" 137 139 ( … … 143 145 echo "$newpackages" 144 146 ) >.scripts-version 145 rm -f .scripts-version.old 147 rm -f .scripts-version.old || aiee "Failed to remove .scripts-version.old" 146 148 147 rm -f .scripts-security-upd-lock 149 rm -f .scripts-security-upd-lock || aiee "Failed to remove .scripts-security-upd-lock" 148 150 149 151 echo "[$PWD] done"
Note: See TracChangeset
for help on using the changeset viewer.