open DEBUG, ">/dev/null" or die $!;
our $remotename = 'dgit';
-our $ourdscfield = 'Vcs-Dgit-Master';
+our @ourdscfield = qw(Dgit Vcs-Dgit-Master);
our $branchprefix = 'dgit';
our $csuite;
'dgit-distro.debian.sshdakls-host' => 'coccia.debian.org',
'dgit-distro.debian.sshdakls-dir' =>
'/srv/ftp-master.debian.org/ftp/dists',
- 'dgit-distro.debian.mirror' => 'http://http.debian.net/debian/');
+ 'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/');
sub cfg {
foreach my $c (@_) {
$dirs[0] =~ m#^([^/]+)/\.$# or die;
my $dir = $1;
chdir $dir or die "$dir $!";
- die if stat '.git';
+ fail "source package contains .git directory" if stat '.git';
die $! unless $!==&ENOENT;
runcmd qw(git init -q);
rmtree('.git/objects');
$later_warning_msg
END
$outputhash = $upload_hash;
- } elsif ($outputhash ne $upload_hash) {
- fail "version in archive ($cversion)".
- " is same as version in git".
- " to-be-uploaded (upload/) branch ($oversion)".
- " but archive version hash no commit hash?!";
- }
+ } else {
+ $outputhash = $upload_hash;
+ }
}
chdir '../../../..' or die $!;
runcmd @git, qw(update-ref -m),"dgit fetch import $cversion",
# ensures that lrref() is what is actually in the archive,
# one way or another
get_archive_dsc() or return 0;
- $dsc_hash = $dsc->{$ourdscfield};
+ foreach my $field (@ourdscfield) {
+ $dsc_hash = $dsc->{$field};
+ last if defined $dsc_hash;
+ }
if (defined $dsc_hash) {
$dsc_hash =~ m/\w+/ or fail "invalid hash in .dsc \`$dsc_hash'";
$dsc_hash = $&;
# runcmd @git, qw(fetch -p ), "$alioth_git/$package.git",
# map { lref($_).":".rref($_) }
# (uploadbranch());
- $dsc->{$ourdscfield} = rev_parse('HEAD');
+ $dsc->{$ourdscfield[0]} = rev_parse('HEAD');
$dsc->save("../$dscfn.tmp") or die $!;
if (!$changesfile) {
my $multi = "../${package}_${cversion}_multi.changes";
($changesfile) = @cs;
}
}
+ my $changes = parsecontrol($changesfile,$changesfile);
+ foreach my $field (qw(Source Distribution Version)) {
+ $changes->{$field} eq $clogp->{$field} or
+ fail "changes field $field \`$changes->{$field}'".
+ " does not match changelog \`$clogp->{$field}'";
+ }
my $tag = debiantag($dversion);
if (!check_for_git()) {
create_remote_git_repo();
local $ENV{$fakeeditorenv} = cmdoutput qw(realpath --), $descfn;
runcmd_ordryrun @dpkgsource, qw(--commit .), $patchname;
}
+
+ if (!open P, '>>', ".pc/applied-patches") {
+ $!==&ENOENT or die $!;
+ } else {
+ close P;
+ }
+
commit_quilty_patch();
}
check_not_dirty();
my $clogp = parsechangelog();
$package = getfield $clogp, 'Source';
- my $isuite = getfield $clogp, 'Distribution';
+ $isuite = getfield $clogp, 'Distribution';
$version = getfield $clogp, 'Version';
$sourcechanges = "${package}_${version}_source.changes";
$dscfn = dscfn($version);