chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Print better error message (with `fail' rather than `die') if `dgit clone' cannot...
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 7b62a66f3a1279f4710fae3e9f5db1e1e77c35b6..9bdd2074b520d33ce14234d4e50e53971d4ebb27 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-75,7
+75,7
@@
our (@curl) = qw(curl -f);
our (@dput) = qw(dput);
our (@debsign) = qw(debsign);
our (@gpg) = qw(gpg);
our (@dput) = qw(dput);
our (@debsign) = qw(debsign);
our (@gpg) = qw(gpg);
-our (@sbuild) = qw(sbuild
-A
);
+our (@sbuild) = qw(sbuild);
our (@ssh) = 'ssh';
our (@dgit) = qw(dgit);
our (@dpkgbuildpackage) = qw(dpkg-buildpackage -i\.git/ -I.git);
our (@ssh) = 'ssh';
our (@dgit) = qw(dgit);
our (@dpkgbuildpackage) = qw(dpkg-buildpackage -i\.git/ -I.git);
@@
-155,7
+155,7
@@
END {
local ($?);
foreach my $f (@end) {
eval { $f->(); };
local ($?);
foreach my $f (@end) {
eval { $f->(); };
-
warn
"$us: cleanup: $@" if length $@;
+
print STDERR
"$us: cleanup: $@" if length $@;
}
};
}
};
@@
-1706,7
+1706,7
@@
sub clone ($) {
canonicalise_suite();
badusage "dry run makes no sense with clone" unless act_local();
my $hasgit = check_for_git();
canonicalise_suite();
badusage "dry run makes no sense with clone" unless act_local();
my $hasgit = check_for_git();
- mkdir $dstdir or
die "$dstdir
$!";
+ mkdir $dstdir or
fail "create \`$dstdir':
$!";
changedir $dstdir;
runcmd @git, qw(init -q);
my $giturl = access_giturl(1);
changedir $dstdir;
runcmd @git, qw(init -q);
my $giturl = access_giturl(1);
@@
-1751,7
+1751,14
@@
sub pull () {
}
sub check_not_dirty () {
}
sub check_not_dirty () {
+ foreach my $f (qw(local-options local-patch-header)) {
+ if (stat_exists "debian/source/$f") {
+ fail "git tree contains debian/source/$f";
+ }
+ }
+
return if $ignoredirty;
return if $ignoredirty;
+
my @cmd = (@git, qw(diff --quiet HEAD));
debugcmd "+",@cmd;
$!=0; $?=0; system @cmd;
my @cmd = (@git, qw(diff --quiet HEAD));
debugcmd "+",@cmd;
$!=0; $?=0; system @cmd;
@@
-1761,12
+1768,6
@@
sub check_not_dirty () {
} else {
failedcmd @cmd;
}
} else {
failedcmd @cmd;
}
-
- foreach my $f (qw(local-options local-patch-header)) {
- if (stat_exists "debian/source/$f") {
- fail "git tree contains debian/source/$f";
- }
- }
}
sub commit_admin ($) {
}
sub commit_admin ($) {
@@
-2130,7
+2131,13
@@
sub cmd_clone {
return if $!==&ENOENT;
die "chdir $cwd_remove: $!";
}
return if $!==&ENOENT;
die "chdir $cwd_remove: $!";
}
- rmtree($dstdir) or die "remove $dstdir: $!\n";
+ if (stat $dstdir) {
+ rmtree($dstdir) or die "remove $dstdir: $!\n";
+ } elsif (!grep { $! == $_ }
+ (ENOENT, ENOTDIR, EACCES, EPERM, ELOOP)) {
+ } else {
+ print STDERR "check whether to remove $dstdir: $!\n";
+ }
};
}
};
}
@@
-3139,7
+3146,7
@@
sub cmd_sbuild {
unlink $cf or fail "remove $cf: $!";
}
}
unlink $cf or fail "remove $cf: $!";
}
}
- runcmd_ordryrun_local @sbuild,
@ARGV, qw(-d), $isuite
, $dscfn;
+ runcmd_ordryrun_local @sbuild,
qw(-d), $isuite, @ARGV
, $dscfn;
my @changesfiles = glob $pat;
@changesfiles = sort {
($b =~ m/_source\.changes$/ <=> $a =~ m/_source\.changes$/)
my @changesfiles = glob $pat;
@changesfiles = sort {
($b =~ m/_source\.changes$/ <=> $a =~ m/_source\.changes$/)
@@
-3160,6
+3167,8
@@
sub cmd_quilt_fixup {
my $clogp = parsechangelog();
$version = getfield $clogp, 'Version';
$package = getfield $clogp, 'Source';
my $clogp = parsechangelog();
$version = getfield $clogp, 'Version';
$package = getfield $clogp, 'Source';
+ check_not_dirty();
+ clean_tree();
build_maybe_quilt_fixup();
}
build_maybe_quilt_fixup();
}