chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Copy debian/source/options into fake dsc
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index 6ca1f33b38fdfb8408d5bf88203ddcbb94bf32af..c1c8b6453206e1ec135907f0970716f8077c1bcf 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-1382,11
+1382,12
@@
sub generate_commit_from_dsc () {
my $f = $fi->{Filename};
die "$f ?" if $f =~ m#/|^\.|\.dsc$|\.tmp$#;
my $f = $fi->{Filename};
die "$f ?" if $f =~ m#/|^\.|\.dsc$|\.tmp$#;
- link "../../../$f", $f
+ link
_ltarget
"../../../$f", $f
or $!==&ENOENT
or die "$f $!";
or $!==&ENOENT
or die "$f $!";
- complete_file_from_dsc('.', $fi);
+ complete_file_from_dsc('.', $fi)
+ or next;
if (is_orig_file($f)) {
link $f, "../../../../$f"
if (is_orig_file($f)) {
link $f, "../../../../$f"
@@
-1481,10
+1482,10
@@
sub complete_file_from_dsc ($$) {
my $furl = $dscurl;
$furl =~ s{/[^/]+$}{};
$furl .= "/$f";
my $furl = $dscurl;
$furl =~ s{/[^/]+$}{};
$furl .= "/$f";
- die "$f ?" unless $f =~ m/^
${package}
_/;
+ die "$f ?" unless $f =~ m/^
\Q${package}\E
_/;
die "$f ?" if $f =~ m#/#;
runcmd_ordryrun_local @curl,qw(-o),$tf,'--',"$furl";
die "$f ?" if $f =~ m#/#;
runcmd_ordryrun_local @curl,qw(-o),$tf,'--',"$furl";
-
next
if !act_local();
+
return 0
if !act_local();
$downloaded = 1;
}
$downloaded = 1;
}
@@
-1498,13
+1499,16
@@
sub complete_file_from_dsc ($$) {
" demands hash $fi->{Hash} ".
($downloaded ? "(got wrong file from archive!)"
: "(perhaps you should delete this file?)");
" demands hash $fi->{Hash} ".
($downloaded ? "(got wrong file from archive!)"
: "(perhaps you should delete this file?)");
+
+ return 1;
}
sub ensure_we_have_orig () {
foreach my $fi (dsc_files_info()) {
my $f = $fi->{Filename};
next unless is_orig_file($f);
}
sub ensure_we_have_orig () {
foreach my $fi (dsc_files_info()) {
my $f = $fi->{Filename};
next unless is_orig_file($f);
- complete_file_from_dsc('..', $fi);
+ complete_file_from_dsc('..', $fi)
+ or next;
}
}
}
}
@@
-1757,6
+1761,10
@@
sub check_not_dirty () {
} else {
failedcmd @cmd;
}
} else {
failedcmd @cmd;
}
+
+ if (stat_exists "debian/source/local-options") {
+ fail "git tree contains debian/source/local-options";
+ }
}
sub commit_admin ($) {
}
sub commit_admin ($) {
@@
-1779,7
+1787,8
@@
sub commit_quilty_patch () {
progress "nothing quilty to commit, ok.";
return;
}
progress "nothing quilty to commit, ok.";
return;
}
- runcmd_ordryrun_local @git, qw(add), sort keys %adds;
+ my @adds = map { s/[][*?\\]/\\$&/g; $_; } sort keys %adds;
+ runcmd_ordryrun_local @git, qw(add -f), @adds;
commit_admin "Commit Debian 3.0 (quilt) metadata";
}
commit_admin "Commit Debian 3.0 (quilt) metadata";
}
@@
-2521,7
+2530,7
@@
sub quiltify ($$) {
remove_stray_gits();
mktree_in_ud_here();
rmtree '.pc';
remove_stray_gits();
mktree_in_ud_here();
rmtree '.pc';
- runcmd @git,
'add', '.'
;
+ runcmd @git,
qw(add -Af .)
;
my $oldtiptree=git_write_tree();
changedir '../work';
my $oldtiptree=git_write_tree();
changedir '../work';
@@
-2622,7
+2631,7
@@
sub quiltify ($$) {
my $abbrev = sub {
my $x = $_[0]{Commit};
$x =~ s/(.*?[0-9a-z]{8})[0-9a-z]*$/$1/;
my $abbrev = sub {
my $x = $_[0]{Commit};
$x =~ s/(.*?[0-9a-z]{8})[0-9a-z]*$/$1/;
- return $;
+ return $
x
;
};
my $reportnot = sub {
my ($notp) = @_;
};
my $reportnot = sub {
my ($notp) = @_;
@@
-2738,7
+2747,7
@@
sub build_maybe_quilt_fixup () {
# can work. We do this as follows:
# 1. Collect all relevant .orig from parent directory
# 2. Generate a debian.tar.gz out of
# can work. We do this as follows:
# 1. Collect all relevant .orig from parent directory
# 2. Generate a debian.tar.gz out of
- # debian/{patches,rules,source/format}
+ # debian/{patches,rules,source/format
,source/options
}
# 3. Generate a fake .dsc containing just these fields:
# Format Source Version Files
# 4. Extract the fake .dsc
# 3. Generate a fake .dsc containing just these fields:
# Format Source Version Files
# 4. Extract the fake .dsc
@@
-2794,13
+2803,14
@@
END
foreach my $f (<../../../../*>) { #/){
my $b=$f; $b =~ s{.*/}{};
next unless is_orig_file $b, srcfn $upstreamversion,'';
foreach my $f (<../../../../*>) { #/){
my $b=$f; $b =~ s{.*/}{};
next unless is_orig_file $b, srcfn $upstreamversion,'';
- link $f, $b or die "$b $!";
+ link
_ltarget
$f, $b or die "$b $!";
$dscaddfile->($b);
}
my @files=qw(debian/source/format debian/rules);
$dscaddfile->($b);
}
my @files=qw(debian/source/format debian/rules);
- if (stat_exists '../../../debian/patches') {
- push @files, 'debian/patches';
+ foreach my $maybe (qw(debian/patches debian/source/options)) {
+ next unless stat_exists "../../../$maybe";
+ push @files, $maybe;
}
my $debtar= srcfn $fakeversion,'.debian.tar.gz';
}
my $debtar= srcfn $fakeversion,'.debian.tar.gz';
@@
-3161,7
+3171,7
@@
sub parseopts () {
my ($what) = @_;
@rvalopts = ($_);
if (!defined $val) {
my ($what) = @_;
@rvalopts = ($_);
if (!defined $val) {
- badusage "$what needs a value" unless
length
@ARGV;
+ badusage "$what needs a value" unless @ARGV;
$val = shift @ARGV;
push @rvalopts, $val;
}
$val = shift @ARGV;
push @rvalopts, $val;
}
@@
-3246,9
+3256,6
@@
sub parseopts () {
push @ropts, $&;
push @changesopts, $_;
$_ = '';
push @ropts, $&;
push @changesopts, $_;
$_ = '';
- } elsif (m/^-[dCk]$/) {
- badusage
- "option \`$_' requires an argument (and no space before the argument)";
} elsif (s/^-wn$//s) {
push @ropts, $&;
$cleanmode = 'none';
} elsif (s/^-wn$//s) {
push @ropts, $&;
$cleanmode = 'none';