diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-09-03 21:14:56 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-09-04 11:53:20 +0100 |
commit | 5956c5a42e542cf4a81cda34722263dcd06b0f04 (patch) | |
tree | e512b2875d79c57dbc69c77f560382d6989b707b /dgit | |
parent | 615d3bcd66f597cbce84c746ce6862e0e173e8ce (diff) |
dgit push-*: Provide push-built; make push be an alias
No overall chagne in behaviour since in this commit the default
configuration is "built".
However, the documentation already anticipates the change to add the
warning.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -744,6 +744,7 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit.dsc-url-proto-ok.git' => 'true', 'dgit.vcs-git.suites', => 'sid', # ;-separated 'dgit.default.dsc-url-proto-ok' => 'false', + 'dgit.default.push-subcmd' => 'built', # old means "repo server accepts pushes with old dgit tags" # new means "repo server accepts pushes with new dgit tags" # maint means "repo server accepts split brain pushes" @@ -5083,11 +5084,31 @@ sub prep_push () { } } -sub cmd_push { +sub cmd_push_built { prep_push(); dopush(); } +sub cmd_push { + my $spec = cfg 'dgit.default.push-subcmd'; + + if ($spec eq 'source') { + cmd_push_source(); + } elsif ($spec eq 'built') { + cmd_push_built(); + } elsif ($spec eq 'warn,built') { + print STDERR __ <<'END'; +warning: "dgit push" currently means "dgit push-built" (by default) +warning: but is going to change to "dgit push-source". See dgit!(1). +END + cmd_push_built(); + } elsif ($spec eq 'reject') { + fail f_ 'dgit push, but dgit.default.push-subcmd set to %s', $spec; + } else { + fail f_ 'bad value for dgit.default.push-subcmd: %s', $spec; + } +} + #---------- remote commands' implementation ---------- sub pre_remote_push_build_host { @@ -5124,7 +5145,7 @@ sub pre_remote_push_build_host { } sub cmd_remote_push_build_host { responder_send_command("dgit-remote-push-ready $protovsn"); - &cmd_push; + &cmd_push_built; } sub pre_remote_push_responder { pre_remote_push_build_host(); } |