diff options
author | Niels Thykier <niels@thykier.net> | 2018-03-07 19:44:57 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2018-03-07 19:44:57 +0000 |
commit | 30ea2c148eb780c3bdbc2269348794c2ef27b80a (patch) | |
tree | f9a9bad329c1803333e62cadc7dd3eeb112ff2d0 /lib | |
parent | 7025d4f38f2d263634932cd5faf32442c41015f7 (diff) | |
download | debhelper-30ea2c148eb780c3bdbc2269348794c2ef27b80a.tar.gz |
Move sub from dh to D::DH::SequencerUtil
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Debian/Debhelper/SequencerUtil.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Debian/Debhelper/SequencerUtil.pm b/lib/Debian/Debhelper/SequencerUtil.pm index 859ee145..c0d047db 100644 --- a/lib/Debian/Debhelper/SequencerUtil.pm +++ b/lib/Debian/Debhelper/SequencerUtil.pm @@ -14,6 +14,7 @@ our @EXPORT = qw( to_rules_target unpack_sequence rules_explicit_target + extract_skipinfo DUMMY_TARGET ); @@ -128,4 +129,24 @@ sub rules_explicit_target { return $EXPLICIT_TARGETS{$target}; } +sub extract_skipinfo { + my ($command) = @_; + + foreach my $dir (split(':', $ENV{PATH})) { + if (open (my $h, "<", "$dir/$command")) { + while (<$h>) { + if (m/PROMISE: DH NOOP( WITHOUT\s+(.*))?\s*$/) { + close $h; + return split(' ', $2) if defined($2); + return ('always-skip'); + } + } + close $h; + return; + } + } + return; +} + + 1; |