fi
}
+failed_check=false
+fail_check () {
+ if $force; then
+ echo >&2 "$us: warning: $*"
+ else
+ echo >&2 "$us: $*"
+ failed_check=true
+ fi
+}
+
# ---- Parse command line
getopt=$(getopt -s bash -o 'nfu:' \
# ---- Useful sanity checks
-if ! $force; then
-
- if [ "$target" = "UNRELEASED" ]; then
- fail "UNRELEASED changelog"
- fi
+if [ "$target" = "UNRELEASED" ]; then
+ fail_check "UNRELEASED changelog"
+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
- #
- # - walking backwards from $branch, if there is an archive/ strictly
- # before we reach most recent debian/ tag, error, this might be a
- # push of the dgit view to the maintainer branch
+# 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
+#
+# - walking backwards from $branch, if there is an archive/ strictly
+# before we reach most recent debian/ tag, error, this might be a
+# push of the dgit view to the maintainer branch
+if ! $force && $failed_check; then
+ fail "some checks failed; you can override with --force"
fi
# ---- Create the git tag