[arch-dev-public] [PATCH 1/7] Move to standardized code fmt - spacing

Ghost1227 ghost1227 at archlinux.us
Thu Mar 11 23:00:49 CET 2010


---

The first (and longest) in the seriese of patches. This patch cleans up the
spacing and indentation in the dbscripts to make them more readable and
make merging the rest of the changes made possible. This patchset merges
Aaron's dbscripts working branch with the main master branch.

 cron-jobs/adjust-permissions  |   34 +++--
 cron-jobs/create-filelists    |  122 ++++++++--------
 cron-jobs/devlist-mailer      |    4 +-
 cron-jobs/ftpdir-cleanup      |    8 +-
 cron-jobs/integrity-check     |   14 +-
 cron-jobs/sourceballs         |   96 ++++++------
 cron-jobs/sourceballs-cleanup |   46 +++---
 db-functions                  |   52 ++++----
 db-move                       |   86 ++++++-----
 db-remove                     |    2 +-
 db-update                     |    2 +-
 misc-scripts/ftpdir-cleanup   |  332 +++++++++++++++++++++--------------------
 misc-scripts/make-sourceball  |  180 +++++++++++-----------
 testing2community             |   10 +-
 testing2community-any         |   10 +-
 testing2community64           |   10 +-
 testing2core                  |    8 +-
 testing2core-any              |   10 +-
 testing2core64                |   10 +-
 testing2extra                 |   10 +-
 testing2extra-any             |   10 +-
 testing2extra64               |   10 +-
 testing2x                     |   58 ++++----
 23 files changed, 579 insertions(+), 545 deletions(-)

diff --git a/cron-jobs/adjust-permissions b/cron-jobs/adjust-permissions
index 0f87075..c3d71a3 100755
--- a/cron-jobs/adjust-permissions
+++ b/cron-jobs/adjust-permissions
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 if [ -f /tmp/.ftpmaint.lck ]; then
-    exit 0
+	exit 0
 fi
 
 /bin/touch /tmp/.ftpmaint.lck
@@ -10,18 +10,18 @@ fi
 . "$(dirname $0)/../config"
 
 get_dir_owner() {
-    case $1 in
-        core)
-            echo "ftp:ftp-arch" ;;
-        extra)
-            echo "ftp:ftp-extra" ;;
-        testing)
-            echo "ftp:ftp-extra" ;;
-        community)
-            echo "root:tusers" ;;
-        community-testing)
-            echo "root:tusers" ;;
-    esac
+	case $1 in
+		core)
+			echo "ftp:ftp-arch" ;;
+		extra)
+			echo "ftp:ftp-extra" ;;
+		testing)
+			echo "ftp:ftp-extra" ;;
+		community)
+			echo "root:tusers" ;;
+		community-testing)
+			echo "root:tusers" ;;
+	esac
 }
 
 #adjust the nice level to run at a lower priority
@@ -29,11 +29,13 @@ get_dir_owner() {
 
 cd /srv/ftp
 for d in $(get_repos_for_host); do
-    owner="$(get_dir_owner $d)"
-    /bin/chown -R $owner $d/os/{any,i686,x86_64}
-    /bin/chmod -R g+w $d/os/{any,i686,x86_64}
+	owner="$(get_dir_owner $d)"
+	/bin/chown -R $owner $d/os/{any,i686,x86_64}
+	/bin/chmod -R g+w $d/os/{any,i686,x86_64}
 done
 
 /bin/chmod 555 /srv/ftp
 
 rm -f /tmp/.ftpmaint.lck
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/cron-jobs/create-filelists b/cron-jobs/create-filelists
index 84867d8..6bbb345 100755
--- a/cron-jobs/create-filelists
+++ b/cron-jobs/create-filelists
@@ -9,8 +9,8 @@ lock="/tmp/create-filelists.lock"
 . "$(dirname $0)/../config"
 
 if [ -f "$lock" ]; then
-    echo "Error: create-filelists already in progress."
-    exit 1
+	echo "Error: create-filelists already in progress."
+	exit 1
 fi
 
 touch "$lock" || exit 1
@@ -25,74 +25,74 @@ TMPDIR="$(mktemp -d /tmp/create-filelists.tmpdir.XXXXXX)" || exit 1
 /usr/bin/renice +10 -p $$ > /dev/null
 
 case "${DBEXT}" in
-    *.gz)  TAR_OPT="z" ;;
-    *.bz2) TAR_OPT="j" ;;
-    *.xz)  TAR_OPT="J" ;;
-    *) echo "Unknown compression type for DBEXT=${DBEXT}" && exit 1 ;;
+	*.gz)  TAR_OPT="z" ;;
+	*.bz2) TAR_OPT="j" ;;
+	*.xz)  TAR_OPT="J" ;;
+	*) echo "Unknown compression type for DBEXT=${DBEXT}" && exit 1 ;;
 esac
 
 FILESEXT="${DBEXT//db/files}"
 
 for repo in $repos; do
-    REPO_DB_FILE="${repo}$DBEXT"
-    FILES_DB_FILE="${repo}$FILESEXT"
-    for arch in ${ARCHES[@]}; do
-#       echo "Running for architecture $arch, repo $repo"
-        cd "$reposdir"
+	REPO_DB_FILE="${repo}$DBEXT"
+	FILES_DB_FILE="${repo}$FILESEXT"
+	for arch in ${ARCHES[@]}; do
+#		echo "Running for architecture $arch, repo $repo"
+		cd "$reposdir"
 
-        repodir="${repo}/os/${arch}"
-        cached="no"
+		repodir="${repo}/os/${arch}"
+		cached="no"
 
-        # extract package db archive
-        if [ -f "${targetdir}/${repodir}/${REPO_DB_FILE}" ]; then
-            mkdir -p "${DBDIR}/${repodir}"
-#           echo "extracting $REPO_DB_FILE"
-            bsdtar -xf "${targetdir}/${repodir}/${REPO_DB_FILE}" -C "${DBDIR}/${repodir}"
-        else
-            echo "Fail! Does the repo $repo with arch $arch even exist?"
-            continue
-        fi
+		# extract package db archive
+		if [ -f "${targetdir}/${repodir}/${REPO_DB_FILE}" ]; then
+			mkdir -p "${DBDIR}/${repodir}"
+#			echo "extracting $REPO_DB_FILE"
+			bsdtar -xf "${targetdir}/${repodir}/${REPO_DB_FILE}" -C "${DBDIR}/${repodir}"
+		else
+			echo "Fail! Does the repo $repo with arch $arch even exist?"
+			continue
+		fi
 
-        # extract old file archive
-        if [ -f "${targetdir}/${repodir}/${FILES_DB_FILE}" ]; then
-            mkdir -p "${CACHEDIR}/${repodir}"
-#           echo "extracting $FILES_DB_FILE"
-            bsdtar -xf "${targetdir}/${repodir}/${FILES_DB_FILE}" -C "${CACHEDIR}/${repodir}"
-            cached="yes"
-        fi
+		# extract old file archive
+		if [ -f "${targetdir}/${repodir}/${FILES_DB_FILE}" ]; then
+			mkdir -p "${CACHEDIR}/${repodir}"
+#			echo "extracting $FILES_DB_FILE"
+			bsdtar -xf "${targetdir}/${repodir}/${FILES_DB_FILE}" -C "${CACHEDIR}/${repodir}"
+			cached="yes"
+		fi
 
-        # create file lists
-        for pkg in $(ls ${DBDIR}/${repodir}); do
-            dbpkgdir="${DBDIR}/${repodir}/${pkg}"
-            cachepkgdir="${CACHEDIR}/${repodir}/${pkg}"
-            tmppkgdir="${TMPDIR}/${repodir}/${pkg}"
-            mkdir -p "$tmppkgdir"
-            ln "${dbpkgdir}/desc" "${tmppkgdir}/desc"
-            ln "${dbpkgdir}/depends" "${tmppkgdir}/depends"
-            if [ -f "${cachepkgdir}/files" ]; then
-#               echo "cache: $pkg"
-                ln "${cachepkgdir}/files" "${tmppkgdir}/files"
-            else
-#               echo "not cache: $repo/$arch: $pkg"
-                filename=$(grep -A1 '^%FILENAME%$' "${dbpkgdir}/desc" | tail -n1)
-                echo '%FILES%' > "${tmppkgdir}/files"
-                bsdtar --exclude=.* -tf "$repodir/$filename" >> "${tmppkgdir}/files"
-                cached="no"
-            fi
-        done
+		# create file lists
+		for pkg in $(ls ${DBDIR}/${repodir}); do
+			dbpkgdir="${DBDIR}/${repodir}/${pkg}"
+			cachepkgdir="${CACHEDIR}/${repodir}/${pkg}"
+			tmppkgdir="${TMPDIR}/${repodir}/${pkg}"
+			mkdir -p "$tmppkgdir"
+			ln "${dbpkgdir}/desc" "${tmppkgdir}/desc"
+			ln "${dbpkgdir}/depends" "${tmppkgdir}/depends"
+			if [ -f "${cachepkgdir}/files" ]; then
+#				echo "cache: $pkg"
+				ln "${cachepkgdir}/files" "${tmppkgdir}/files"
+			else
+#				echo "not cache: $repo/$arch: $pkg"
+				filename=$(grep -A1 '^%FILENAME%$' "${dbpkgdir}/desc" | tail -n1)
+				echo '%FILES%' > "${tmppkgdir}/files"
+				bsdtar --exclude=.* -tf "$repodir/$filename" >> "${tmppkgdir}/files"
+				cached="no"
+			fi
+		done
 
