summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-08-21 10:37:11 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-08-21 11:11:04 +0100
commitd88139021717eeb85131c1e62b23bfb8ec1ca6c5 (patch)
treec528b9145ae7ec2ec7a2b38e40ee0dbfa948ea4c
parent38d77cdb611b6a8d0a719ce50e9fc57562c0d085 (diff)
get_source_format returns the debian/source/options, too (nfc since no users yet)
-rwxr-xr-xdgit26
1 files changed, 23 insertions, 3 deletions
diff --git a/dgit b/dgit
index c1c8b64..d6f37ff 100755
--- a/dgit
+++ b/dgit
@@ -1246,7 +1246,7 @@ sub mktree_in_ud_from_only_subdir () {
remove_stray_gits();
mktree_in_ud_here();
- my $format=get_source_format();
+ my ($format, $fopts) = get_source_format();
if (madformat($format)) {
rmtree '.pc';
}
@@ -1793,6 +1793,26 @@ sub commit_quilty_patch () {
}
sub get_source_format () {
+ my %options;
+ if (open F, "debian/source/options") {
+ while (<F>) {
+ next if m/^\s*\#/;
+ next unless m/\S/;
+ s/\s+$//; # ignore missing final newline
+ if (m/\s*\#\s*/) {
+ my ($k, $v) = ($`, $'); #');
+ $v =~ s/^"(.*)"$/$1/;
+ $options{$k} = $v;
+ } else {
+ $options{$_} = 1;
+ }
+ }
+ F->error and die $!;
+ close F;
+ } else {
+ die $! unless $!==&ENOENT;
+ }
+
if (!open F, "debian/source/format") {
die $! unless $!==&ENOENT;
return '';
@@ -1800,7 +1820,7 @@ sub get_source_format () {
$_ = <F>;
F->error and die $!;
chomp;
- return $_;
+ return ($_, \%options);
}
sub madformat ($) {
@@ -2718,7 +2738,7 @@ sub quiltify ($$) {
}
sub build_maybe_quilt_fixup () {
- my $format=get_source_format;
+ my ($format,$fopts) = get_source_format;
return unless madformat $format;
# sigh