chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Autogenerated quilt patch fixup patch Description contains several recent git commits...
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 406589a8eb654e3d2a6446dbf4234577a133dba2..0adf30224df5d4c34d6e5f3647d6d9beb7534b10 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-68,7
+68,7
@@
our $debug = 0;
open DEBUG, ">/dev/null" or die $!;
our $remotename = 'dgit';
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;
our $branchprefix = 'dgit';
our $csuite;
@@
-236,7
+236,7
@@
our %defcfg = ('dgit.default.distro' => 'debian',
'dgit-distro.debian.sshdakls-host' => 'coccia.debian.org',
'dgit-distro.debian.sshdakls-dir' =>
'/srv/ftp-master.debian.org/ftp/dists',
'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 (@_) {
sub cfg {
foreach my $c (@_) {
@@
-488,7
+488,7
@@
sub mktree_in_ud_from_only_subdir () {
$dirs[0] =~ m#^([^/]+)/\.$# or die;
my $dir = $1;
chdir $dir or die "$dir $!";
$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');
die $! unless $!==&ENOENT;
runcmd qw(git init -q);
rmtree('.git/objects');
@@
-591,12
+591,9
@@
Last allegedly pushed/uploaded: $oversion (newer or same)
$later_warning_msg
END
$outputhash = $upload_hash;
$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",
}
chdir '../../../..' or die $!;
runcmd @git, qw(update-ref -m),"dgit fetch import $cversion",
@@
-644,7
+641,10
@@
sub fetch_from_archive () {
# ensures that lrref() is what is actually in the archive,
# one way or another
get_archive_dsc() or return 0;
# 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 = $&;
if (defined $dsc_hash) {
$dsc_hash =~ m/\w+/ or fail "invalid hash in .dsc \`$dsc_hash'";
$dsc_hash = $&;
@@
-763,7
+763,7
@@
sub commit_quilty_patch () {
my $bad=0;
foreach my $l (split /\n/, $output) {
next unless $l =~ m/\S/;
my $bad=0;
foreach my $l (split /\n/, $output) {
next unless $l =~ m/\S/;
- if ($l =~ m{^
\?\?
(.pc|debian/patches)}) {
+ if ($l =~ m{^
(?:\?\?| M)
(.pc|debian/patches)}) {
$adds{$1}++;
} else {
print STDERR "git status: $l\n";
$adds{$1}++;
} else {
print STDERR "git status: $l\n";
@@
-832,7
+832,7
@@
sub dopush () {
# runcmd @git, qw(fetch -p ), "$alioth_git/$package.git",
# map { lref($_).":".rref($_) }
# (uploadbranch());
# 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";
$dsc->save("../$dscfn.tmp") or die $!;
if (!$changesfile) {
my $multi = "../${package}_${cversion}_multi.changes";
@@
-992,18
+992,23
@@
sub build_maybe_quilt_fixup () {
chomp;
return unless madformat($_);
# sigh
chomp;
return unless madformat($_);
# sigh
+ my $clogp = parsechangelog();
+ my $version = getfield $clogp, 'Version';
+ my $author = getfield $clogp, 'Maintainer';
my $headref = rev_parse('HEAD');
my $time = time;
my $headref = rev_parse('HEAD');
my $time = time;
+ my $ncommits = 3;
my $patchname = "auto-$version-$headref-$time";
my $patchname = "auto-$version-$headref-$time";
- my $author = cmdoutput @git, qw(log -n1), '--pretty=format:%an <%ae>';
- my $msg = cmdoutput @git, qw(log -n1), "--pretty=format:%s\n%b";
+ my $msg = cmdoutput @git, qw(log), "-n$ncommits";
my $descfn = ".git/dgit/quilt-description.tmp";
open O, '>', $descfn or die "$descfn: $!";
$msg =~ s/\n/\n /g;
$msg =~ s/^\s+$/ ./mg;
print O <<END or die $!;
my $descfn = ".git/dgit/quilt-description.tmp";
open O, '>', $descfn or die "$descfn: $!";
$msg =~ s/\n/\n /g;
$msg =~ s/^\s+$/ ./mg;
print O <<END or die $!;
-Description: $msg
- [generated from git commit $headref]
+Description: Automatically generated patch ($clogp->{Version})
+ Last (up to) $ncommits git changes, FYI:
+ .
+ $msg
Author: $author
---
Author: $author
---
@@
-1016,6
+1021,13
@@
END
local $ENV{$fakeeditorenv} = cmdoutput qw(realpath --), $descfn;
runcmd_ordryrun @dpkgsource, qw(--commit .), $patchname;
}
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();
}
commit_quilty_patch();
}
@@
-1064,7
+1076,7
@@
sub build_source {
check_not_dirty();
my $clogp = parsechangelog();
$package = getfield $clogp, 'Source';
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);
$version = getfield $clogp, 'Version';
$sourcechanges = "${package}_${version}_source.changes";
$dscfn = dscfn($version);