From 804c9747b4bc8f8c3c5aff78221c3216c37559aa Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 28 Apr 2006 09:01:44 +0000 Subject: [PATCH] fix new_home directory, and add more cases to sanitize_filename --- new_home_directory | 6 +++++- sanitize_filename | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/new_home_directory b/new_home_directory index e6883ef..6bd7b3d 100755 --- a/new_home_directory +++ b/new_home_directory @@ -21,7 +21,11 @@ mkdir .home_modules; mkdir home_backup; mv .wgetrc .svn .sversionrc home_backup/; # run the appropriate command to set the symlinks correctly -sh -c "$(awk -F "$(echo -ne '\t')" '{print $2}' ~/.home_modules/base/sa_base) ~/.home_modules;" +sh -c "$(awk -F ' ' '{print $2}' ~/.home_modules/base/sa_base) ~/.home_modules;" mkdir .sa.d; ln -s ~/.home_modules/*/sa_* .sa.d/; +cat -< .sa.d/sa_local +~/bin +~/lib +EOF exec sa update; \ No newline at end of file diff --git a/sanitize_filename b/sanitize_filename index 3e6d705..e0bd322 100755 --- a/sanitize_filename +++ b/sanitize_filename @@ -1,7 +1,9 @@ #! /bin/sh # replace spaces with underscores, lowercase everything, ditch multiple underscores, and ditch _.foo. # should probably try to avoid overwriting existing files, but c'est la vie! -set - $(getopt -u --longoptions 'anime' -- '' "$@") + +TEMP="$(getopt --longoptions 'anime' -- '' "$@")" +eval set -- $TEMP set -e ANIME_CUT=0 @@ -23,7 +25,7 @@ while [ $1 != '--' ]; do done; shift; if [ "$ANIME_CUT" == 0 ]; then - rename 's/\s+/\_/g; $_ = lc($_); s/\_+/\_/g; s/\_\././' "$@" + rename 's/\s+/\_/g; s/[^\w\d.]/\_/g; s/^_+//g; s/_$//g; $_ = lc($_); s/\_+/\_/g; s/\_\././' "$@" else rename 's/\[[^\]]+\]//g; s/^_+//; s/\s+/\_/g; $_ = lc($_); s/[_-]+/\_/g; s/\_\././' "$@" fi; \ No newline at end of file -- 2.39.5