X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=61a1f73007a5e94ba5ff706d2347bf37368e3343;hp=94b9ab16d287592a9a808d695e7c413524e77011;hb=111b247b6198535db5788a07069971e409f539cd;hpb=82fe8098ed0b3749821190dfcbb0062947bd024b diff --git a/dgit b/dgit index 94b9ab16..61a1f730 100755 --- a/dgit +++ b/dgit @@ -332,7 +332,7 @@ sub printcmd { } sub failedcmd { - { local ($!); printcmd \*STDERR, "$_[0]: failed command:", @_ or die $!; }; + { local ($!); printcmd \*STDERR, "$us: failed command:", @_ or die $!; }; if ($!) { fail "failed to fork/exec: $!"; } elsif (!($? & 0xff)) { @@ -448,11 +448,12 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit.default.username' => '', 'dgit.default.archive-query-default-component' => 'main', 'dgit.default.ssh' => 'ssh', + 'dgit-distro.debian.git-user' => 'dgit', 'dgit-distro.debian.git-host' => 'git.debian.org', 'dgit-distro.debian.git-proto' => 'git+ssh://', - 'dgit-distro.debian.git-path' => '/git/dgit-repos/repos', - 'dgit-distro.debian.git-check' => 'ssh-cmd', - 'dgit-distro.debian.git-create' => 'ssh-cmd', + 'dgit-distro.debian.git-path' => '/dgit-repos/', + 'dgit-distro.debian.git-check' => 'true', + 'dgit-distro.debian.git-create' => 'true', 'dgit-distro.debian.sshpsql-host' => 'coccia.debian.org', 'dgit-distro.debian.sshpsql-dbname' => 'service=projectb', 'dgit-distro.debian.upload-host' => 'ftp-master', # for dput @@ -469,6 +470,14 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit-distro.test-dummy.archive-query' => "dummycat:$td/aq", 'dgit-distro.test-dummy.mirror' => "file://$td/mirror/", 'dgit-distro.test-dummy.upload-host' => 'test-dummy', + 'dgit-distro.test-dummy-drs.ssh' => "$td/ssh", + 'dgit-distro.test-dummy-drs.username' => "alice", + 'dgit-distro.test-dummy-drs.git-check' => "true", + 'dgit-distro.test-dummy-drs.git-create' => "true", + 'dgit-distro.test-dummy-drs.git-url' => "$td/git", + 'dgit-distro.test-dummy-drs.archive-query' => "dummycat:$td/aq", + 'dgit-distro.test-dummy-drs.mirror' => "file://$td/mirror/", + 'dgit-distro.test-dummy-drs.upload-host' => 'test-dummy', ); sub cfg { @@ -837,6 +846,8 @@ sub check_for_git () { my $r= cmdoutput @cmd; failedcmd @cmd unless $r =~ m/^[01]$/; return $r+0; + } elsif ($how eq 'true') { + return 1; } else { badcfg "unknown git-check \`$how'"; } @@ -849,6 +860,8 @@ sub create_remote_git_repo () { (access_cfg_ssh, access_gituserhost(), "set -e; cd ".access_cfg('git-path').";". " cp -a _template $package.git"); + } elsif ($how eq 'true') { + # nothing to do } else { badcfg "unknown git-create \`$how'"; } @@ -1430,27 +1443,24 @@ sub dopush () { if (!check_for_git()) { create_remote_git_repo(); } - runcmd_ordryrun @git, qw(push),access_giturl(),"HEAD:".rrref(); + runcmd_ordryrun @git, qw(push),access_giturl(), + "HEAD:".rrref(), "refs/tags/$tag"; runcmd_ordryrun @git, qw(update-ref -m), 'dgit push', lrref(), 'HEAD'; - if (!$we_are_responder) { - if (act_local()) { - rename "$dscpath.tmp",$dscpath or die "$dscfn $!"; - } else { - progress "[new .dsc left in $dscpath.tmp]"; - } - } - if ($we_are_responder) { my $dryrunsuffix = act_local() ? "" : ".tmp"; responder_receive_files('signed-dsc-changes', "$dscpath$dryrunsuffix", "$changesfile$dryrunsuffix"); } else { + if (act_local()) { + rename "$dscpath.tmp",$dscpath or die "$dscfn $!"; + } else { + progress "[new .dsc left in $dscpath.tmp]"; + } sign_changes $changesfile; } - runcmd_ordryrun @git, qw(push),access_giturl(),"refs/tags/$tag"; my $host = access_cfg('upload-host','RETURN-UNDEF'); my @hostarg = defined($host) ? ($host,) : (); runcmd_ordryrun @dput, @hostarg, $changesfile;