From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: Re: [PATCH] backup.pl: fix Bug12817 - directories missing in backup after include file changed to relat> Date: Mon, 28 Mar 2022 16:30:12 +0200 Message-ID: <2d8f8c3d-5ebb-146a-9bd3-adae43812715@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0422251621611733393==" List-Id: --===============0422251621611733393== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Michael, On 28/03/2022 16:08, Michael Tremer wrote: > Hello Adolf, >=20 >> On 25 Mar 2022, at 12:22, Adolf Belka wrote: >> >> From: Bernhard Bitsch >> >> - The change of the backup include file from absolute paths to relative pa= ths in CU164 >> commit https://git.ipfire.org/?p=3Dipfire-2.x.git;a=3Dcommit;h=3Dc7e0d7= 3e7cfd7be95db9d0a5f3392b8241813d5b >> resulted in 20 core function directories no longer being backed up. Add= itionally a >> similar effect occurred with some addon backups >=20 > Why is this happening? Is it because tar relied on the shell to expand the = glowing characters? I don't know. I found the issue, together with someone on the forum.=20 Bernhard suggested the fix, which I tested, but I don't understand the=20 issues behind the problem. Maybe Bernhard has more input on what might=20 be causing the problem. >=20 > In that case, the file list should be changed that tar knows what files to = pack and what not. I wouldn=E2=80=99t want to rely on globbing unless we have= a reason that forces us. Okay, will try and see if I can understand the basis for why the problem=20 is occurring with the change of names from absolute to relative. Regards, Adolf. >=20 >> - Fix applied here proposed by Bernhard Bitsch and tested on a vm testbed = system and >> confirmed to fix the problem. Backup of all directories again being don= e. >> >> Fixes: Bug12817 >> Tested-By: Adolf Belka >> Signed-off-by: Adolf Belka >> --- >> config/backup/backup.pl | 22 ++++++++++++---------- >> 1 file changed, 12 insertions(+), 10 deletions(-) >> >> diff --git a/config/backup/backup.pl b/config/backup/backup.pl >> index a2337cf23..c7dbc6cae 100644 >> --- a/config/backup/backup.pl >> +++ b/config/backup/backup.pl >> @@ -35,16 +35,18 @@ list_addons() { >> process_includes() { >> local include >> >> - for include in $@; do >> - local file >> - while read -r file; do >> - for file in ${file}; do >> - if [ -e "/${file}" ]; then >> - echo "${file}" >> - fi >> - done >> - done < "${include}" >> - done | sort -u >> + pushd / >/dev/null >> + for include in $@; do >> + local file >> + while read -r file; do >> + for file in ${file}; do >> + if [ -e "/${file}" ]; then >> + echo "${file}" >> + fi >> + done >> + done < "${include}" >> + done | sort -u >> + popd >/dev/null >> } >> >> make_backup() { >> --=20 >> 2.35.1 >> >=20 --=20 Sent from my laptop --===============0422251621611733393==--