chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test suite: Add missing `chiark-utils-bin' to Test-Depends.
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 6f98813230a8a29db44564cc784bdeaf91e44f29..afe209e2f16fa61cf84828b689fc9021c6ab8672 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-30,6
+30,8
@@
use File::Path;
use File::Temp qw(tempdir);
use File::Basename;
use Dpkg::Version;
use File::Temp qw(tempdir);
use File::Basename;
use Dpkg::Version;
+use Dpkg::Compression;
+use Dpkg::Compression::Process;
use POSIX;
use IPC::Open2;
use Digest::SHA;
use POSIX;
use IPC::Open2;
use Digest::SHA;
@@
-1713,7
+1715,10
@@
sub prep_ud (;$) {
sub mktree_in_ud_here () {
runcmd qw(git init -q);
runcmd qw(git config gc.auto 0);
sub mktree_in_ud_here () {
runcmd qw(git init -q);
runcmd qw(git config gc.auto 0);
- foreach my $copy (qw(user.email user.name user.useConfigOnly)) {
+ foreach my $copy (qw(user.email user.name user.useConfigOnly
+ core.sharedRepository
+ core.compression core.looseCompression
+ core.bigFileThreshold core.fsyncObjectFiles)) {
my $v = $gitcfgs{local}{$copy};
next unless $v;
runcmd qw(git config), $copy, $_ foreach @$v;
my $v = $gitcfgs{local}{$copy};
next unless $v;
runcmd qw(git config), $copy, $_ foreach @$v;
@@
-2208,7
+2213,7
@@
sub generate_commits_from_dsc () {
!$? or failedcmd @tarcmd;
close $input or
!$? or failedcmd @tarcmd;
close $input or
- (@compr_cmd ?
failedcmd @compr_cmd
+ (@compr_cmd ?
($?==SIGPIPE || failedcmd @compr_cmd)
: die $!);
# finally, we have the results in "tarball", but maybe
# with the wrong permissions
: die $!);
# finally, we have the results in "tarball", but maybe
# with the wrong permissions
@@
-3377,6
+3382,7
@@
END
return;
}
my $af = ".git/info/attributes";
return;
}
my $af = ".git/info/attributes";
+ ensuredir '.git/info';
open GAO, "> $af.new" or die $!;
print GAO <<END or die $!;
* dgit-defuse-attrs
open GAO, "> $af.new" or die $!;
print GAO <<END or die $!;
* dgit-defuse-attrs
@@
-3495,6
+3501,7
@@
sub fork_for_multisuite ($) {
$before_fetch_merge->();
foreach my $tsuite (@suites[1..$#suites]) {
$before_fetch_merge->();
foreach my $tsuite (@suites[1..$#suites]) {
+ $tsuite =~ s/^-/$cbasesuite-/;
my $csubsuite = multisuite_suite_child($tsuite, \@mergeinputs,
sub {
@end = ();
my $csubsuite = multisuite_suite_child($tsuite, \@mergeinputs,
sub {
@end = ();
@@
-3609,6
+3616,9
@@
END
}
sub clone ($) {
}
sub clone ($) {
+ # in multisuite, returns twice!
+ # once in parent after first suite fetched,
+ # and then again in child after everything is finished
my ($dstdir) = @_;
badusage "dry run makes no sense with clone" unless act_local();
my ($dstdir) = @_;
badusage "dry run makes no sense with clone" unless act_local();
@@
-3620,7
+3630,7
@@
sub clone ($) {
printdebug "multi clone after fetch merge\n";
clone_set_head();
clone_finish($dstdir);
printdebug "multi clone after fetch merge\n";
clone_set_head();
clone_finish($dstdir);
-
exit 0
;
+
return
;
}
printdebug "clone main body\n";
}
printdebug "clone main body\n";
@@
-4883,7
+4893,7
@@
sub quiltify_trees_differ ($$;$$$) {
# a list of unrepresentable changes (removals of upstream files
# (as messages)
local $/=undef;
# a list of unrepresentable changes (removals of upstream files
# (as messages)
local $/=undef;
- my @cmd = (@git, qw(diff-tree -z));
+ my @cmd = (@git, qw(diff-tree -z
--no-renames
));
push @cmd, qw(--name-only) unless $unrepres;
push @cmd, qw(-r) if $finegrained || $unrepres;
push @cmd, $x, $y;
push @cmd, qw(--name-only) unless $unrepres;
push @cmd, qw(-r) if $finegrained || $unrepres;
push @cmd, $x, $y;
@@
-4902,16
+4912,23
@@
sub quiltify_trees_differ ($$;$$$) {
if ($unrepres) {
eval {
if ($unrepres) {
eval {
- die "not a plain file\n"
- unless $newmode =~ m/^
10
\d{4}$/ ||
- $oldmode =~ m/^
10
\d{4}$/;
+ die "not a plain file
or symlink
\n"
+ unless $newmode =~ m/^
(?:10|12)
\d{4}$/ ||
+ $oldmode =~ m/^
(?:10|12)
\d{4}$/;
if ($oldmode =~ m/[^0]/ &&
$newmode =~ m/[^0]/) {
if ($oldmode =~ m/[^0]/ &&
$newmode =~ m/[^0]/) {
- die "mode changed\n" if $oldmode ne $newmode;
+ # both old and new files exist
+ die "mode or type changed\n" if $oldmode ne $newmode;
+ die "modified symlink\n" unless $newmode =~ m/^10/;
+ } elsif ($oldmode =~ m/[^0]/) {
+ # deletion
+ die "deletion of symlink\n"
+ unless $oldmode =~ m/^10/;
} else {
} else {
- die "non-default mode\n"
- unless $newmode =~ m/^100644$/ ||
- $oldmode =~ m/^100644$/;
+ # creation
+ die "creation with non-default mode\n"
+ unless $newmode =~ m/^100644$/ or
+ $newmode =~ m/^120000$/;
}
};
if ($@) {
}
};
if ($@) {
@@
-5266,6
+5283,7
@@
sub quiltify ($$$$) {
die "contains unexpected slashes\n" if m{//} || m{/$};
die "contains leading punctuation\n" if m{^\W} || m{/\W};
die "contains bad character(s)\n" if m{[^-a-z0-9_.+=~/]}i;
die "contains unexpected slashes\n" if m{//} || m{/$};
die "contains leading punctuation\n" if m{^\W} || m{/\W};
die "contains bad character(s)\n" if m{[^-a-z0-9_.+=~/]}i;
+ die "is series file\n" if m{$series_filename_re}o;
die "too long" if length > 200;
};
return $_ unless $@;
die "too long" if length > 200;
};
return $_ unless $@;
@@
-5304,6
+5322,7
@@
sub quiltify ($$$$) {
$patchname =~ y/-a-z0-9_.+=~//cd;
$patchname =~ s/^\W/x-$&/;
$patchname = substr($patchname,0,40);
$patchname =~ y/-a-z0-9_.+=~//cd;
$patchname =~ s/^\W/x-$&/;
$patchname = substr($patchname,0,40);
+ $patchname .= ".patch";
}
if (!defined $patchdir) {
$patchdir = '';
}
if (!defined $patchdir) {
$patchdir = '';
@@
-6339,7
+6358,10
@@
END
foreach my $fi (@dfi) {
my $f = $fi->{Filename};
my $here = "../$f";
foreach my $fi (@dfi) {
my $f = $fi->{Filename};
my $here = "../$f";
- next if lstat $here;
+ if (lstat $here) {
+ next if stat $here;
+ fail "lstat $here works but stat gives $! !";
+ }
fail "stat $here: $!" unless $! == ENOENT;
my $there = $dscfn;
if ($dscfn =~ m#^(?:\./+)?\.\./+#) {
fail "stat $here: $!" unless $! == ENOENT;
my $there = $dscfn;
if ($dscfn =~ m#^(?:\./+)?\.\./+#) {
@@
-6350,8
+6372,10
@@
END
fail "cannot import $dscfn which seems to be inside working tree!";
}
$there =~ s#/+[^/]+$## or
fail "cannot import $dscfn which seems to be inside working tree!";
}
$there =~ s#/+[^/]+$## or
- fail "
cannot import $dscfn which seems to not have a basename
";
+ fail "
import $dscfn requires ../$f, but it does not exist
";
$there .= "/$f";
$there .= "/$f";
+ my $test = $there =~ m{^/} ? $there : "../$there";
+ stat $test or fail "import $dscfn requires $test, but: $!";
symlink $there, $here or fail "symlink $there to $here: $!";
progress "made symlink $here -> $there";
# print STDERR Dumper($fi);
symlink $there, $here or fail "symlink $there to $here: $!";
progress "made symlink $here -> $there";
# print STDERR Dumper($fi);