From d322496b9e4f1d89c46b4a0c3cd9b5e658516e9e Mon Sep 17 00:00:00 2001 From: Ryan Delaney Date: Mon, 23 Jun 2014 15:43:52 -0700 Subject: [PATCH 1/3] be more scrupulous about testing before touching --- buildsuite | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/buildsuite b/buildsuite index 0719a92..a0bf8b4 100755 --- a/buildsuite +++ b/buildsuite @@ -83,32 +83,32 @@ if [[ ! -d "./test" ]]; then mkdir test || exit 1; fi cd test || exit 1 # File -touch FILE +if [[ ! -f FILE ]]; then touch FILE; fi # Executable file -touch EXECUTABLE +if [[ ! -f EXECUTABLE ]]; then touch EXECUTABLE; fi chmod +x EXECUTABLE # Symlink -ln -s FILE SYMLINK +if [[ ! -f SYMLINK ]]; then ln -s FILE SYMLINK; fi # Directory -mkdir DIRECTORY +if [[ ! -d DIRECTORY ]]; then mkdir DIRECTORY; fi # Directory symlink -ln -s DIRECTORY DIR-SYMLINK +if [[ ! -d DIR-SYMLINK ]]; then ln -s DIRECTORY DIR-SYMLINK; fi # Hardlink -touch HARDLINK1 -ln HARDLINK1 HARDLINK2 +if [[ ! -f HARDLINK1 ]]; then touch HARDLINK1; fi +if [[ ! -f HARDLINK2 ]]; then ln HARDLINK1 HARDLINK2; fi # Create a link to nowhere -touch nothing -ln -s nothing ORPHAN -rm nothing +if [[ ! -f nothing ]]; then touch nothing; fi +if [[ ! -f ORPHAN ]]; then ln -s nothing ORPHAN; fi +if [[ -f nothing ]]; then rm nothing; fi # World-writable -touch WORLDWRITEABLE +if [[ ! -f WORLDWRITEABLE ]]; then touch WORLDWRITEABLE; fi chmod 0777 WORLDWRITEABLE # Supported extensions From f7eb847b125f126add113e355ce8321556ddd0a0 Mon Sep 17 00:00:00 2001 From: Ryan Delaney Date: Mon, 23 Jun 2014 16:08:01 -0700 Subject: [PATCH 2/3] create test sample files in test/DIRECTORY/ --- buildsuite | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/buildsuite b/buildsuite index a0bf8b4..deae106 100755 --- a/buildsuite +++ b/buildsuite @@ -113,8 +113,9 @@ chmod 0777 WORLDWRITEABLE # Supported extensions while read line; do - : -# echo "$line" -done < <(sed -e '/^[ ]+#/d' ../LS_COLORS) + if [[ ! -f test"$line" ]]; then + touch ./DIRECTORY/test"$line" + fi +done < <(sed -r -e '/^[ ]+#/d; /^[^\.]/d; /^$/d' ../LS_COLORS | grep -Po '^\.([A-z0-9]+)' ) # vim: ft=sh foldmethod=marker: From 3968b941612633676f6115b75ecff8c555d59d72 Mon Sep 17 00:00:00 2001 From: Ryan Delaney Date: Mon, 23 Jun 2014 16:08:29 -0700 Subject: [PATCH 3/3] ignore test/ --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ab1cfb4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test/*