summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-debpush38
1 files changed, 24 insertions, 14 deletions
diff --git a/git-debpush b/git-debpush
index 63057ed..c829579 100755
--- a/git-debpush
+++ b/git-debpush
@@ -63,6 +63,16 @@ get_file_from_ref () {
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:' \
@@ -177,22 +187,22 @@ trap - EXIT
# ---- 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