summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-07-17 08:51:27 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-17 14:12:27 +0100
commitac981dd92158727ad37f82d4b609c498539b848a (patch)
tree7bb7c6bbdd4034352772fb9bf552cc2b37c34be1
parentfe4db08ba7454c40721c80e05d94f4b8532ce73f (diff)
git-debpush: check for target suite change since last upload
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rwxr-xr-xgit-debpush19
1 files changed, 14 insertions, 5 deletions
diff --git a/git-debpush b/git-debpush
index 6c41908..03fc9ce 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"