Added helper script to unpack MUT components; CI orig tarball handling correction.
This commit is contained in:
parent
742c9f437a
commit
571cac576e
1 changed files with 36 additions and 0 deletions
36
debian/unpack-components.sh
vendored
Executable file
36
debian/unpack-components.sh
vendored
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/bash
|
||||||
|
: <<=cut
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
Unpack MUT components.
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
./debian/unpack-components.sh
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
DEB_SOURCE="$( dpkg-parsechangelog -SSource )"
|
||||||
|
DEB_VERSION_UPSTREAM="$( dpkg-parsechangelog -SVersion | sed -e 's/-[^-]*$//' )"
|
||||||
|
|
||||||
|
if ls ../${DEB_SOURCE}_${DEB_VERSION_UPSTREAM}.orig-*.tar.* 2>>/dev/null; then
|
||||||
|
for T in ../${DEB_SOURCE}_${DEB_VERSION_UPSTREAM}.orig-*.tar.*; do
|
||||||
|
C="${T##*.orig-}"
|
||||||
|
C="${C%%.tar*}"
|
||||||
|
mkdir -p "${C}"
|
||||||
|
tar xf ${T} -C "${C}" --strip-components=1
|
||||||
|
if [ "$(ls -m ${C})" == "${C}" ]; then
|
||||||
|
## --strip-components=1 did not work.
|
||||||
|
mv "${C}" "${C}.tmp"
|
||||||
|
mv "${C}.tmp/${C}" .
|
||||||
|
rmdir "${C}.tmp"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
printf "W: no components to extract.\n"
|
||||||
|
exit 0
|
||||||
|
fi
|
Loading…
Reference in a new issue