summaryrefslogtreecommitdiffstats
path: root/misc-scripts
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-08-08 16:03:11 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-08-08 16:03:11 +0200
commit830c4d84d13712974ffd392cdcc58b038c0dcfd9 (patch)
tree43ebdbef0d019de1d6dfda8a1f4a98dc94284375 /misc-scripts
parent8a377f398ef5a01f8b52695597152c49d7a64f96 (diff)
downloaddbscripts-830c4d84d13712974ffd392cdcc58b038c0dcfd9.tar.gz
dbscripts-830c4d84d13712974ffd392cdcc58b038c0dcfd9.tar.xz
Source PKGBUILD in subshells
This patch sources a PKGBUILD in a subshells instead of directly. This way we don't polute our scope or overwrite our vars which might lead to unexpected behavior.
Diffstat (limited to 'misc-scripts')
-rwxr-xr-xmisc-scripts/make-sourceball15
-rwxr-xr-xmisc-scripts/sourceballs-cleanup3
2 files changed, 10 insertions, 8 deletions
diff --git a/misc-scripts/make-sourceball b/misc-scripts/make-sourceball
index 6e57385..8e26eec 100755
--- a/misc-scripts/make-sourceball
+++ b/misc-scripts/make-sourceball
@@ -17,7 +17,7 @@ fi
packagename="$1"
reponame="$2"
-_arch="$3"
+arch="$3"
srcpath="$FTP_BASE/sources/"
logpath="/var/log/sourceballs/"
@@ -27,7 +27,8 @@ script_lock
create_srcpackage() {
if [ -d "$1" ]; then
pushd "$1" >/dev/null
- . "PKGBUILD"
+ pkgver=$(. PKGBUILD; echo ${pkgver})
+ pkgrel=$(. PKGBUILD; echo ${pkgrel})
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
@@ -40,7 +41,7 @@ create_srcpackage() {
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)"
+ die "\tFailed to download source for $packagename-$pkgver-$pkgrel ($reponame-$arch)"
fi
/bin/rm -f "$logfile"{,.gz}
@@ -63,15 +64,15 @@ cd "$WORKDIR"
if [[ "$reponame" = "community" || "$reponame" = "community-testing" ]]; then
if /usr/bin/svn export -q "$SVNREPOCOMMUNITY/$packagename" $packagename; then
- create_srcpackage "$packagename/repos/$reponame-$_arch"
+ 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
else
if /usr/bin/svn export -q "$SVNREPO/$packagename" $packagename; then
- create_srcpackage "$packagename/repos/$reponame-$_arch"
+ 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
fi
diff --git a/misc-scripts/sourceballs-cleanup b/misc-scripts/sourceballs-cleanup
index e058c38..e407989 100755
--- a/misc-scripts/sourceballs-cleanup
+++ b/misc-scripts/sourceballs-cleanup
@@ -14,7 +14,8 @@ remove_old() {
PKGVERS=""
for repo in *; do
cd "$repo"
- . "PKGBUILD"
+ pkgver=$(. PKGBUILD; echo ${pkgver})
+ pkgrel=$(. PKGBUILD; echo ${pkgrel})
PKGVERS="$PKGVERS $pkgver-$pkgrel"
cd ..
done