From 54da7fc2022b461bb825953747b6da24983a3234 Mon Sep 17 00:00:00 2001 From: Anuradha Weeraman Date: Sun, 21 Jun 2020 19:59:55 -0400 Subject: [PATCH] Fix 'bin/package clean' deleting entire git repo (#32) This appears to be originating from: 2755 *) if test ! -d $INSTALLROOT 2756 then INSTALLROOT=$PACKAGEROOT; where INSTALLROOT=PACKAGEROOT and 'clean' deletes everything under INSTALLROOT thus deleting the entire git repo. This only applies when there's no arch/$HOSTTYPE directory due to the condition above. bin/package, src/cmd/INIT/package.sh: - Delete arch/$HOSTTYPE as stated in the documentation for the clean action instead of $INSTALLROOT. --- bin/package | 2 +- src/cmd/INIT/package.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/package b/bin/package index 0fd1de35a..88623dab9 100755 --- a/bin/package +++ b/bin/package @@ -4992,7 +4992,7 @@ admin) while test ! -f $admin_db clean|clobber) cd $PACKAGEROOT - $exec rm -rf $INSTALLROOT + $exec rm -rf arch/$HOSTTYPE exit ;; diff --git a/src/cmd/INIT/package.sh b/src/cmd/INIT/package.sh index 11b90f873..d46d040c5 100644 --- a/src/cmd/INIT/package.sh +++ b/src/cmd/INIT/package.sh @@ -4991,7 +4991,7 @@ admin) while test ! -f $admin_db clean|clobber) cd $PACKAGEROOT - $exec rm -rf $INSTALLROOT + $exec rm -rf arch/$HOSTTYPE exit ;;