From afa8c072c97954e1ee5cb7ec19d8625536f51a11 Mon Sep 17 00:00:00 2001 From: lucianposton Date: Tue, 24 Mar 2020 21:46:32 -0500 Subject: [PATCH] Misc wordsplitting/globbing changes (#32) -Add quotes to prevent word splitting -Remove $TARGET* globbing so hidden files are included -Remove unused globbing Signed-off-by: Lucian Poston --- mkstage4.sh | 12 ++++++------ tests/0001.bats | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mkstage4.sh b/mkstage4.sh index 4262f92..8547805 100755 --- a/mkstage4.sh +++ b/mkstage4.sh @@ -215,12 +215,12 @@ then echo "example: \$ $(basename "$0") -s /my-backup --exclude=/etc/ssh/ssh_host*" echo echo "COMMAND LINE PREVIEW:" - echo 'tar' "${TAR_OPTIONS[@]}" "${EXCLUDES[@]}" "${OPTIONS[@]}" -f "$STAGE4_FILENAME" ${TARGET}* + echo 'tar' "${TAR_OPTIONS[@]}" "${EXCLUDES[@]}" "${OPTIONS[@]}" -f "$STAGE4_FILENAME" "${TARGET}" if ((S_KERNEL)) then echo - echo 'tar' "${TAR_OPTIONS[@]}" -f "$STAGE4_FILENAME.ksrc" "${TARGET}usr/src/linux-$(uname -r)"* - echo 'tar' "${TAR_OPTIONS[@]}" -f "$STAGE4_FILENAME.kmod" "${TARGET}lib"*"/modules/$(uname -r)"* + echo 'tar' "${TAR_OPTIONS[@]}" -f "$STAGE4_FILENAME.ksrc" "${TARGET}usr/src/linux-$(uname -r)" + echo 'tar' "${TAR_OPTIONS[@]}" -f "$STAGE4_FILENAME.kmod" "${TARGET}lib"*"/modules/$(uname -r)" fi echo echo -n 'Type "yes" to continue or anything else to quit: ' @@ -230,10 +230,10 @@ fi # start stage4 creation: if [ "$AGREE" == 'yes' ] then - tar "${TAR_OPTIONS[@]}" "${EXCLUDES[@]}" "${OPTIONS[@]}" -f "$STAGE4_FILENAME" ${TARGET}* + tar "${TAR_OPTIONS[@]}" "${EXCLUDES[@]}" "${OPTIONS[@]}" -f "$STAGE4_FILENAME" "${TARGET}" if ((S_KERNEL)) then - tar "${TAR_OPTIONS[@]}" -f "$STAGE4_FILENAME.ksrc" "${TARGET}usr/src/linux-$(uname -r)"* - tar "${TAR_OPTIONS[@]}" -f "$STAGE4_FILENAME.kmod" "${TARGET}lib"*"/modules/$(uname -r)"* + tar "${TAR_OPTIONS[@]}" -f "$STAGE4_FILENAME.ksrc" "${TARGET}usr/src/linux-$(uname -r)" + tar "${TAR_OPTIONS[@]}" -f "$STAGE4_FILENAME.kmod" "${TARGET}lib"*"/modules/$(uname -r)" fi fi diff --git a/tests/0001.bats b/tests/0001.bats index a8cc4d3..99e37d1 100644 --- a/tests/0001.bats +++ b/tests/0001.bats @@ -159,7 +159,6 @@ teardown() { } @test "/.hiddenfile is included" { - skip "TODO: Not yet implemented" assert_tar_includes test/.hiddenfile }