diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2014-10-27 17:46:11 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2014-11-08 16:07:56 +0000 |
commit | e41608c3549b3e34839ad15b2e29607794c1ccd6 (patch) | |
tree | 44204b617aaa8583c35be20a9ef2341472a701af /dgit | |
parent | ece82c50afff320eaf1cd09ba540e10f24984b60 (diff) |
Break out get_source_format (nfc)
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -1389,6 +1389,17 @@ sub commit_quilty_patch () { commit_admin "Commit Debian 3.0 (quilt) metadata"; } +sub get_source_format () { + if (!open F, "debian/source/format") { + die $! unless $!==&ENOENT; + return ''; + } + $_ = <F>; + F->error and die $!; + chomp; + return $_; +} + sub madformat ($) { my ($format) = @_; return 0 unless $format eq '3.0 (quilt)'; @@ -1947,14 +1958,8 @@ our $dscfn; our $fakeeditorenv = 'DGIT_FAKE_EDITOR_QUILT'; sub build_maybe_quilt_fixup () { - if (!open F, "debian/source/format") { - die $! unless $!==&ENOENT; - return; - } - $_ = <F>; - F->error and die $!; - chomp; - return unless madformat($_); + my $format=get_source_format; + return unless madformat $format; # sigh my @cmd = (@git, qw(ls-files --exclude-standard -iodm)); |