diff --git a/debian/changelog b/debian/changelog index db0e5ed..159838f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sapphrc (1.3.1) unstable; urgency=medium + + * Fixed filelist logic + + -- Penelope Gwen Thu, 30 May 2024 23:07:39 -0600 + sapphrc (1.3.0) unstable; urgency=medium * codebase overhaul diff --git a/lib/sapphrc/sapphrc-filelists b/lib/sapphrc/sapphrc-filelists index 4948e4f..2c90d47 100644 --- a/lib/sapphrc/sapphrc-filelists +++ b/lib/sapphrc/sapphrc-filelists @@ -22,10 +22,10 @@ sapphrc_addfile(){ read -p "${bold}Add the listed files/directories to profile '${PROFILE_NAME}'?${normal} (Y/n)" yn if ! [[ "${yn}" =~ ^([nN][oO]|[nN])$ ]];then for e in ${filelist[@]};do - if grep -q ^"${e}"$ "${sapphrc_config}/backups/${PROFILE_NAME}/${inex}";then + if grep -q ^"${e}"$ "${sapphrc_config}/backups/${PROFILE_NAME}/${LIST}";then echo "already in file" else - echo $e|tee -a "${sapphrc_config}/backups/${PROFILE_NAME}/${inex}" >/dev/null + echo $e|tee -a "${sapphrc_config}/backups/${PROFILE_NAME}/${LIST}" >/dev/null fi done fi @@ -37,7 +37,7 @@ sapphrc_rmfile(){ rmfiles+=("$i");i=$(($i+1)) rmfiles+=("$line") rmfiles+=("$line") - done < "${sapphrc_config}/backups/${PROFILE_NAME}/${inex}" + done < "${sapphrc_config}/backups/${PROFILE_NAME}/${LIST}" [ ${#rmfiles[@]} -eq 0 ] && echo "No files in list" && exit 1 choices=($(dialog --checklist --output-fd 1 "Select options:" 0 0 0 "${rmfiles[@]}")) if [ $? -ne 0 ]; then @@ -48,8 +48,8 @@ sapphrc_rmfile(){ for choice in "${choices[@]}"; do rmlines="${rmlines}$((${choice}+1))d;" done - sed -i "${rmlines}" "${sapphrc_config}/backups/${PROFILE_NAME}/${inex}" - echo "Removed ${#choices[@]} paths from ${PROFILE_NAME} ${inex} list" + sed -i "${rmlines}" "${sapphrc_config}/backups/${PROFILE_NAME}/${LIST}" + echo "Removed ${#choices[@]} paths from ${PROFILE_NAME} ${LIST} list" } sapphrc_filelists(){