diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-12-27 17:35:47 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-12-28 12:07:44 +0000 |
commit | 1487f0e51156dedc0121f5e17d6d7cf6f3a19b2f (patch) | |
tree | afce5aa13b7438366738c10b313ad54fc8c36e4b /infra | |
parent | 6947c7d17d781b0c9c33e09055bc8912219c667e (diff) |
dgit-repos-policy-debian: package_questionable_head_msg: break out
We're going to want to reuse this.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'infra')
-rwxr-xr-x | infra/dgit-repos-policy-debian | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index f110fa3..cb69211 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -312,14 +312,34 @@ sub getpushinfo () { sub deliberately ($) { return $deliberately{"--deliberately-$_[0]"}; } +sub package_questionable_head_msg () { + return undef unless $pkg_exists; + return undef unless $pkg_secret; + # TODO: ideally this would be translated at the client end but + # that would involve marking it i_ here (which is part of + # dgit-intrastructure.deb) and then having the string appear in + # the po for dgit.deb. + return <<END; +Package is in NEW and has not been accepted or rejected yet. +Unfortunately, we cannot determine automatically what should happen. +You will have to pass either --deliberately-not-fast-forward or +--deliberately-include-questionable-history to specify whether you are +keeping or discarding the previously pushed history. + +The choice is important, to ensure that your git history is both +suitable for public distribution and as useful as possible. Please +see the descriptions of these options in dgit(1). +END +} + sub action_push () { getpackage(); getpushinfo(); check_package(); # might make package public, or might add taints - return 0 unless $pkg_exists; - return 0 unless $pkg_secret; + my $questionable_head_msg = package_questionable_head_msg(); + return 0 unless defined $questionable_head_msg; # we suppose that NEW has a version which is already in our # history, as otherwise the repo would have been blown away @@ -334,19 +354,7 @@ sub action_push () { if (deliberately('include-questionable-history')) { return 0; } - die <<END; - -Package is in NEW and has not been accepted or rejected yet. -Unfortunately, we cannot determine automatically what should happen. -You will have to pass either --deliberately-not-fast-forward or ---deliberately-include-questionable-history to specify whether you are -keeping or discarding the previously pushed history. - -The choice is important, to ensure that your git history is both -suitable for public distribution and as useful as possible. Please -see the descriptions of these options in dgit(1). - -END + die "\n". $questionable_head_msg. "\n"; } sub action_push_confirm () { |