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"