From e87d1ce95fb446c4ff733260d186ced5ce0e4964 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sat, 5 Dec 2015 12:31:30 -0500 Subject: [PATCH] fixed complaint during recustomize when nothing exists in custom yet. --- scripts/core/functions.sh | 5 ++++- scripts/files/safedel.pl | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 724dacb3..3a6f9ead 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -424,7 +424,10 @@ if [ -z "$skip_all" ]; then regenerate >/dev/null pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null local incongruous_files="$(bash "$FEISTY_MEOW_SCRIPTS/files/list_non_dupes.sh" "$FEISTY_MEOW_DIR/customizing/$user" "$FEISTY_MEOW_LOADING_DOCK/custom")" - if [ ${#incongruous_files} -ge 1 ]; then + +#echo "the incongruous files list is: $incongruous_files" + # disallow a single character result, since we get "*" as result when nothing exists yet. + if [ ${#incongruous_files} -ge 2 ]; then echo "cleaning unknown older overrides..." perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" $incongruous_files echo diff --git a/scripts/files/safedel.pl b/scripts/files/safedel.pl index 2315464e..0fd25678 100644 --- a/scripts/files/safedel.pl +++ b/scripts/files/safedel.pl @@ -91,6 +91,9 @@ sub safedel { if (substr($file, length($file) - 1, 1) eq ":") { die "removing the root directory of a drive is not permitted!"; } + +#print "file to whack: '$file'\n"; + if ( ($file =~ /^.*\/\.$/) || ($file =~ /^.*\/\.\.$/) ) { print "ignoring attempt to remove current or parent directory.\n"; next; -- 2.34.1