Skip to content

Commit

Permalink
devtools: fix dist-tarball.sh path prefix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arogge authored and BareosBot committed Aug 17, 2023
1 parent bbfaa1d commit 18383f1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 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
Expand Down Expand Up @@ -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)}"

Expand Down Expand Up @@ -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}"

Expand Down

0 comments on commit 18383f1

Please sign in to comment.