From 21d1aa8ce4a2bff6fbfeefca51064baac669e789 Mon Sep 17 00:00:00 2001 From: dancer Date: Thu, 27 Sep 2001 08:20:58 +0000 Subject: changing little bits to my liking, and hopefully removing any potentially dangerous bits. --- pbuilder-runhooks | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'pbuilder-runhooks') 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 ;; -- cgit v1.2.3