From: Chris Koeritz Date: Sat, 5 Dec 2015 17:31:30 +0000 (-0500) Subject: fixed complaint during recustomize when nothing exists in custom yet. X-Git-Tag: 2.140.90~560 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=e87d1ce95fb446c4ff733260d186ced5ce0e4964;p=feisty_meow.git fixed complaint during recustomize when nothing exists in custom yet. --- 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;