X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=9ce797200102205a4dc2f566cdd6faf281ab00ae;hp=3420d5ca9715ebf26a6b4eeebf9d0c5e4aba45ca;hb=54a18d290527b6aa515592d27f90f35187757e8c;hpb=58c8f2001ffd3e7525c719d2b11197d96cf23785 diff --git a/dgit b/dgit index 3420d5ca..9ce79720 100755 --- a/dgit +++ b/dgit @@ -2,7 +2,8 @@ # dgit # Integration between git and Debian-style archives # -# Copyright (C)2013-2016 Ian Jackson +# Copyright (C)2013-2017 Ian Jackson +# Copyright (C)2017 Sean Whitton # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -152,6 +153,7 @@ sub parseopts_late_defaults(); sub setup_gitattrs(;$); sub check_gitattrs($$); +our $playground; our $keyid; autoflush STDOUT 1; @@ -540,6 +542,7 @@ main usages: dgit [dgit-opts] build [dpkg-buildpackage-opts] dgit [dgit-opts] sbuild [sbuild-opts] dgit [dgit-opts] push [dgit-opts] [suite] + dgit [dgit-opts] push-source [dgit-opts] [suite] dgit [dgit-opts] rpush build-host:build-dir ... important dgit options: -k sign tag and package with instead of default @@ -1681,7 +1684,7 @@ our ($dsc_distro, $dsc_hint_tag, $dsc_hint_url); sub prep_ud () { dgit_privdir(); # ensures that $dgit_privdir_made is based on $maindir - fresh_playground 'dgit/unpack'; + $playground = fresh_playground 'dgit/unpack'; } sub mktree_in_ud_here () { @@ -4592,6 +4595,21 @@ sub cmd_push { dopush(); } +sub cmd_push_source { + prep_push(); + if ($changesfile) { + my $changes = parsecontrol("$buildproductsdir/$changesfile", + "source changes file"); + unless (test_source_only_changes($changes)) { + fail "user-specified changes file is not source-only"; + } + } else { + # Building a source package is very fast, so just do it + build_source_for_push(); + } + dopush(); +} + #---------- remote commands' implementation ---------- sub pre_remote_push_build_host { @@ -6177,6 +6195,12 @@ sub cmd_gbp_build { } sub cmd_git_build { cmd_gbp_build(); } # compatibility with <= 1.0 +sub build_source_for_push { + build_source(); + maybe_unapply_patches_again(); + $changesfile = $sourcechanges; +} + sub build_source { build_prep_early(); build_prep(); @@ -6433,6 +6457,7 @@ sub pre_archive_api_query () { sub cmd_archive_api_query { badusage "need only 1 subpath argument" unless @ARGV==1; my ($subpath) = @ARGV; + local $isuite = 'DGIT-API-QUERY-CMD'; my @cmd = archive_api_query_cmd($subpath); push @cmd, qw(-f); debugcmd ">",@cmd;