diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..64bdc20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/build +/src/*/* +!/src/*/debian diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..89cefc1 --- /dev/null +++ b/README.rst @@ -0,0 +1,3 @@ +Run `./update.sh ` and follow its instructions. + +(The above applies even for new Rust Debian packages.) diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..62ebd9c --- /dev/null +++ b/release.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +. ./vars.sh.frag + +git diff -q -- "$PKGDIR_REL" || \ +abort 1 "Please git-add your changes to $PKGDIR_REL before running" + +( cd "$PKGDIR" +sed -i -e s/UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO/UNRELEASED/ debian/changelog +dch -r -D unstable "" +git add debian/changelog +) + +rm -rf "$BUILDDIR" +$DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" --changelog-ready "$PKG" + +git diff -q -- "$PKGDIR_REL" || \ +abort 1 "cannot release, update resulted in git diffs to $PKGDIR_REL" + +git commit -m "Update package $PKG" + +( cd "$BUILDDIR" && dpkg-buildpackage -d -S --no-sign ) diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..9c15498 --- /dev/null +++ b/update.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +. ./vars.sh.frag + +if [ ! -d "$PKGDIR/debian" ]; then + mkdir -p "$PKGDIR/debian" + sed -e 's/^#overlay =/overlay =/' -e '/^#/d' "$DEBCARGO_GIT/debcargo.toml.example" > "$PKGCFG" + touch "$PKGDIR/debian/copyright" + git add "$PKGDIR" +fi + +rm -rf "$BUILDDIR" && mkdir -p "$(dirname $BUILDDIR)" +$DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" "$PKG" + +if ! git diff -q -- "$PKGDIR_REL"; then + read -p "Update wrote some changes to $PKGDIR_REL, press enter to git diff..." x + git diff -- "$PKGDIR_REL" +fi + +cat >&2 <&2 "$0: abort: $@"; exit "$x"; }