Codebase list rust-libslirp / cc003c9
Check for build-dependencies when releasing Ximin Luo 5 years ago
3 changed file(s) with 33 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
4141 git add debian/changelog
4242 )
4343
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() {
4845 git reset
4946 git checkout -- "$PKGDIR/debian/changelog"
5047 git checkout "$PREVBRANCH"
5148 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
5258 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."
5376 fi
5477
5578 git commit -m "Release package $PKGNAME"
3939 fi
4040 fi
4141
42 rm -rf "$BUILDDIR" "$(dirname "$BUILDDIR")/rust-${PKGNAME}_$VER"*.orig.tar.*
43 $DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" "$CRATE" "$VER"
42 run_debcargo
4443
4544 if ! git diff --quiet -- "$PKGDIR_REL"; then
4645 read -p "Update wrote some changes to $PKGDIR_REL, press enter to git diff..." x
5959 if [ -z "$CRATE" ]; then
6060 abort 2 "Usage: $0 <crate> [<version>]"
6161 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 }