summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-11-21 01:05:09 -0500
committerAaron Griffin <aaronmgriffin@gmail.com>2008-11-21 01:05:09 -0500
commit07ec0708d31794221bec7ee3e7f07755707fd36a (patch)
tree74cb124401726429dab154297041b7e857436105
parentc7fa1913b56e7619b64b93a10e130cf90508737a (diff)
Clear traps on cleanup
This prevents us from trying to remove the lockfile twice, and calling cleanup multiple times Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xdb-move1
-rwxr-xr-xdb-remove1
-rwxr-xr-xdb-update1
-rwxr-xr-xtesting2x45
4 files changed, 26 insertions, 22 deletions
diff --git a/db-move b/db-move
index 789e536..8d006f4 100755
--- a/db-move
+++ b/db-move
@@ -27,6 +27,7 @@ svnrepo_to="$repoto-$arch"
WORKDIR="$TMPDIR/db-move.$svnrepo_from.$svnrepo_to.$UID"
cleanup() {
+ trap '' 0 2
# unlock
repo_unlock $repoto $arch
repo_unlock $repofrom $arch
diff --git a/db-remove b/db-remove
index 47268ed..2e0307d 100755
--- a/db-remove
+++ b/db-remove
@@ -23,6 +23,7 @@ svnrepo="$reponame-$arch"
WORKDIR="$TMPDIR/db-remove.$svnrepo.$UID"
cleanup() {
+ trap '' 0 2
# unlock
repo_unlock $reponame $arch
rm -rf "$WORKDIR"
diff --git a/db-update b/db-update
index 315c107..9aba199 100755
--- a/db-update
+++ b/db-update
@@ -47,6 +47,7 @@ getpkgname() {
}
cleanup() {
+ trap '' 0 2
# unlock
repo_unlock $reponame $arch
rm -rf "$WORKDIR"
diff --git a/testing2x b/testing2x
index 812edd3..b576640 100755
--- a/testing2x
+++ b/testing2x
@@ -5,23 +5,24 @@
source_makepkg
case "$0" in
- *64)
+ *64)
arch="x86_64"
;;
- *)
+ *)
arch="i686"
;;
esac
WORKDIR="$TMPDIR/testing2x.$UID"
cleanup() {
- rm -rf "${WORKDIR}"
- [ -n "$1" ] && exit $1
+ trap '' 0 2
+ rm -rf "${WORKDIR}"
+ [ -n "$1" ] && exit $1
}
ctrl_c() {
- echo "Interrupted" >&2
- cleanup 0
+ echo "Interrupted" >&2
+ cleanup 0
}
trap ctrl_c 2
@@ -32,23 +33,23 @@ cd "${WORKDIR}"
cd checkout
for pkg in $*; do
- moved=0
- /usr/bin/svn up -q ${pkg}
- if [ -f "${pkg}/repos/testing-${arch}/${BUILDSCRIPT}" ]; then
- for repo in core extra; do
- if [ -f "${pkg}/repos/${repo}-${arch}/${BUILDSCRIPT}" ]; then
- echo "===> Moving package '${pkg}': testing-${arch} -> ${repo}-${arch}"
- $(dirname $0)/db-move "${pkg}" "testing" "${repo}" "${arch}"
- moved=1
- break
- fi
- done
- if [ ${moved} -eq 0 ]; then
- echo "===> Warning: ${pkg} is only in testing-${arch}, cannot determine where to move it"
+ moved=0
+ /usr/bin/svn up -q ${pkg}
+ if [ -f "${pkg}/repos/testing-${arch}/${BUILDSCRIPT}" ]; then
+ for repo in core extra; do
+ if [ -f "${pkg}/repos/${repo}-${arch}/${BUILDSCRIPT}" ]; then
+ echo "===> Moving package '${pkg}': testing-${arch} -> ${repo}-${arch}"
+ $(dirname $0)/db-move "${pkg}" "testing" "${repo}" "${arch}"
+ moved=1
+ break
+ fi
+ done
+ if [ ${moved} -eq 0 ]; then
+ echo "===> Warning: ${pkg} is only in testing-${arch}, cannot determine where to move it"
+ fi
+ else
+ echo "===> Warning: ${pkg} is not in testing-${arch}"
fi
- else
- echo "===> Warning: ${pkg} is not in testing-${arch}"
- fi
done
cleanup