From 0a437f4b532b0ac50fbcf5c01fc7a63c1fa66be9 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 10 Nov 2012 16:58:31 +0100 Subject: improve directory handling --- bin/chroot_tester.sh | 4 ++-- bin/d-i_manual.sh | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/chroot_tester.sh b/bin/chroot_tester.sh index eeb0fca4..94ab7de9 100755 --- a/bin/chroot_tester.sh +++ b/bin/chroot_tester.sh @@ -37,8 +37,8 @@ export TMPFILE=$(mktemp -u) export CTMPFILE=$CHROOT_TARGET/$TMPFILE cleanup_all() { - # FIXME: test if it starts with /chroots/ - if [ "$CHROOT_TARGET" = "" ] ; then + # test if $CHROOT_TARGET starts with /chroots/ + if [ "${CHROOT_TARGET:0:9}" != "/chroots/" ] ; then echo "HALP. CHROOT_TARGET = $CHROOT_TARGET" exit 1 fi diff --git a/bin/d-i_manual.sh b/bin/d-i_manual.sh index eae84dc8..6ef0c670 100755 --- a/bin/d-i_manual.sh +++ b/bin/d-i_manual.sh @@ -41,6 +41,10 @@ pdebuild_package() { build_language() { FORMAT=$2 + # if $FORMAT is a directoy and it's string length greater or equal then 3 (so not "." or "..") + if [ -d "$FORMAT" ] && [ ${#FORMAT} -ge 3 ]; then + rm -rf $FORMAT + fi mkdir $FORMAT cd manual/build ARCHS=$(ls arch-options) -- cgit v1.2.3-70-g09d2