Comment/code cleanup

This commit is contained in:
Eric Renfro 2024-08-04 02:24:07 -04:00
parent 4b3165a05b
commit a8963efd1f
Signed by: psi-jack
SSH key fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM
3 changed files with 0 additions and 13 deletions

View file

@ -159,6 +159,5 @@ fi
# start stage4 creation:
if $optQuiet; then
#echo "Would've worked"
tar "${tarOptions[@]}" -f "$archiveFile" -C "$targetPath"
fi

View file

@ -106,7 +106,6 @@ while [[ $# -gt 0 ]]; do
else
tarArgs[${#tarArgs[*]}]=$1
fi
#args[${#args[*]}]=$1 # save first non-option argument (a.k.a. positional argument)
shift # remove saved arg
done
@ -134,7 +133,6 @@ if [[ -z "$targetArchive" ]]; then
fi
# determines if filename was given with relative or absolute path
#if (($(grep -c '^/' <<< "$targetArchive") > 0)); then
if [[ "$targetArchive" =~ ^\/.* ]]; then
stage4Filename="${targetArchive}"
else
@ -146,7 +144,6 @@ if [[ -z "$optCompressType" ]]; then
echo "$(basename "$0"): no archive compression type specified"
exit 1
else
#stage4Filename="${stage4Filename}.${optCompressType}"
stage4Ext="tar.${optCompressType}"
fi
@ -202,10 +199,6 @@ tarIncludes=("${tarIncludes[@]/#/"$targetPath"}")
if [[ "$targetPath" == '/' ]]; then
tarExcludes+=("$(realpath "${stage4Filename}")*")
#if $optSeperateKernel; then
# tarExcludes+=("$(realpath "${stage4Filename}.ksrc.${stage4Ext}")")
# tarExcludes+=("$(realpath "${stage4Filename}.kmod.${stage4Ext}")")
#fi
if command -v portageq &>/dev/null; then
portageRepos=$(portageq get_repos /)
for i in ${portageRepos}; do
@ -270,9 +263,7 @@ if ! $optQuiet; then
echo "example: \$ $(basename "$0") -s /my-backup --exclude=/etc/ssh/ssh_host*"
echo
echo "COMMAND LINE PREVIEW:"
#echo 'tar' "${tarOptions[@]}" "${tarIncludes[@]}" "${tarExcludes[@]}" -f "$stage4Filename" "${targetPath}"
echo 'tar' "${tarOptions[@]}" "${tarExcludes[@]/#/--exclude=}" -f "${stage4Filename}.${stage4Ext}" "${targetPath}" "${tarIncludes[@]}"
#${excludes[@]/#/--exclude=
if $optSeperateKernel; then
echo
echo 'tar' "${tarOptions[@]}" -f "${stage4Filename}.ksrc.${stage4Ext}" "${targetPath}usr/src/linux-$(uname -r)"
@ -288,7 +279,6 @@ fi
# start stage4 creation:
if $optQuiet; then
#echo "Would've worked"
tar "${tarOptions[@]}" "${tarIncludes[@]}" "${tarExcludes[@]/#/--exclude=}" -f "${stage4Filename}.${stage4Ext}" "${targetPath}"
if [[ "$optSeperateKernel" ]]
then

View file

@ -76,7 +76,6 @@ while [[ $# -gt 0 ]]; do
else
rsyncArgs[${#rsyncArgs[*]}]=$1
fi
#args[${#args[*]}]=$1 # save first non-option argument (a.k.a. positional argument)
shift # remove saved arg
done
@ -213,6 +212,5 @@ fi
# start stage4 creation:
if $optQuiet; then
#echo "Would've worked"
rsync "${rsyncOptions[@]}" "${syncExcludes[@]/#/--exclude=}" "$sourcePath" "$targetPath"
fi