diff options
-rwxr-xr-x | dgit | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -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 |