# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
+$SIG{__WARN__} = sub { die $_[0]; };
use IO::Handle;
use Data::Dumper;
our $keyid;
-our $debug = 0;
-open DEBUG, ">/dev/null" or die $!;
-
autoflush STDOUT 1;
our $remotename = 'dgit';
}
our $us = 'dgit';
-our $debugprefix = '';
+initdebug('');
our @end;
END {
}
}
-sub printdebug { print DEBUG $debugprefix, @_ or die $!; }
-
sub fail {
my $s = "@_\n";
my $prefix = $us.($we_are_responder ? " (build host)" : "").": ";
our ($dscdata,$dscurl,$dsc,$dsc_checked,$skew_warning_vsn);
-sub shellquote {
- my @out;
- local $_;
- foreach my $a (@_) {
- $_ = $a;
- if (m{[^-=_./0-9a-z]}i) {
- s{['\\]}{'\\$&'}g;
- push @out, "'$_'";
- } else {
- push @out, $_;
- }
- }
- return join ' ', @out;
-}
-
-sub printcmd {
- my $fh = shift @_;
- my $intro = shift @_;
- print $fh $intro," " or die $!;
- print $fh shellquote @_ or die $!;
- print $fh "\n" or die $!;
-}
-
sub failedcmd {
{ local ($!); printcmd \*STDERR, "$us: failed command:", @_ or die $!; };
if ($!) {
'dgit.default.ssh' => 'ssh',
'dgit.default.archive-query' => 'madison:',
'dgit.default.sshpsql-dbname' => 'service=projectb',
- 'dgit-distro.debian.archive-query' => 'sshpsql:',
+ 'dgit-distro.debian.archive-query' => 'ftpmasterapi:',
'dgit-distro.debian.git-host' => 'dgit-git.debian.net',
'dgit-distro.debian.git-user-force' => 'dgit',
'dgit-distro.debian.git-proto' => 'git+ssh://',
'dgit-distro.debian/alioth.git-proto' => 'git+ssh://',
'dgit-distro.debian/alioth.git-path' => '/git/dgit-repos/repos',
'dgit-distro.debian/alioth.git-create' => 'ssh-cmd',
- 'dgit-distro.debian.sshpsql-host' => 'mirror.ftp-master.debian.org',
'dgit-distro.debian.upload-host' => 'ftp-master', # for dput
'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/',
'dgit-distro.debian.backports-quirk' => '(squeeze)-backports*',
'dgit-distro.test-dummy.git-url' => "$td/git",
'dgit-distro.test-dummy.git-host' => "git",
'dgit-distro.test-dummy.git-path' => "$td/git",
- 'dgit-distro.test-dummy.archive-query' => "dummycat:$td/aq",
+ 'dgit-distro.test-dummy.archive-query' => "ftpmasterapi:",
+ 'dgit-distro.test-dummy.archive-query-url' => "file://$td/aq/",
'dgit-distro.test-dummy.mirror' => "file://$td/mirror/",
'dgit-distro.test-dummy.upload-host' => 'test-dummy',
);
my @cmd = (@git, qw(config --), $c);
my $v;
{
- local ($debug) = $debug-1;
+ local ($Debian::Dgit::debug) = $debug-1;
+ *debug = *Debian::Dgit::debug; # nnng
$v = cmdoutput_errok @cmd;
};
if ($?==0) {
my $component = "$entry->{component}";
$component =~ m/^$component_re$/ or die "bad component";
my $filename = "$entry->{filename}";
- $filename && $filename !~ m#[^-+:._0-9a-zA-Z/]|^[/.]|/[/.]#
+ $filename && $filename !~ m#[^-+:._~0-9a-zA-Z/]|^[/.]|/[/.]#
or die "bad filename";
my $sha256sum = "$entry->{sha256sum}";
$sha256sum =~ m/^[0-9a-f]+$/ or die "bad sha256sum";
my @rows;
my @cmd = (access_cfg_ssh, $userhost,
access_runeinfo("ssh-psql $runeinfo").
- " export LANG=C;".
+ " export LC_MESSAGES=C; export LC_CTYPE=C;".
" ".shellquote qw(psql -A), $dbname, qw(-c), $sql);
printcmd(\*DEBUG,$debugprefix."|",@cmd) if $debug>0;
open P, "-|", @cmd or die $!;
}
fetch_from_archive() or no_such_package;
my $vcsgiturl = $dsc->{'Vcs-Git'};
- $vcsgiturl =~ s/\s+-b\s+\S+//g;
if (length $vcsgiturl) {
+ $vcsgiturl =~ s/\s+-b\s+\S+//g;
runcmd @git, qw(remote add vcs-git), $vcsgiturl;
}
runcmd @git, qw(reset --hard), lrref();
cmd_help();
} elsif (s/^-D/-/) {
push @ropts, $&;
- open DEBUG, ">&STDERR" or die $!;
- autoflush DEBUG 1;
$debug++;
+ enabledebug();
} elsif (s/^-N/-/) {
push @ropts, $&;
$new_package=1;