Skip to content

Commit b79b05d

Browse files
mdrothMichael Tokarev
authored andcommitted
make-release: don't rely on $CWD when excluding subproject directories
The current logic scans qemu.git/subprojects/ from *.wrap files to determine whether or not to include the associated directories in the release tarballs. However, the script assumes that it is being run from the top-level of the source directory, which may not always be the case. In particular, when generating releases via, e.g.: make qemu-9.2.1.tar.xz the $CWD will either be an arbitrary external build directory, or qemu.git/build, and the exclusions will not be processed as expected. Fix this by using the $src parameter passed to the script as the root directory for the various subproject/ paths referenced by this logic. Also, the error case at the beginning of the subproject_dir() will not result in the error message being printed, and will instead produce an error message about "error" not being a valid command. Fix this by using basic shell commands. Fixes: be27b51 ("make-release: only leave tarball of wrap-file subprojects") Cc: Paolo Bonzini <[email protected]> Cc: Michael Tokarev <[email protected]> Cc: [email protected] Signed-off-by: Michael Roth <[email protected]> Signed-off-by: Michael Tokarev <[email protected]>
1 parent 0f35d85 commit b79b05d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/make-release

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
# See the COPYING file in the top-level directory.
1212

1313
function subproject_dir() {
14-
if test ! -f "subprojects/$1.wrap"; then
15-
error "scripts/archive-source.sh should only process wrap subprojects"
14+
if test ! -f "$src/subprojects/$1.wrap"; then
15+
echo "scripts/archive-source.sh should only process wrap subprojects"
16+
exit 1
1617
fi
1718

1819
# Print the directory key of the wrap file, defaulting to the
@@ -26,7 +27,7 @@ function subproject_dir() {
2627
-e 's///p' \
2728
-e 'q' \
2829
-e '}' \
29-
"subprojects/$1.wrap")
30+
"$src/subprojects/$1.wrap")
3031

3132
echo "${dir:-$1}"
3233
}
@@ -76,7 +77,7 @@ popd
7677
exclude=(--exclude=.git)
7778
# include the tarballs in subprojects/packagecache but not their expansion
7879
for sp in $SUBPROJECTS; do
79-
if grep -xqF "[wrap-file]" subprojects/$sp.wrap; then
80+
if grep -xqF "[wrap-file]" $src/subprojects/$sp.wrap; then
8081
exclude+=(--exclude=subprojects/"$(subproject_dir $sp)")
8182
fi
8283
done

0 commit comments

Comments
 (0)