-        # create new file archive
-        if [ "$cached" == "no" ]; then
-            # at least one package has changed, so let's rebuild the archive
-#           echo "creating ${FILES_DB_FILE}/${arch}"
-            pkgdir="${targetdir}/${repodir}"
-            mkdir -p "$pkgdir"
-            cd "${TMPDIR}/${repodir}"
-            [ -f "${pkgdir}/${FILES_DB_FILE}.old" ] && rm "${pkgdir}/${FILES_DB_FILE}.old"
-            [ -f "${pkgdir}/${FILES_DB_FILE}" ] && mv "${pkgdir}/${FILES_DB_FILE}" "${pkgdir}/${FILES_DB_FILE}.old"
-            bsdtar --exclude=*${DBEXT//\.db/} -c${TAR_OPT}f "${pkgdir}/${FILES_DB_FILE}" *
-        fi
-    done
+		# create new file archive
+		if [ "$cached" == "no" ]; then
+			# at least one package has changed, so let's rebuild the archive
+#			echo "creating ${FILES_DB_FILE}/${arch}"
+			pkgdir="${targetdir}/${repodir}"
+			mkdir -p "$pkgdir"
+			cd "${TMPDIR}/${repodir}"
+			[ -f "${pkgdir}/${FILES_DB_FILE}.old" ] && rm "${pkgdir}/${FILES_DB_FILE}.old"
+			[ -f "${pkgdir}/${FILES_DB_FILE}" ] && mv "${pkgdir}/${FILES_DB_FILE}" "${pkgdir}/${FILES_DB_FILE}.old"
+			bsdtar --exclude=*${DBEXT//\.db/} -c${TAR_OPT}f "${pkgdir}/${FILES_DB_FILE}" *
+		fi
+	done
 done
 
 cd - >/dev/null
@@ -100,4 +100,4 @@ rm -rf "$TMPDIR" "$CACHEDIR" "$DBDIR"
 rm -f "$lock" || exit 1
 # echo 'done'
 
-# vim: set ts=4 sw=4 et ft=sh:
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/cron-jobs/devlist-mailer b/cron-jobs/devlist-mailer
index ca2e46b..10f8662 100755
--- a/cron-jobs/devlist-mailer
+++ b/cron-jobs/devlist-mailer
@@ -8,11 +8,11 @@ FROM="repomaint at archlinux.org"
 
 SUBJECT="Repository Maintenance $(date +"%d-%m-%Y")"
 if [ $# -ge 1 ]; then
-    SUBJECT="$1 $(date +"%d-%m-%Y")"
+	SUBJECT="$1 $(date +"%d-%m-%Y")"
 fi
 
 if [ $# -ge 2 ]; then
-    LIST="$2"
+	LIST="$2"
 fi
 
 stdin="$(cat)"
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index d66138c..53fcb72 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -9,11 +9,11 @@ LOCKFILE="/tmp/.ftpdircleanup.lock"
 
 cleanup () {
 	rm -f "$LOCKFILE"
-  exit 0
+	exit 0
 }
 
 ctrl_c() {
-    cleanup
+	cleanup
 }
 
 if [ -f "$LOCKFILE" ]; then
@@ -31,7 +31,9 @@ trap ctrl_c 2
 /usr/bin/renice +10 -p $$ > /dev/null
 
 for repo in $repos; do
-    $(dirname $0)/../misc-scripts/ftpdir-cleanup $repo $CLEANUP_DESTDIR
+	$(dirname $0)/../misc-scripts/ftpdir-cleanup $repo $CLEANUP_DESTDIR
 done
 
 cleanup
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/cron-jobs/integrity-check b/cron-jobs/integrity-check
index 0b2b9c7..c240a55 100755
--- a/cron-jobs/integrity-check
+++ b/cron-jobs/integrity-check
@@ -3,13 +3,15 @@
 basedir="$(dirname $0)"
 
 if [ $# -ne 2 ]; then
-    echo "usage: $(basename $0) <repo>[,<repo>,...] <mailto>" >&2
-    exit 1
+	echo "usage: $(basename $0) <repo>[,<repo>,...] <mailto>" >&2
+	exit 1
 fi
 
 for arch in i686 x86_64; do
-    $basedir/check_archlinux/check_packages.py \
-        --repos="$1" \
-        --abs-tree="/srv/abs/rsync/$arch,/srv/abs/rsync/any" --arch="$arch" |\
-        $basedir/devlist-mailer "Integrity Check $arch: $1" "$2"
+	$basedir/check_archlinux/check_packages.py \
+	    --repos="$1" \
+	    --abs-tree="/srv/abs/rsync/$arch,/srv/abs/rsync/any" --arch="$arch" |\
+	$basedir/devlist-mailer "Integrity Check $arch: $1" "$2"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs
index b7a4885..fc27114 100755
--- a/cron-jobs/sourceballs
+++ b/cron-jobs/sourceballs
@@ -11,12 +11,12 @@ LOCKFILE="/tmp/.sourceball.lock"
 
 cleanup () {
 	rm -f "$LOCKFILE"
-    restore_umask
-    exit 0
+	restore_umask
+	exit 0
 }
 
 ctrl_c() {
-    cleanup
+	cleanup
 }
 
 if [ -f "$LOCKFILE" ]; then
@@ -40,53 +40,55 @@ FAILED_PKGS=""
 echo "Errors occured during run:" > "$srcbase/errors.txt"
 
 for repo in $repos; do
-    for arch in ${ARCHES[@]} any; do
-        ftppath="$ftpbase/$repo/os/$arch"
-        if [ ! -d "$ftppath" ]; then
-            echo "FTP path does not exist: $ftppath" >2
-            continue
-        fi
-        cd $ftppath
-        for pkg in *$PKGEXT; do
-            [ -f "$pkg" ] || continue
-            pkgbase=$(getpkgbase $pkg)
-            srcpath="$srcbase/"
-            srcpkg="${pkg//$PKGEXT/$SRCEXT}"
-            srcpkg="${srcpkg//-$arch/}"
-            srcpkgname="${srcpkg%-*-*$SRCEXT}"
-            srcpkgbase="${srcpkg/$srcpkgname/$pkgbase}"
-
-            #Don't do anything for package in this 'blacklist'
-            if grep "^$pkgbase\$" "$dirname/sourceballs.skip" >/dev/null 2>&1; then
-                continue
-            fi
-
-            #This pkgbase has already failed. No sense in trying it again this run
-            if echo $FAILED_PKGS | grep "\<$pkgbase\>" >&/dev/null; then
-                continue
-            fi
-
-            #Use this file to 'whitelist' or force building some sourceballs,
-            # skipping the license check
-            force=""
-            if grep "^$pkgbase\$" "$dirname/sourceballs.force" >/dev/null 2>&1; then
-                force="-f"
-            fi
-
-            if [ ! \( -f "$srcpath$srcpkg" -o -f "$srcpath$srcpkgbase" \) ]; then
-                if ! $dirname/../misc-scripts/make-sourceball $force \
-                    $pkgbase $repo $arch 2>>"$srcbase/errors.txt"; then
-                    FAILED_PKGS="$FAILED_PKGS $pkgbase"
-                fi
-            fi
-        done
-    done
+	for arch in ${ARCHES[@]} any; do
+		ftppath="$ftpbase/$repo/os/$arch"
+		if [ ! -d "$ftppath" ]; then
+			echo "FTP path does not exist: $ftppath" >2
+			continue
+		fi
+		cd $ftppath
+		for pkg in *$PKGEXT; do
+			[ -f "$pkg" ] || continue
+			pkgbase=$(getpkgbase $pkg)
+			srcpath="$srcbase/"
+			srcpkg="${pkg//$PKGEXT/$SRCEXT}"
+			srcpkg="${srcpkg//-$arch/}"
+			srcpkgname="${srcpkg%-*-*$SRCEXT}"
+			srcpkgbase="${srcpkg/$srcpkgname/$pkgbase}"
+
+			#Don't do anything for package in this 'blacklist'
+			if grep "^$pkgbase\$" "$dirname/sourceballs.skip" >/dev/null 2>&1; then
+				continue
+			fi
+
+			#This pkgbase has already failed. No sense in trying it again this run
+			if echo $FAILED_PKGS | grep "\<$pkgbase\>" >&/dev/null; then
+				continue
+			fi
+
+			#Use this file to 'whitelist' or force building some sourceballs,
+			# skipping the license check
+			force=""
+			if grep "^$pkgbase\$" "$dirname/sourceballs.force" >/dev/null 2>&1; then
+				force="-f"
+			fi
+
+			if [ ! \( -f "$srcpath$srcpkg" -o -f "$srcpath$srcpkgbase" \) ]; then
+				if ! $dirname/../misc-scripts/make-sourceball $force \
+				$pkgbase $repo $arch 2>>"$srcbase/errors.txt"; then
+					FAILED_PKGS="$FAILED_PKGS $pkgbase"
+				fi
+			fi
+		done
+	done
 done
 
 if [ -n "$FAILED_PKGS" ]; then
-    [ -e "$srcbase/failed.txt" ] && /bin/mv "$srcbase/failed.txt" "$srcbase/failed.txt.old"
-    echo "The following package bases failed:" > "$srcbase/failed.txt"
-    echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "$srcbase/failed.txt"
+	[ -e "$srcbase/failed.txt" ] && /bin/mv "$srcbase/failed.txt" "$srcbase/failed.txt.old"
+	echo "The following package bases failed:" > "$srcbase/failed.txt"
+	echo -e $FAILED_PKGS | sed "s| |\n|g" | sort -u >> "$srcbase/failed.txt"
 fi
 
 cleanup
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/cron-jobs/sourceballs-cleanup b/cron-jobs/sourceballs-cleanup
index c8d7b15..7c2e1ce 100755
--- a/cron-jobs/sourceballs-cleanup
+++ b/cron-jobs/sourceballs-cleanup
@@ -10,21 +10,21 @@ LOCKFILE="/tmp/.sourceball-cleanup.lock"
 WORKDIR="/tmp/sourceball-cleanup.$packagename.$UID"
 
 cleanup () {
-    restore_umask
-    rm -rf "$WORKDIR"
-    rm -f "$LOCKFILE"
-    exit 0
+	restore_umask
+	rm -rf "$WORKDIR"
+	rm -f "$LOCKFILE"
+	exit 0
 }
 
 ctrl_c() {
-    echo "Interrupted" >&2
-    cleanup 0
+	echo "Interrupted" >&2
+	cleanup 0
 }
 
 if [ -f "$LOCKFILE" ]; then
-    owner="$(/usr/bin/stat -c %U $LOCKFILE)"
-    echo "error: source tarball generation is already in progress (started by $owner)"
-    exit 1
+	owner="$(/usr/bin/stat -c %U $LOCKFILE)"
+	echo "error: source tarball generation is already in progress (started by $owner)"
+	exit 1
 fi
 
 trap cleanup 0
@@ -43,19 +43,21 @@ cd "$WORKDIR"
 echo  "Orphaned sourceballs:" > "$logfile"
 
 for sourceball in "$srcpath"/*$SRCEXT; do
-    packagename=$(basename $sourceball)
-    packagename=${packagename%-*-*$SRCEXT}
-
-    if ! /usr/bin/svn export -q --force "$SVNREPO/$packagename" "$packagename" >/dev/null 2>&1 ; then
-      echo "$packagename : no longer in svn.  Removing sourceball." >> "$logfile"
-      mv $sourceball $SOURCE_CLEANUP_DESTDIR
-    elif [ -z "$(ls -A "$packagename/repos")" ]; then
-      echo "$packagename : no longer in repos but trunk is still in svn.  Removing sourceball." >> "$logfile"
-      mv $sourceball $SOURCE_CLEANUP_DESTDIR
-    elif !  source  "$packagename/trunk/$BUILDSCRIPT" &&  chk_license ${license[@]}; then
-      echo "$packagename : source hosting no longer required by license.  Removing sourceball." >> "$logfile"
-      mv $sourceball $SOURCE_CLEANUP_DESTDIR
-    fi
+	packagename=$(basename $sourceball)
+	packagename=${packagename%-*-*$SRCEXT}
+
+	if ! /usr/bin/svn export -q --force "$SVNREPO/$packagename" "$packagename" >/dev/null 2>&1 ; then
+		echo "$packagename : no longer in svn.  Removing sourceball." >> "$logfile"
+		mv $sourceball $SOURCE_CLEANUP_DESTDIR
+	elif [ -z "$(ls -A "$packagename/repos")" ]; then
+		echo "$packagename : no longer in repos but trunk is still in svn.  Removing sourceball." >> "$logfile"
+		mv $sourceball $SOURCE_CLEANUP_DESTDIR
+	elif !  source  "$packagename/trunk/$BUILDSCRIPT" &&  chk_license ${license[@]}; then
+		echo "$packagename : source hosting no longer required by license.  Removing sourceball." >> "$logfile"
+		mv $sourceball $SOURCE_CLEANUP_DESTDIR
+	fi
 done
 
 cleanup 0
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/db-functions b/db-functions
index df50f22..77af195 100644
--- a/db-functions
+++ b/db-functions
@@ -24,25 +24,25 @@ repo_lock () { #repo_lock <repo-name> <arch> [timeout]
 	local _owner
 
 	if [ $# -eq 2 ]; then
-	    _lockblock=true
-	    _trial=0
+		_lockblock=true
+		_trial=0
 	elif [ $# -eq 3 ]; then
-	    _lockblock=false
-	    _timeout=$3
-	    let _trial=$_timeout/$LOCK_DELAY
+		_lockblock=false
+		_timeout=$3
+		let _trial=$_timeout/$LOCK_DELAY
 	fi
 
 	_count=0
 	while [ $_count -le $_trial ] || $_lockblock ; do
-	    if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then
-		_owner="$(/usr/bin/stat -c %U $LOCKDIR)"
-		echo "error: Repo $1-$2 is already locked by $_owner. Retrying in $LOCK_DELAY seconds..." >&2
-	    else
-		set_umask
-		break
-	    fi
-	    sleep $LOCK_DELAY
-	    let _count=$_count+1
+		if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then
+			_owner="$(/usr/bin/stat -c %U $LOCKDIR)"
+			echo "error: Repo $1-$2 is already locked by $_owner. Retrying in $LOCK_DELAY seconds..." >&2
+		else
+			set_umask
+			break
+		fi
+		sleep $LOCK_DELAY
+		let _count=$_count+1
 	done
 }
 
@@ -156,18 +156,18 @@ get_repos_for_host() {
 
 #usage: chk_license ${license[@]}"
 chk_license() {
-    local l
-    for l in "$@"; do
-        l="$(echo $l | tr '[:upper:]' '[:lower:]')"
-        for allowed in ${ALLOWED_LICENSES[@]}; do
-            allowed="$(echo $allowed | tr '[:upper:]' '[:lower:]')"
-            if [ "$l" = "$allowed" ]; then
-                return 0
-            fi
-        done
-    done
-
-    return 1
+	local l
+	for l in "$@"; do
+		l="$(echo $l | tr '[:upper:]' '[:lower:]')"
+		for allowed in ${ALLOWED_LICENSES[@]}; do
+			allowed="$(echo $allowed | tr '[:upper:]' '[:lower:]')"
+			if [ "$l" = "$allowed" ]; then
+				return 0
+			fi
+		done
+	done
+
+	return 1
 }
 
 # vim: set ts=4 sw=4 noet ft=sh:
diff --git a/db-move b/db-move
index c5bd32e..9e57046 100755
--- a/db-move
+++ b/db-move
@@ -23,10 +23,10 @@ svnrepo_to="$repoto-$_arch"
 WORKDIR="$TMPDIR/db-move.$svnrepo_from.$svnrepo_to.$UID"
 
 cleanup() {
-    trap '' 0 2
+	trap '' 0 2
 	# unlock
-    repo_unlock $repoto $_arch
-    repo_unlock $repofrom $_arch
+	repo_unlock $repoto $_arch
+	repo_unlock $repofrom $_arch
 	rm -rf "$WORKDIR"
 	[ "$1" ] && exit $1
 }
@@ -55,27 +55,27 @@ cd checkout
 
 /usr/bin/svn up -q $packagebase
 if [ -d "$packagebase/repos/$svnrepo_from" ]; then
-    . "$packagebase/repos/$svnrepo_from/$BUILDSCRIPT"
-    
-    for i in ${pkgname[@]}; do
-        _pkgfile="$i-$pkgver-$pkgrel-$_arch$PKGEXT"
-        getpkgfile "$ftppath_from/${_arch}/"$_pkgfile >/dev/null
-    done
-
-    if [ -d "$packagebase/repos/$svnrepo_to" ]; then
-        echo "    Removing existing package from subversion"
-        /usr/bin/svn rm --force -q "$packagebase/repos/$svnrepo_to"
-        /usr/bin/svn commit -q -m "$(basename $0): $packagebase removed by $(id -un) for move to $repoto"
-    fi
-
-    echo "    Moving svn entries"
-    /usr/bin/svn mv -r HEAD "$packagebase/repos/$svnrepo_from" "$packagebase/repos/$svnrepo_to"
-    /usr/bin/svn commit -m "$(basename $0): moved $packagebase from [$repofrom] to [$repoto] ($_arch)"
-
-    echo "    Moving package file and updating DBs"
-    cd "$WORKDIR"
-    [ -d build/ ] || mkdir build
-    cd build/
+	. "$packagebase/repos/$svnrepo_from/$BUILDSCRIPT"
+
+	for i in ${pkgname[@]}; do
+		_pkgfile="$i-$pkgver-$pkgrel-$_arch$PKGEXT"
+		getpkgfile "$ftppath_from/${_arch}/"$_pkgfile >/dev/null
+	done
+
+	if [ -d "$packagebase/repos/$svnrepo_to" ]; then
+		echo "    Removing existing package from subversion"
+		/usr/bin/svn rm --force -q "$packagebase/repos/$svnrepo_to"
+		/usr/bin/svn commit -q -m "$(basename $0): $packagebase removed by $(id -un) for move to $repoto"
+	fi
+
+	echo "    Moving svn entries"
+	/usr/bin/svn mv -r HEAD "$packagebase/repos/$svnrepo_from" "$packagebase/repos/$svnrepo_to"
+	/usr/bin/svn commit -m "$(basename $0): moved $packagebase from [$repofrom] to [$repoto] ($_arch)"
+
+	echo "    Moving package file and updating DBs"
+	cd "$WORKDIR"
+	[ -d build/ ] || mkdir build
+	cd build/
 
 	if [ "${_arch}" == "any" ]; then
 		arches="i686 x86_64"
@@ -83,18 +83,18 @@ if [ -d "$packagebase/repos/$svnrepo_from" ]; then
 		arches="${_arch}"
 	fi
 
-    for architecture in $arches; do
+	for architecture in $arches; do
 		# copy the db file into our working area
 		if [ -f "$ftppath_from/$architecture/$repofrom$DBEXT" ]; then
-		    /bin/cp "$ftppath_from/$architecture/$repofrom$DBEXT" .
-		    /usr/bin/repo-remove -q "$repofrom$DBEXT" ${pkgname[@]} || die "Error in repo-remove"
-		    #use '*' to move the old DB too
-		    mv $repofrom$DBEXT* "$ftppath_from/$architecture"
-		    echo "    Package files will be cleaned up automatically"
+			/bin/cp "$ftppath_from/$architecture/$repofrom$DBEXT" .
+			/usr/bin/repo-remove -q "$repofrom$DBEXT" ${pkgname[@]} || die "Error in repo-remove"
+			#use '*' to move the old DB too
+			mv $repofrom$DBEXT* "$ftppath_from/$architecture"
+			echo "    Package files will be cleaned up automatically"
 		fi
 
 		if [ -f "$ftppath_to/$architecture/$repoto$DBEXT" ]; then
-		    /bin/cp "$ftppath_to/$architecture/$repoto$DBEXT" .
+			/bin/cp "$ftppath_to/$architecture/$repoto$DBEXT" .
 		fi
 
 		for i in ${pkgname[@]}; do
@@ -106,19 +106,21 @@ if [ -d "$packagebase/repos/$svnrepo_from" ]; then
 		done
 		#use '*' to move the old DB too
 		mv $repoto$DBEXT* $ftppath_to/$architecture
-        for i in ${pkgname[@]}; do
-            _pkgfile=$(getpkgfile "$i-$pkgver-$pkgrel-$_arch"$PKGEXT)
-            [ $? -gt 0 ] && die
-            if [ "${_arch}" == "any" ]; then
-                mv ${_pkgfile} $ftppath_to/any
-                ln -s ../any/${_pkgfile} $ftppath_to/$architecture/
-            else
-                mv ${_pkgfile} $ftppath_to/$architecture
-            fi
-        done
+		for i in ${pkgname[@]}; do
+			_pkgfile=$(getpkgfile "$i-$pkgver-$pkgrel-$_arch"$PKGEXT)
+			[ $? -gt 0 ] && die
+			if [ "${_arch}" == "any" ]; then
+				mv ${_pkgfile} $ftppath_to/any
+				ln -s ../any/${_pkgfile} $ftppath_to/$architecture/
+			else
+				mv ${_pkgfile} $ftppath_to/$architecture
+			fi
+		done
 	done
 else
-    die "Error: $packagebase is not in repo $repofrom"
+	die "Error: $packagebase is not in repo $repofrom"
 fi
 
 cleanup
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/db-remove b/db-remove
index 3190231..8307d4c 100755
--- a/db-remove
+++ b/db-remove
@@ -20,7 +20,7 @@ svnrepo="$reponame-$_arch"
 WORKDIR="$TMPDIR/db-remove.$svnrepo.$UID"
 
 cleanup() {
-    trap '' 0 2
+	trap '' 0 2
 	# unlock
 	repo_unlock $reponame $_arch
 	rm -rf "$WORKDIR"
diff --git a/db-update b/db-update
index 0973bf3..7bd1d64 100755
--- a/db-update
+++ b/db-update
@@ -55,7 +55,7 @@ if [ -d "${stagedir}/add" ]; then
 fi
 
 cleanup() {
-    trap '' 0 2
+	trap '' 0 2
 	repo_unlock $reponame $current_arch
 	rm -rf "$WORKDIR"
 	[ "$1" ] && exit $1
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup
index 4c559b9..7fedd76 100755
--- a/misc-scripts/ftpdir-cleanup
+++ b/misc-scripts/ftpdir-cleanup
@@ -19,181 +19,183 @@ ftppath_base="$FTP_BASE/$reponame/$FTP_OS_SUFFIX"
 
 for arch in ${ARCHES[@]}; do
 
-  repo_lock $reponame $arch $LOCK_TIMEOUT
-
-  TMPDIR=$(mktemp -d /tmp/cleanup-XXXXXX) || exit 1
-  ftppath="$ftppath_base/$arch"
-  MISSINGFILES=""
-  DELETEFILES=""
-  DELETESYMLINKS=""
-  EXTRAFILES=""
-
-  if [ ! -d "$ftppath" ]; then
-      echo "FTP path '$ftppath' does not exist"
-      exit 1
-  fi
-
-  if ! cd "${TMPDIR}" ; then
-      echo "Failed to cd to ${TMPDIR}"
-      exit 1
-  fi
-
-  if [ ! -f "$ftppath/$reponame$DBEXT" ]; then
-    echo ""
-    echo "ERROR: The file \"$ftppath/$reponame$DBEXT\" could not be found, aborting."
-    echo ""
-    exit 1
-  fi
-
-  if ! bsdtar xf "$ftppath/$reponame$DBEXT"; then
-    echo ""
-    echo "ERROR: Command failed: bsdtar xf \"$ftppath/$reponame$DBEXT\""
-    exit 1
-  fi
-
-  cd "$ftppath"
-
-  for pkg in $TMPDIR/*; do
-    filename=$(grep -A1 '^%FILENAME%$' "${pkg}/desc" | tail -n1)
-
-    if [ ! -e "${filename}" ]; then
-      MISSINGFILES="${MISSINGFILES} ${filename}"
-    else
-      pkgname="$(getpkgname ${filename})"
-      for otherfile in ${pkgname}-*; do
-        if [ "${otherfile}" != "${filename}" -a "${pkgname}" = "$(getpkgname ${otherfile})" ]; then
-          if [ -h "${otherfile}" ]; then
-            DELETESYMLINKS="${DELETESYMLINKS} ${otherfile}"
-          else
-            DELETEFILES="${DELETEFILES} ${otherfile}"
-          fi
-        fi
-      done
-    fi
-  done
-
-  for pkg in *$PKGEXT; do
-      if [ ! -e "$pkg" ]; then
-          continue
-      fi
-      pkgname="$(getpkgname $pkg)"
-      for p in ${TMPDIR}/${pkgname}-*; do
-          [ ! -d "${p}" ] || continue 2
-          dbpkgname=$(grep -A1 '^%FILENAME%$' "${p}/desc" 2>/dev/null| tail -n1)
-          if [ "${dbpkgname}" = "${pkgname}" ]; then
-              continue 2
-          fi
-      done
-      EXTRAFILES="$EXTRAFILES $pkg"
-  done
-
-  rm -rf ${TMPDIR}
-
-  # Do a quick check to see if a missing ARCHINDEPFILE is in the any dir
-  # If it is, and the file is MISSING, restore it
-  missfiles="$MISSINGFILES"
-  MISSINGFILES=""
-  for mf in $missfiles; do
-      if [ -e "${ftppath_base}/any/${mf}" ]; then
-          echo "Restoring missing 'any' symlink: ${mf}"
-          ${CLEANUP_DRYRUN} || ln -s "../any/${mf}" "${ftppath}"
-      else
-          MISSINGFILES="${MISSINGFILES} ${mf}"
-      fi
-  done
-
-  repo_unlock $reponame $arch
-
-  #Make sure we've done *something* before outputting anything
-  if [ -z "$DELETEFILES$DELETESYMLINKS$MISSINGFILES$EXTRAFILES" ]; then
-      continue
-  fi
-
-  echo "Scan complete for $reponame ($arch) at ${ftppath}"
-
-  if [ -n "$DELETEFILES" ]; then
-      echo "    The following files are out of date"
-      echo "    They will be moved to '$dest'"
-      for f in $DELETEFILES; do
-          echo "        $f"
-      done
-      echo ""
-  fi
-
-  if [ -n "$DELETESYMLINKS" ]; then
-      echo "    The following symlinks are out of date"
-      echo "    They will be deleted"
-      for f in $DELETESYMLINKS; do
-          echo "        $f"
-      done
-      echo ""
-  fi
-
-  if [ -n "$MISSINGFILES" ]; then
-      echo "    The following files are missing in the repo"
-      for f in $MISSINGFILES; do
-          echo "        $f"
-      done
-      echo ""
-  fi
-
-  if [ -n "$EXTRAFILES" ]; then
-      echo "    The following files are in the repo but not the db"
-      echo "    They will be moved to '$dest'"
-      for f in $EXTRAFILES; do
-          echo "        $f"
-      done
-  fi
-
-  if [ -n "${DELETEFILES}" ]; then
-      ${CLEANUP_DRYRUN} || mv ${DELETEFILES} "$dest"
-      echo ""
-  fi
-
-  if [ -n "${DELETESYMLINKS}" ]; then
-      ${CLEANUP_DRYRUN} || rm -f ${DELETESYMLINKS}
-      echo ""
-  fi
-
-  if [ -n "${EXTRAFILES}" ]; then
-      ${CLEANUP_DRYRUN} || mv ${EXTRAFILES} "$dest"
-      echo ""
-  fi
+	repo_lock $reponame $arch $LOCK_TIMEOUT
+
+	TMPDIR=$(mktemp -d /tmp/cleanup-XXXXXX) || exit 1
+	ftppath="$ftppath_base/$arch"
+	MISSINGFILES=""
+	DELETEFILES=""
+	DELETESYMLINKS=""
+	EXTRAFILES=""
+
+	if [ ! -d "$ftppath" ]; then
+		echo "FTP path '$ftppath' does not exist"
+		exit 1
+	fi
+
+	if ! cd "${TMPDIR}" ; then
+		echo "Failed to cd to ${TMPDIR}"
+		exit 1
+	fi
+
+	if [ ! -f "$ftppath/$reponame$DBEXT" ]; then
+		echo ""
+		echo "ERROR: The file \"$ftppath/$reponame$DBEXT\" could not be found, aborting."
+		echo ""
+		exit 1
+	fi
+
+	if ! bsdtar xf "$ftppath/$reponame$DBEXT"; then
+		echo ""
+		echo "ERROR: Command failed: bsdtar xf \"$ftppath/$reponame$DBEXT\""
+		exit 1
+	fi
+
+	cd "$ftppath"
+
+	for pkg in $TMPDIR/*; do
+		filename=$(grep -A1 '^%FILENAME%$' "${pkg}/desc" | tail -n1)
+
+		if [ ! -e "${filename}" ]; then
+			MISSINGFILES="${MISSINGFILES} ${filename}"
+		else
+			pkgname="$(getpkgname ${filename})"
+			for otherfile in ${pkgname}-*; do
+				if [ "${otherfile}" != "${filename}" -a "${pkgname}" = "$(getpkgname ${otherfile})" ]; then
+					if [ -h "${otherfile}" ]; then
+						DELETESYMLINKS="${DELETESYMLINKS} ${otherfile}"
+					else
+						DELETEFILES="${DELETEFILES} ${otherfile}"
+					fi
+				fi
+			done
+		fi
+	done
+
+	for pkg in *$PKGEXT; do
+		if [ ! -e "$pkg" ]; then
+			continue
+		fi
+		pkgname="$(getpkgname $pkg)"
+		for p in ${TMPDIR}/${pkgname}-*; do
+			[ ! -d "${p}" ] || continue 2
+			dbpkgname=$(grep -A1 '^%FILENAME%$' "${p}/desc" 2>/dev/null| tail -n1)
+			if [ "${dbpkgname}" = "${pkgname}" ]; then
+				continue 2
+			fi
+		done
+		EXTRAFILES="$EXTRAFILES $pkg"
+	done
+
+	rm -rf ${TMPDIR}
+
+	# Do a quick check to see if a missing ARCHINDEPFILE is in the any dir
+	# If it is, and the file is MISSING, restore it
+	missfiles="$MISSINGFILES"
+	MISSINGFILES=""
+	for mf in $missfiles; do
+		if [ -e "${ftppath_base}/any/${mf}" ]; then
+			echo "Restoring missing 'any' symlink: ${mf}"
+			${CLEANUP_DRYRUN} || ln -s "../any/${mf}" "${ftppath}"
+		else
+			MISSINGFILES="${MISSINGFILES} ${mf}"
+		fi
+	done
+
+	repo_unlock $reponame $arch
+
+	#Make sure we've done *something* before outputting anything
+	if [ -z "$DELETEFILES$DELETESYMLINKS$MISSINGFILES$EXTRAFILES" ]; then
+		continue
+	fi
+
+	echo "Scan complete for $reponame ($arch) at ${ftppath}"
+
+	if [ -n "$DELETEFILES" ]; then
+		echo "    The following files are out of date"
+		echo "    They will be moved to '$dest'"
+		for f in $DELETEFILES; do
+			echo "        $f"
+		done
+		echo ""
+	fi
+
+	if [ -n "$DELETESYMLINKS" ]; then
+		echo "    The following symlinks are out of date"
+		echo "    They will be deleted"
+		for f in $DELETESYMLINKS; do
+			echo "        $f"
+		done
+		echo ""
+	fi
+
+	if [ -n "$MISSINGFILES" ]; then
+		echo "    The following files are missing in the repo"
+		for f in $MISSINGFILES; do
+			echo "        $f"
+		done
+		echo ""
+	fi
+
+	if [ -n "$EXTRAFILES" ]; then
+		echo "    The following files are in the repo but not the db"
+		echo "    They will be moved to '$dest'"
+		for f in $EXTRAFILES; do
+			echo "        $f"
+		done
+	fi
+
+	if [ -n "${DELETEFILES}" ]; then
+		${CLEANUP_DRYRUN} || mv ${DELETEFILES} "$dest"
+		echo ""
+	fi
+
+	if [ -n "${DELETESYMLINKS}" ]; then
+		${CLEANUP_DRYRUN} || rm -f ${DELETESYMLINKS}
+		echo ""
+	fi
+
+	if [ -n "${EXTRAFILES}" ]; then
+		${CLEANUP_DRYRUN} || mv ${EXTRAFILES} "$dest"
+		echo ""
+	fi
 
 done
 
 ARCHINDEPFILES=""
 
 if [ -d "$ftppath_base/any" ]; then
-    cd "$ftppath_base/any"
-    for pkg in *$PKGEXT; do
-        [ -f "$pkg" ] || continue # in case we get a file named "*.pkg.tar.gz"
-        found=0
-        #check for any existing symlinks
-        for arch in ${ARCHES[@]}; do
-            if [ -h "$ftppath_base/$arch/$pkg" ]; then
-                found=1
-                break
-            fi
-        done
-        if [ $found -eq 0 ]; then
-            # We found no symlinks to this, delete it
-            ARCHINDEPFILES="$ARCHINDEPFILES $pkg"
-        fi
-    done
+	cd "$ftppath_base/any"
+	for pkg in *$PKGEXT; do
+		[ -f "$pkg" ] || continue # in case we get a file named "*.pkg.tar.gz"
+		found=0
+		#check for any existing symlinks
+		for arch in ${ARCHES[@]}; do
+			if [ -h "$ftppath_base/$arch/$pkg" ]; then
+				found=1
+				break
+			fi
+		done
+		if [ $found -eq 0 ]; then
+			# We found no symlinks to this, delete it
+			ARCHINDEPFILES="$ARCHINDEPFILES $pkg"
+		fi
+	done
 fi
 
 if [ -n "$ARCHINDEPFILES" ]; then
-  echo "    The following architecture independent packages"
-  echo "    are not symlinked in the architecture repositories."
-  echo "    They will be moved to '$dest'"
-    for f in $ARCHINDEPFILES; do
-        echo "        $f"
-    done
+	echo "    The following architecture independent packages"
+	echo "    are not symlinked in the architecture repositories."
+	echo "    They will be moved to '$dest'"
+	for f in $ARCHINDEPFILES; do
+		echo "        $f"
+	done
 fi
 
 if [ -d "$ftppath_base/any" -a -n "${ARCHINDEPFILES}" ]; then
-  cd "$ftppath_base/any"
-  ${CLEANUP_DRYRUN} || mv ${ARCHINDEPFILES} "$dest"
-  echo ""
+	cd "$ftppath_base/any"
+	${CLEANUP_DRYRUN} || mv ${ARCHINDEPFILES} "$dest"
+	echo ""
 fi
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball
index 8899fca..fca6ac4 100755
--- a/misc-scripts/make-sourceball
+++ b/misc-scripts/make-sourceball
@@ -1,9 +1,9 @@
 #!/bin/bash
 
 if [ $# -ne 3 -a $# -ne 4 ]; then
-    echo "usage: $(basename $0) [-f] <packagename> <repo> <arch>"
-    echo "  -f  Force building. Skip license checks"
-    exit 1
+	echo "usage: $(basename $0) [-f] <packagename> <repo> <arch>"
+	echo "  -f  Force building. Skip license checks"
+	exit 1
 fi
 
 . "$(dirname $0)/../db-functions"
@@ -11,8 +11,8 @@ fi
 
 FORCE=0
 if [ "$1" = "-f" ]; then
-    FORCE=1
-    shift
+	FORCE=1
+	shift
 fi
 
 packagename="$1"
@@ -25,105 +25,105 @@ logpath="/var/log/sourceballs/"
 WORKDIR="/tmp/make-sourceball.$packagename.$UID"
 
 cleanup() {
-    restore_umask
-    rm -rf "$WORKDIR"
-    [ "$1" ] && exit $1
+	restore_umask
+	rm -rf "$WORKDIR"
+	[ "$1" ] && exit $1
 }
 
 ctrl_c() {
-    echo "Interrupted" >&2
-    cleanup 0
+	echo "Interrupted" >&2
+	cleanup 0
 }
 
 die() {
-    echo -e "$*" >&2
-    cleanup 1
+	echo -e "$*" >&2
+	cleanup 1
 }
 
 pkgname_from_src() {
-    local tmp
-    tmp=${1##*/}
-    tmp=${tmp%$SRCEXT}
-    for a in ${ARCHES[@]}; do
-        tmp=${tmp%-$a}
-    done
-    tmp=${tmp%-any}
-    echo ${tmp%-*-*}
+	local tmp
+	tmp=${1##*/}
+	tmp=${tmp%$SRCEXT}
+	for a in ${ARCHES[@]}; do
+		tmp=${tmp%-$a}
+	done
+	tmp=${tmp%-any}
+	echo ${tmp%-*-*}
 }
 
 pkgver_from_src() {
-    tmp=${1##*/}
-    tmp=${tmp%$SRCEXT}
-    for a in ${ARCHES[@]}; do
-        tmp=${tmp%-$a}
-    done
-    tmp=${tmp%-any}
-    echo $tmp | sed 's|.*-\(.*-.*\)$|\1|g'
+	tmp=${1##*/}
+	tmp=${tmp%$SRCEXT}
+	for a in ${ARCHES[@]}; do
+		tmp=${tmp%-$a}
+	done
+	tmp=${tmp%-any}
+	echo $tmp | sed 's|.*-\(.*-.*\)$|\1|g'
 }
 
 create_srcpackage() {
-    if [ -d "$1" ]; then
-        pushd "$1" >/dev/null
-        . "$BUILDSCRIPT"
-	if ! [ $FORCE == 1 ] && ! chk_license ${license[@]} ; then
-            #Removed so as not to clutter failed.txt
-            #echo -e "\t$packagename license (${license[@]}) does not require source tarballs" >&2
-            cleanup 0
-        else
-            echo "Creating source tarball for $packagename-$pkgver-$pkgrel"
-        fi
-
-        local logfile="$logpath/$packagename"
-        if ! /usr/bin/makepkg --allsource --ignorearch >"$logfile" 2>&1; then
-            popd >/dev/null
-            /bin/gzip -f -9 "$logfile"
-            die "\tFailed to download source for $packagename-$pkgver-$pkgrel ($reponame-$_arch)"
-        fi
-        /bin/rm -f "$logfile"{,.gz}
-
-        local pkg_file="${packagename}-${pkgver}-${pkgrel}${SRCEXT}"
-
-        if [ ! -d "$srcpath" ]; then
-            mkdir -p "$srcpath"
-        fi
-        cp "$pkg_file" "$srcpath"
-
-        popd >/dev/null
-
-        return 0
-    fi
+	if [ -d "$1" ]; then
+		pushd "$1" >/dev/null
+		. "$BUILDSCRIPT"
+		if ! [ $FORCE == 1 ] && ! chk_license ${license[@]} ; then
+			#Removed so as not to clutter failed.txt
+			#echo -e "\t$packagename license (${license[@]}) does not require source tarballs" >&2
+			cleanup 0
+		else
+			echo "Creating source tarball for $packagename-$pkgver-$pkgrel"
+		fi
+
+		local logfile="$logpath/$packagename"
+		if ! /usr/bin/makepkg --allsource --ignorearch >"$logfile" 2>&1; then
+			popd >/dev/null
+			/bin/gzip -f -9 "$logfile"
+			die "\tFailed to download source for $packagename-$pkgver-$pkgrel ($reponame-$_arch)"
+		fi
+		/bin/rm -f "$logfile"{,.gz}
+
+		local pkg_file="${packagename}-${pkgver}-${pkgrel}${SRCEXT}"
+
+		if [ ! -d "$srcpath" ]; then
+			mkdir -p "$srcpath"
+		fi
+		cp "$pkg_file" "$srcpath"
+
+		popd >/dev/null
+
+		return 0
+	fi
 }
 
 remove_old() {
-    if [ -d "$1" ]; then
-        pushd "$1" >/dev/null
-        PKGVERS=""
-        for repo in *; do
-            cd "$repo"
-            . "$BUILDSCRIPT"
-            PKGVERS="$PKGVERS $pkgver-$pkgrel"
-            cd ..
-        done
-
-        for srcpkg in "$srcpath/$packagename-"*; do
-            [ -f "$srcpkg" ] || continue
-            if [ "$(pkgname_from_src $srcpkg)" == "$packagename" ]; then
-                skip=0
-                pver="$(pkgver_from_src $srcpkg)"
-                for v in $PKGVERS; do
-                    if [ "$v" = "$pver" ]; then
-                        skip=1
-                        break
-                    fi
-                done
-                if [ $skip -ne 1 ]; then 
-                    mv "$srcpkg" $SOURCE_CLEANUP_DESTDIR
-                fi
-            fi
-        done
-
-        popd >/dev/null
-    fi
+	if [ -d "$1" ]; then
+		pushd "$1" >/dev/null
+		PKGVERS=""
+		for repo in *; do
+			cd "$repo"
+			. "$BUILDSCRIPT"
+			PKGVERS="$PKGVERS $pkgver-$pkgrel"
+			cd ..
+		done
+
+		for srcpkg in "$srcpath/$packagename-"*; do
+			[ -f "$srcpkg" ] || continue
+			if [ "$(pkgname_from_src $srcpkg)" == "$packagename" ]; then
+				skip=0
+				pver="$(pkgver_from_src $srcpkg)"
+				for v in $PKGVERS; do
+					if [ "$v" = "$pver" ]; then
+						skip=1
+						break
+					fi
+				done
+				if [ $skip -ne 1 ]; then
+					mv "$srcpkg" $SOURCE_CLEANUP_DESTDIR
+				fi
+			fi
+		done
+
+		popd >/dev/null
+	fi
 }
 
 trap ctrl_c 2
@@ -135,8 +135,10 @@ set_umask
 cd "$WORKDIR"
 
 if /usr/bin/svn export -q "$SVNREPO/$packagename" $packagename; then
-    remove_old "$packagename/repos/"
-    create_srcpackage "$packagename/repos/$reponame-$_arch"
+	remove_old "$packagename/repos/"
+	create_srcpackage "$packagename/repos/$reponame-$_arch"
 else
-    die "\tPackage '$packagename' does not exist in repo '$reponame-$_arch'"
+	die "\tPackage '$packagename' does not exist in repo '$reponame-$_arch'"
 fi
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2community b/testing2community
index 557b39d..b8de926 100755
--- a/testing2community
+++ b/testing2community
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "community-testing" "community" "i686"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "community-testing" "community" "i686"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2community-any b/testing2community-any
index e63a7ec..83153dc 100755
--- a/testing2community-any
+++ b/testing2community-any
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "community-testing" "community" "any"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "community-testing" "community" "any"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2community64 b/testing2community64
index 3f88a4d..d0d6dd3 100755
--- a/testing2community64
+++ b/testing2community64
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "community-testing" "community" "x86_64"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "community-testing" "community" "x86_64"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2core b/testing2core
index 3a7acbf..5f6088a 100755
--- a/testing2core
+++ b/testing2core
@@ -1,11 +1,11 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "testing" "core" "i686"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "testing" "core" "i686"
 done
diff --git a/testing2core-any b/testing2core-any
index a0993e8..4e362ad 100755
--- a/testing2core-any
+++ b/testing2core-any
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "testing" "core" "any"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "testing" "core" "any"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2core64 b/testing2core64
index 4d30036..f307413 100755
--- a/testing2core64
+++ b/testing2core64
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "testing" "core" "x86_64"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "testing" "core" "x86_64"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2extra b/testing2extra
index 3be108e..12795b4 100755
--- a/testing2extra
+++ b/testing2extra
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "testing" "extra" "i686"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "testing" "extra" "i686"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2extra-any b/testing2extra-any
index 46ab2f0..2455381 100755
--- a/testing2extra-any
+++ b/testing2extra-any
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "testing" "extra" "any"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "testing" "extra" "any"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2extra64 b/testing2extra64
index 418876c..b555210 100755
--- a/testing2extra64
+++ b/testing2extra64
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 if [ $# -le 0 ]; then
-    echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
-    exit 0
+	echo "usage: $(basename 0) <packagename> [<packagename> [<packagename ...]]"
+	exit 0
 fi
 
 for pkg in $@; do
-    echo "==> Moving package '$pkg'"
-    $(dirname $0)/db-move "$pkg" "testing" "extra" "x86_64"
+	echo "==> Moving package '$pkg'"
+	$(dirname $0)/db-move "$pkg" "testing" "extra" "x86_64"
 done
+
+# vim: set ts=4 sw=4 noet ft=sh:
diff --git a/testing2x b/testing2x
index f9ded9e..7720033 100755
--- a/testing2x
+++ b/testing2x
@@ -4,24 +4,24 @@
 . "$(dirname $0)/config"
 
 case "$0" in
-    *64)
-    _arch="x86_64"
-    ;;
-    *)
-    _arch="i686"
-    ;;
+	*64)
+	_arch="x86_64"
+	;;
+	*)
+	_arch="i686"
+	;;
 esac
 WORKDIR="$TMPDIR/testing2x.$UID"
 
 cleanup() {
-    trap '' 0 2
-    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
@@ -33,23 +33,25 @@ 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"
-        fi
-    else
-        echo "===> Warning: ${pkg} is not in testing-${_arch}"
-    fi
+	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
 done
 
 cleanup
+
+# vim: set ts=4 sw=4 noet ft=sh:
-- 
1.7.0.2




-- 


More information about the arch-dev-public mailing list