[lintian] 01/02: L::Util: Drop dpkg_deb_has_ctrl_tarfile (Wheezy support)
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 68860b00b2ca5ba741a83a4bf8173c450861fbad
Author: Niels Thykier <niels@thykier.net>
Date: Thu Apr 20 12:07:42 2017 +0000
L::Util: Drop dpkg_deb_has_ctrl_tarfile (Wheezy support)
This bit of code was used to support Wheezy's dpkg that did not have a
--ctrl-tarfile. Since we no longer support Wheezy, we may as well
drop this extra support code.
Signed-off-by: Niels Thykier <niels@thykier.net>
---
collection/bin-pkg-control | 15 ++++-----------
debian/changelog | 6 ++++++
debian/control | 5 +++--
lib/Lintian/Util.pm | 36 ++++--------------------------------
4 files changed, 17 insertions(+), 45 deletions(-)
diff --git a/collection/bin-pkg-control b/collection/bin-pkg-control
index 417f99e..9a0da43 100755
--- a/collection/bin-pkg-control
+++ b/collection/bin-pkg-control
@@ -31,7 +31,7 @@ use constant ERROR_FILES => qw(control-index-errors control-errors);
use lib "$ENV{'LINTIAN_ROOT'}/lib";
use Lintian::Command qw(spawn reap);
-use Lintian::Util qw(delete_dir fail pipe_tee dpkg_deb_has_ctrl_tarfile);
+use Lintian::Util qw(delete_dir fail pipe_tee);
sub collect {
my ($pkg, $type, $dir) = @_;
@@ -53,16 +53,9 @@ sub collect {
# (replaces dpkg-deb -e)
# extract control files' tarball
$in_fd = FileHandle->new;
- if (dpkg_deb_has_ctrl_tarfile()) {
- spawn(
- { fail => 'error', pipe_out => $in_fd },
- ['dpkg-deb', '--ctrl-tarfile', "$dir/deb"]);
- } else {
- spawn(
- { fail => 'error', pipe_out => $in_fd },
- ['ar', 'p', "$dir/deb", 'control.tar.gz'],
- '|', ['gzip', '-dc']);
- }
+ spawn(
+ { fail => 'error', pipe_out => $in_fd },
+ ['dpkg-deb', '--ctrl-tarfile', "$dir/deb"]);
$job = {
fail => 'error',
diff --git a/debian/changelog b/debian/changelog
index 19d1a00..6f05e81 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -76,11 +76,17 @@ lintian (2.5.51) UNRELEASED; urgency=medium
+ [CL] Add "none were" -> "none was" multiword correction.
(Closes: 860558)
+ * debian/control:
+ + [NT] Add explicit (Build-)Depends on dpkg (>= 1.17.14) to make it
+ explicit that we no longer support Wheezy or older.
* debian/copyright:
+ [EB] Add Edward Betts.
* lib/Lintian/CheckScript.pm:
+ [NT] Remove fallback code for "old" style "pm"-less checks.
+ * lib/Lintian/Util.pm:
+ + [NT] Drop dpkg_deb_has_ctrl_tarfile. Lintian now assumes that
+ dpkg 1.17.14 is available (provided by Debian jessie or later).
* frontend/dplint:
+ [NT] Ensure all include directories are absolute before passing
diff --git a/debian/control b/debian/control
index 88a5aed..181f9ce 100644
--- a/debian/control
+++ b/debian/control
@@ -20,6 +20,7 @@ Build-Depends: aspell,
diffstat,
docbook-utils,
docbook-xml,
+ dpkg (>= 1.17.14),
fakeroot,
file,
gettext,
@@ -78,6 +79,7 @@ Architecture: all
Depends: binutils,
bzip2,
diffstat,
+ dpkg (>= 1.17.14),
file,
gettext,
intltool-debian,
@@ -103,8 +105,7 @@ Depends: binutils,
xz-utils,
${misc:Depends},
${perl:Depends},
-Recommends: dpkg (>= 1.17.14),
- perl (>= 5.20) | libautodie-perl (>= 2.18),
+Recommends: perl (>= 5.20) | libautodie-perl (>= 2.18),
libperlio-gzip-perl,
Suggests: binutils-multiarch,
dpkg-dev,
diff --git a/lib/Lintian/Util.pm b/lib/Lintian/Util.pm
index 28be711..9bc2842 100644
--- a/lib/Lintian/Util.pm
+++ b/lib/Lintian/Util.pm
@@ -56,7 +56,6 @@ BEGIN {
parse_dpkg_control
read_dpkg_control
read_dpkg_control_utf8
- dpkg_deb_has_ctrl_tarfile
get_deb_info
get_dsc_info
get_file_checksum
@@ -104,7 +103,7 @@ use FileHandle;
use List::Util qw(shuffle);
use Scalar::Util qw(openhandle);
-use Lintian::Command qw(spawn safe_qx);
+use Lintian::Command qw(spawn);
use Lintian::Relation::Version qw(versions_equal versions_comparator);
=head1 NAME
@@ -658,28 +657,6 @@ sub read_dpkg_control_utf8 {
return @data;
}
-=item dpkg_deb_has_ctrl_tarfile()
-
-Check if lintian could use dpkg-deb instead of ar and tar
-
-=cut
-
-{
- my $dpkg_deb_has_ctrl_tarfile_cache;
-
- sub dpkg_deb_has_ctrl_tarfile {
- if (not defined($dpkg_deb_has_ctrl_tarfile_cache)) {
- my $help = safe_qx({'err' => '/dev/null'},'dpkg-deb', '--help');
- if (index($help, '--ctrl-tarfile') > -1) {
- $dpkg_deb_has_ctrl_tarfile_cache = 1;
- } else {
- $dpkg_deb_has_ctrl_tarfile_cache = 0;
- }
- }
- return $dpkg_deb_has_ctrl_tarfile_cache;
- }
-}
-
=item get_deb_info(DEBFILE)
Extracts the control file from DEBFILE and returns it as a hashref.
@@ -713,14 +690,9 @@ L</parse_dpkg_control> do. It can also emit:
pipe_out => FileHandle->new
};
- if (dpkg_deb_has_ctrl_tarfile()) {
- spawn(
- $opts, ['dpkg-deb', '--ctrl-tarfile', $file],
- '|', ['tar', '--wildcards', '-xO', '-f', '-', '*control']);
- } else {
- spawn($opts, ['ar', 'p', $file, 'control.tar.gz'],
- '|', ['tar', '--wildcards', '-xzO', '-f', '-', '*control']);
- }
+ spawn(
+ $opts, ['dpkg-deb', '--ctrl-tarfile', $file],
+ '|', ['tar', '--wildcards', '-xO', '-f', '-', '*control']);
my @data = parse_dpkg_control($opts->{pipe_out});
# Consume all data before exiting so that we don't kill child processes
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: