From 18383f1af7638f0e19e3187fb42b08c2b5f0d6c7 Mon Sep 17 00:00:00 2001 From: Andreas Rogge Date: Wed, 28 Jun 2023 15:14:42 +0200 Subject: [PATCH] devtools: fix dist-tarball.sh path prefix dist-tarball.sh was supposed to create "clean" tarballs, that is with a path-prefix of bareos-x.y.z based on the version-number. This didn't happen as rewriting in tar did not take place. With this patch the paths provided to tar are now all prefixed with './' which allows the substitution to work correctly. --- devtools/dist-tarball.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/devtools/dist-tarball.sh b/devtools/dist-tarball.sh index 1f5806ffcda..57e901cc0b1 100755 --- a/devtools/dist-tarball.sh +++ b/devtools/dist-tarball.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # BAREOSĀ® - Backup Archiving REcovery Open Sourced # -# Copyright (C) 2021-2022 Bareos GmbH & Co. KG +# Copyright (C) 2021-2023 Bareos GmbH & Co. KG # # This program is Free Software; you can redistribute it and/or # modify it under the terms of version three of the GNU Affero General Public @@ -36,6 +36,12 @@ at_exit() { } trap at_exit EXIT +add_prefix() { + while IFS= read -r -d $'\0' path; do + echo -ne "./$path\0" + done +} + git="${GIT:-$(command -v git)}" cmake="${CMAKE:-$(command -v cmake)}" @@ -122,6 +128,7 @@ fi (echo -ne 'cmake/BareosVersion.cmake\0'; "$git" ls-files -z) | \ "$sort" -u -z | \ +add_prefix | \ "$tar" "${args[@]}" -cf - --files-from - | \ "$xz" --threads=0 -c -6 > "${archive_file}"