Repackage using exact same version, also require debcargo 2.2.5
Ximin Luo
5 years ago
2 | 2 |
# Use like, e.g. `dev/list-unreleased.sh | dev/filter-builddeps-ok.sh`
|
3 | 3 |
set -e
|
4 | 4 |
|
5 | |
shouldbuild() {
|
6 | |
local dst="$1"
|
7 | |
local src="$2"
|
8 | |
test ! -e "$dst" -o "$src" -nt "$dst"
|
9 | |
}
|
10 | |
|
11 | 5 |
echo >&2 "redirecting all other output e.g. from debcargo to stderr"
|
12 | 6 |
while read crate ver; do
|
13 | |
pkgname="${crate//_/-}${ver:+-$ver}"
|
14 | |
if shouldbuild "build/$pkgname/debian/changelog" "src/$pkgname/debian/changelog"; then
|
15 | |
realver="$(sed -nre "s/.*Package .* (.*) from crates.io.*/\1/gp" src/$pkg/debian/changelog | head -n1)"
|
16 | |
REALVER="$realver" ./update.sh "$crate" $ver >&2 # TODO: no-overlay-write-back
|
17 | |
fi
|
|
7 |
./repackage.sh "$crate" $ver >&2
|
18 | 8 |
if ( cd build && SOURCEONLY=1 ./build.sh "$crate" $ver >&2 ); then
|
19 | 9 |
ok=1
|
20 | 10 |
else
|
|
0 |
#!/bin/sh
|
|
1 |
|
|
2 |
. ./vars.sh.frag
|
|
3 |
|
|
4 |
if ! shouldbuild "$BUILDDIR/debian/changelog" "$PKGDIR/debian/changelog"; then
|
|
5 |
exit 0
|
|
6 |
fi
|
|
7 |
|
|
8 |
REALVER="$(sed -nre "s/.*Package .* (.*) from crates.io.*/\1/gp" "$PKGDIR/debian/changelog" | head -n1)"
|
|
9 |
run_debcargo --no-overlay-write-back
|
34 | 34 |
test -x "$DEBCARGO" || abort 1 "debcargo found but not executable: $DEBCARGO"
|
35 | 35 |
dcver=$($DEBCARGO --version | sed -ne 's/debcargo //p')
|
36 | 36 |
case $dcver in
|
37 | |
2.0.*|2.1.*|2.2.[0123]|2.2.[0123]-*) abort 1 "unsupported debcargo version $dcver. try reinstalling with \`cargo install debcargo --force\`";;
|
|
37 |
2.0.*|2.1.*|2.2.[01234]|2.2.[01234]-*) abort 1 "unsupported debcargo version $dcver. try reinstalling with \`cargo install debcargo --force\`";;
|
38 | 38 |
2.2.*) true;;
|
39 | 39 |
*) abort 1 "unsupported debcargo version: $dcver";;
|
40 | 40 |
esac
|
|
68 | 68 |
rm -rf "$BUILDDIR" "$(dirname "$BUILDDIR")/rust-${PKGNAME}_$VER"*.orig.tar.*
|
69 | 69 |
$DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" "$@" "$CRATE" "${REALVER:-$VER}"
|
70 | 70 |
}
|
|
71 |
|
|
72 |
shouldbuild() {
|
|
73 |
local dst="$1"
|
|
74 |
local src="$2"
|
|
75 |
test ! -e "$dst" -o "$src" -nt "$dst"
|
|
76 |
}
|