aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-runhooks
diff options
context:
space:
mode:
authordancer <dancer>2001-09-27 08:20:58 +0000
committerdancer <dancer>2001-09-27 08:20:58 +0000
commit21d1aa8ce4a2bff6fbfeefca51064baac669e789 (patch)
treeed198f453bf5755a1d7fd73b214efc5efc5e6cfe /pbuilder-runhooks
parentf5c77575f6c07a9d2413d902115f1275aa96000e (diff)
downloadpbuilder-21d1aa8ce4a2bff6fbfeefca51064baac669e789.tar
pbuilder-21d1aa8ce4a2bff6fbfeefca51064baac669e789.tar.gz
changing little bits to my liking, and hopefully removing any potentially dangerous bits.
Diffstat (limited to 'pbuilder-runhooks')
-rw-r--r--pbuilder-runhooks21
1 files changed, 14 insertions, 7 deletions
diff --git a/pbuilder-runhooks b/pbuilder-runhooks
index 2c1b234..623f29b 100644
--- a/pbuilder-runhooks
+++ b/pbuilder-runhooks
@@ -18,6 +18,9 @@
#
# HISTORY:
# $Log$
+# Revision 1.4 2001/09/27 08:20:58 dancer
+# changing little bits to my liking, and hopefully removing any potentially dangerous bits.
+#
# Revision 1.3 2001/09/27 07:13:04 dancer
# and even more reindentation.
#
@@ -45,10 +48,12 @@ hooks=/tmp/hooks
#
function loadhooks () {
- if [ -e $BUILDPLACE/$hooks ]; then
- rm -rf $BUILDPLACE/$hooks
+ if [ -e "$BUILDPLACE/$hooks" ]; then
+ rm -rf "$BUILDPLACE/$hooks"
+ fi
+ if [ -d "$HOOKDIR" ]; then
+ cp -a "$HOOKDIR" "$BUILDPLACE/tmp/"
fi
- cp -a $HOOKDIR $BUILDPLACE/tmp/
}
#--------------------------------------------------------------------------
@@ -56,7 +61,7 @@ function loadhooks () {
#
function unloadhooks () {
- rm -rf $BUILDPLACE/$hooks
+ rm -rf "$BUILDPLACE/$hooks"
}
#--------------------------------------------------------------------------
@@ -72,9 +77,11 @@ function unloadhooks () {
function executehooks () {
local prefix=$1
+
+ # is this necessary?
pushd $BUILDPLACE/$hooks
for fn in $prefix[0-9][0-9]* ; do
- case $fn in
+ case "$fn" in
*~)
echo "E: skipping an editor backup file $fn"
;;
@@ -83,10 +90,10 @@ function executehooks () {
;;
*)
if [ -x $fn ]; then
- chroot $BUILDPLACE $hooks/$fn
+ $CHROOTEXEC "$hooks/$fn"
echo " -> user script $fn finished"
else
- filetype=`file --dereference $fn`
+ filetype=$(readlink -f "$fn")
echo "E: execute priv not set on file $filetype"
fi
;;