[lintian] 01/02: c/deb-format: Replace a use of spawn with safe_qx
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 6a369c4914a19bad6d15bcc76dd370df43cb5a0e
Author: Niels Thykier <niels@thykier.net>
Date: Tue Oct 11 18:04:57 2016 +0000
c/deb-format: Replace a use of spawn with safe_qx
Signed-off-by: Niels Thykier <niels@thykier.net>
---
checks/deb-format.pm | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/checks/deb-format.pm b/checks/deb-format.pm
index e0b750a..13b31f6 100644
--- a/checks/deb-format.pm
+++ b/checks/deb-format.pm
@@ -22,7 +22,7 @@ use autodie;
use List::MoreUtils qw(first_index none);
-use Lintian::Command qw(spawn);
+use Lintian::Command qw(safe_qx spawn);
use Lintian::Data;
use Lintian::Tags qw(tag);
@@ -195,12 +195,11 @@ sub run {
# supports a newer format but it's not permitted in the archive
# yet.
if (not defined($failed)) {
- $opts = {};
- $success = spawn($opts, ['ar', 'p', $deb, 'debian-binary']);
- if (not $success) {
+ my $output = spawn('ar', 'p', $deb, 'debian-binary');
+ if ($? != 0) {
tag 'malformed-deb-archive', 'cannot read debian-binary member';
- } elsif (${ $opts->{out} } !~ /^2\.\d+\n/) {
- my ($version) = split("\n", ${ $opts->{out} });
+ } elsif ($output !~ /^2\.\d+\n/) {
+ my ($version) = split(m/\n/, $output);
tag 'malformed-deb-archive', "version $version not 2.0";
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: