From 7b94bae02ff7b4b9d3b6950533681d29a46a46fb Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Sat, 3 Aug 2024 14:33:30 -0400 Subject: [PATCH] Code cleanup --- exstage4.sh | 4 ++-- mkstage4.sh | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/exstage4.sh b/exstage4.sh index 7f6a831..1f8fe14 100755 --- a/exstage4.sh +++ b/exstage4.sh @@ -97,9 +97,9 @@ fi archiveExt="${archiveFile##*.}" -if [[ "${archiveFile%%.$archiveExt}" != *.tar ]]; then +if [[ "${archiveFile%%."$archiveExt"}" != *.tar ]]; then echo "The stage file you are trying to unpack (\`$archiveFile\`) does not appear to be an archived TAR file" - echo "${archiveFile%%.$archiveExt}" + echo "${archiveFile%%."$archiveExt"}" exit 1 fi diff --git a/mkstage4.sh b/mkstage4.sh index 02ba747..b6198a9 100755 --- a/mkstage4.sh +++ b/mkstage4.sh @@ -152,18 +152,12 @@ if [[ -z "${compressAvail[$optCompressType]}" ]]; then exit 1 fi -# Shifts pointer to read custom tar options -#shift -#mapfile -t OPTIONS <<< "$@" -# Handle when no options are passed -#((${#OPTIONS[@]} == 1)) && [ -z "${OPTIONS[0]}" ] && unset OPTIONS - +# Check if using seperate kernel archive option if $optSeperateKernel; then optUserExclude+=("${targetPath}usr/src/*") optUserExclude+=("${targetPath}lib*/modules/*") fi - # tarExcludes: tarExcludes=( "dev/*" @@ -198,7 +192,6 @@ tarIncludes=( "var/db/pkg/*" ) -#tarExcludes+=("${optUserExclude[@]}") tarExcludes=("${tarExcludes[@]/#/"$targetPath"}") tarIncludes=("${tarIncludes[@]/#/"$targetPath"}")