mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
scripts/archive-source: find directory name for subprojects
Rust subprojects have the semantic version (followed by -rs) in the subproject name, but the full version (without -rs) is used by crates.io for the root directory of the tarball. Teach scripts/archive-source.sh to look for the root directory name in wrap files. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5a5110d290
commit
474dcfc0ab
1 changed files with 22 additions and 1 deletions
|
@ -48,13 +48,34 @@ function tree_ish() {
|
||||||
echo "$retval"
|
echo "$retval"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function subproject_dir() {
|
||||||
|
if test ! -f "subprojects/$1.wrap"; then
|
||||||
|
error "scripts/archive-source.sh should only process wrap subprojects"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Print the directory key of the wrap file, defaulting to the
|
||||||
|
# subproject name. The wrap file is in ini format and should
|
||||||
|
# have a single section only. There should be only one section
|
||||||
|
# named "[wrap-*]", which helps keeping the script simple.
|
||||||
|
local dir
|
||||||
|
dir=$(sed -n \
|
||||||
|
-e '/^\[wrap-[a-z][a-z]*\]$/,/^\[/{' \
|
||||||
|
-e '/^directory *= */!b' \
|
||||||
|
-e 's///p' \
|
||||||
|
-e 'q' \
|
||||||
|
-e '}' \
|
||||||
|
"subprojects/$1.wrap")
|
||||||
|
|
||||||
|
echo "${dir:-$1}"
|
||||||
|
}
|
||||||
|
|
||||||
git archive --format tar "$(tree_ish)" > "$tar_file"
|
git archive --format tar "$(tree_ish)" > "$tar_file"
|
||||||
test $? -ne 0 && error "failed to archive qemu"
|
test $? -ne 0 && error "failed to archive qemu"
|
||||||
|
|
||||||
for sp in $subprojects; do
|
for sp in $subprojects; do
|
||||||
meson subprojects download $sp
|
meson subprojects download $sp
|
||||||
test $? -ne 0 && error "failed to download subproject $sp"
|
test $? -ne 0 && error "failed to download subproject $sp"
|
||||||
tar --append --file "$tar_file" --exclude=.git subprojects/$sp
|
tar --append --file "$tar_file" --exclude=.git subprojects/"$(subproject_dir $sp)"
|
||||||
test $? -ne 0 && error "failed to append subproject $sp to $tar_file"
|
test $? -ne 0 && error "failed to append subproject $sp to $tar_file"
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue