#!/bin/sh . ./vars.sh.frag case "$(git rev-parse --abbrev-ref HEAD)" in pending-*) abort 1 "You are on a pending-release branch, $0 can only be run on another branch, like master";; esac if [ -n "$VER" ]; then if [ ! -d "$PWD/src/$PKGBASE" ]; then abort 1 "Using crate $CRATE with version $VER but default-version is not packaged." \ "Package that first by running this script without the explicit version." fi fi if [ ! -d "$PKGDIR/debian" ]; then mkdir -p "$PKGDIR/debian" cat <<-eof > "$PKGCFG" overlay = "." uploaders = ["$DEBFULLNAME <$DEBEMAIL>"] eof git add "$PKGDIR" fi if [ ! -f "$PKGDIR/debian/copyright" ]; then cat <<-eof > "$PKGDIR/debian/copyright" FIXME fill me in using ./copyright.debcargo.hint as a guide eof fi if [ -n "$VER" -a "$(sed -ne 's/^semver_suffix\s*=\s*//p' "$PKGCFG")" != "true" ]; then if grep -q semver_suffix "$PKGCFG"; then sed -i -e 's/^\(semver_suffix\s*=\s*\).*/\1true/' "$PKGCFG" else sed -i -e '1isemver_suffix = true' "$PKGCFG" fi fi if ! grep -q uploaders "$PKGCFG"; then # try to auto-fill in uploaders if debcargo.toml doesn't have it uploader="$(egrep -A1 "[0-9][0-9]*( Debian)? Rust Maintainers" "$PKGDIR/debian/copyright" | tail -n1 | sed -re 's/^\s*[0-9]+\s*//g')" sed -i -e 's/^\(overlay.*\)$/\1\nuploaders = ["'"$uploader"'"]/' "$PKGCFG" if [ "$uploader" != "$DEBFULLNAME <$DEBEMAIL>" ]; then echo >&2 "$0: Auto-added $uploader to uploaders in debcargo.toml, based on d/copyright" read >&2 -p "$0: You may also want to add yourself; ctrl-c if you want to do that, or press enter to continue... " x fi fi run_debcargo if ! git diff --quiet -- "$PKGDIR_REL"; then read -p "Update wrote some changes to $PKGDIR_REL, press enter to git diff..." x || true git diff -- "$PKGDIR_REL" echo >&2 "-- end of git diff --" fi cat >&2 <&2 <