From: Sean Whitton Date: Wed, 17 Jul 2019 07:51:27 +0000 (+0100) Subject: git-debpush: check for target suite change since last upload X-Git-Tag: archive/debian/9.3~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ac981dd92158727ad37f82d4b609c498539b848a;p=dgit.git git-debpush: check for target suite change since last upload Signed-off-by: Sean Whitton --- diff --git a/git-debpush b/git-debpush index 6c419086..03fc9ce7 100755 --- a/git-debpush +++ b/git-debpush @@ -220,11 +220,20 @@ if ! [ "x$last_debian_tag" = "x" ] && ! [ "x$last_archive_tag" = "x" ]; then fi fi -# TODO additional checks we might do: -# -# - are we uploading to a different suite from the last tag -# (e.g. unstable after experimental)? user should pass option to -# confirm +if ! [ "x$last_debian_tag" = "x" ]; then + temp=$(mktemp -d) + trap cleanup EXIT + mkdir "$temp/debian" + git cat-file blob "$last_debian_tag":debian/changelog >"$temp/debian/changelog" + prev_target=$(cd $temp; dpkg-parsechangelog -SDistribution) + rm -rf "$temp" + trap - EXIT + + if ! [ "$prev_target" = "$target" ] && ! [ "$target" = "UNRELEASED" ]; then + fail_check \ +"last upload targeted $prev_target, now targeting $target; might be a mistake?" + fi +fi if ! $force && $failed_check; then fail "some checks failed; you can override with --force"