Check for build-dependencies when releasing
Ximin Luo
5 years ago
41 | 41 |
git add debian/changelog
|
42 | 42 |
)
|
43 | 43 |
|
44 | |
rm -rf "$BUILDDIR" "$(dirname "$BUILDDIR")/rust-${PKGNAME}_$VER"*.orig.tar.*
|
45 | |
$DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" --changelog-ready "$CRATE" "$VER"
|
46 | |
|
47 | |
if ! git diff --exit-code -- "$PKGDIR_REL"; then
|
|
44 |
revert_git_changes() {
|
48 | 45 |
git reset
|
49 | 46 |
git checkout -- "$PKGDIR/debian/changelog"
|
50 | 47 |
git checkout "$PREVBRANCH"
|
51 | 48 |
git branch -d "$RELBRANCH"
|
|
49 |
}
|
|
50 |
|
|
51 |
if ! run_debcargo --changelog-ready; then
|
|
52 |
revert_git_changes
|
|
53 |
abort 1 "Release attempt failed to run debcargo, probably the package needs updating (./update.sh $*)"
|
|
54 |
fi
|
|
55 |
|
|
56 |
if ! git diff --exit-code -- "$PKGDIR_REL"; then
|
|
57 |
revert_git_changes
|
52 | 58 |
abort 1 "Release attempt resulted in git diffs to $PKGDIR_REL, probably the package needs updating (./update.sh $*)"
|
|
59 |
fi
|
|
60 |
|
|
61 |
check_build_deps() {
|
|
62 |
local success=true
|
|
63 |
sed -ne '/Build-Depends/,/^[^ ]/p' "build/$PKGNAME/debian/control" | \
|
|
64 |
grep -Eo 'librust-.*+.*-dev' | \
|
|
65 |
{ while read pkg; do
|
|
66 |
if [ $(apt-cache showpkg "$pkg" | grep ^Package: | wc -l) = 0 ]; then
|
|
67 |
echo >&2 "Build-Dependency not yet in debian: $pkg"
|
|
68 |
success=false
|
|
69 |
fi
|
|
70 |
done; $success; }
|
|
71 |
}
|
|
72 |
|
|
73 |
if ! check_build_deps; then
|
|
74 |
revert_git_changes
|
|
75 |
abort 1 "Release attempt detected build-dependencies not in Debian (see messages above), release those first."
|
53 | 76 |
fi
|
54 | 77 |
|
55 | 78 |
git commit -m "Release package $PKGNAME"
|
39 | 39 |
fi
|
40 | 40 |
fi
|
41 | 41 |
|
42 | |
rm -rf "$BUILDDIR" "$(dirname "$BUILDDIR")/rust-${PKGNAME}_$VER"*.orig.tar.*
|
43 | |
$DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" "$CRATE" "$VER"
|
|
42 |
run_debcargo
|
44 | 43 |
|
45 | 44 |
if ! git diff --quiet -- "$PKGDIR_REL"; then
|
46 | 45 |
read -p "Update wrote some changes to $PKGDIR_REL, press enter to git diff..." x
|
59 | 59 |
if [ -z "$CRATE" ]; then
|
60 | 60 |
abort 2 "Usage: $0 <crate> [<version>]"
|
61 | 61 |
fi
|
|
62 |
|
|
63 |
run_debcargo() {
|
|
64 |
rm -rf "$BUILDDIR" "$(dirname "$BUILDDIR")/rust-${PKGNAME}_$VER"*.orig.tar.*
|
|
65 |
$DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" "$@" "$CRATE" "$VER"
|
|
66 |
}
|