From 388d629327d97e8d15a7a67cc87ae36edfe2f385 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Aug 2010 13:08:47 +0200 Subject: use common workdir --- db-functions | 4 ++-- db-move | 6 ------ db-remove | 5 ----- db-update | 2 -- misc-scripts/make-sourceball | 3 --- misc-scripts/sourceballs-cleanup | 2 -- testing2x | 2 -- 7 files changed, 2 insertions(+), 22 deletions(-) diff --git a/db-functions b/db-functions index 2fe7a49..caaf9a0 100644 --- a/db-functions +++ b/db-functions @@ -1,7 +1,7 @@ #!/bin/bash -# Random integrity things -[ "$UID" = "" ] && UID=$(uid) +# set up general environment +WORKDIR=$(mktemp -d /tmp/$(basename $0).XXXXXXXXXX) # Useful functions diff --git a/db-move b/db-move index 8347a18..8b15831 100755 --- a/db-move +++ b/db-move @@ -23,10 +23,6 @@ ftppath_to="$FTP_BASE/$repoto/os/" svnrepo_from="$repofrom-$_arch" svnrepo_to="$repoto-$_arch" -[ "$UID" = "" ] && UID=$(uid) - -WORKDIR="$TMPDIR/db-move.$svnrepo_from.$svnrepo_to.$UID" - cleanup() { trap '' 0 2 # unlock @@ -52,8 +48,6 @@ trap cleanup 0 repo_lock $repoto $_arch || exit 1 repo_lock $repofrom $_arch || exit 1 -/bin/mkdir -p "$WORKDIR" - cd "$WORKDIR" /usr/bin/svn checkout -q -N $SVNREPO checkout >/dev/null cd checkout diff --git a/db-remove b/db-remove index 1314bb7..0da9e75 100755 --- a/db-remove +++ b/db-remove @@ -15,10 +15,6 @@ _arch="$3" ftppath="$FTP_BASE/$reponame/os" svnrepo="$reponame-$_arch" -[ "$UID" = "" ] && UID=$(uid) - -WORKDIR="$TMPDIR/db-remove.$svnrepo.$UID" - cleanup() { trap '' 0 2 # unlock @@ -43,7 +39,6 @@ trap cleanup 0 repo_lock $reponame $_arch || exit 1 echo -n "Removing $packagebase from $reponame..." -/bin/mkdir -p "$WORKDIR" cd "$WORKDIR" /usr/bin/svn checkout -q -N $SVNREPO checkout >/dev/null cd checkout diff --git a/db-update b/db-update index d08c96d..e53aee8 100755 --- a/db-update +++ b/db-update @@ -24,7 +24,6 @@ if [ $found -ne 1 ]; then exit 1 fi -WORKDIR="$TMPDIR/db-update.$reponame.$UID" ADDPKGS="" ANYPKGS="" @@ -74,7 +73,6 @@ if [ -d "$stagedir" ]; then ANYPKGS="$(getpkgfiles $stagedir/*-any$PKGEXT 2>/dev/null)" fi -mkdir -p $WORKDIR cd "$WORKDIR" if [ -n "$ANYPKGS" ]; then diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball index 41767d0..e216356 100755 --- a/misc-scripts/make-sourceball +++ b/misc-scripts/make-sourceball @@ -22,8 +22,6 @@ _arch="$3" srcpath="$FTP_BASE/sources/" logpath="/var/log/sourceballs/" -WORKDIR="/tmp/make-sourceball.$packagename.$UID" - cleanup() { restore_umask rm -rf "$WORKDIR" @@ -77,7 +75,6 @@ trap ctrl_c 2 trap cleanup 0 1 set_umask -/bin/mkdir -p "$WORKDIR" /bin/mkdir -p "$logpath" cd "$WORKDIR" diff --git a/misc-scripts/sourceballs-cleanup b/misc-scripts/sourceballs-cleanup index d259d3a..c87a888 100755 --- a/misc-scripts/sourceballs-cleanup +++ b/misc-scripts/sourceballs-cleanup @@ -7,7 +7,6 @@ srcpath="$FTP_BASE/sources/" logfile="$srcpath/cleanup.txt" LOCKFILE="/tmp/.sourceball-cleanup.lock" -WORKDIR="/tmp/sourceball-cleanup.$packagename.$UID" cleanup () { restore_umask @@ -68,7 +67,6 @@ trap ctrl_c 2 /usr/bin/renice +10 -p $$ > /dev/null set_umask -/bin/mkdir -p "$WORKDIR" cd "$WORKDIR" [ -e "$logfile" ] && /bin/mv "$logfile" "$logfile.old" diff --git a/testing2x b/testing2x index 4826853..e9fbeaa 100755 --- a/testing2x +++ b/testing2x @@ -11,7 +11,6 @@ case "$0" in _arch="i686" ;; esac -WORKDIR="$TMPDIR/testing2x.$UID" cleanup() { trap '' 0 2 @@ -27,7 +26,6 @@ ctrl_c() { trap ctrl_c 2 trap cleanup 0 -/bin/mkdir "${WORKDIR}" cd "${WORKDIR}" /usr/bin/svn checkout -N $SVNREPO checkout cd checkout -- cgit v1.2.3-54-g00ecf