[devscripts] 01/01: chdist: Support both pre-/post-3.x apt-file

James McCoy jamessan at debian.org
Mon Dec 7 01:05:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch master
in repository devscripts.

commit 79f0d08ca7532afe06b301bd0fdec1636cd1e66e
Author: James McCoy <jamessan at debian.org>
Date:   Sun Dec 6 20:03:55 2015 -0500

    chdist: Support both pre-/post-3.x apt-file
    
    Signed-off-by: James McCoy <jamessan at debian.org>
---
 debian/changelog  |  2 ++
 scripts/chdist.pl | 19 +++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c4499ab..8021791 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -111,6 +111,8 @@ devscripts (2.15.10) UNRELEASED; urgency=medium
     #807065)
   * Export LC_ALL=C in test_mk-origtargz so the test doesn't fail in non-English
     locales.
+  * chdist:
+    + Make the apt-file support compatible with 3.x apt-file.
 
   [ Daniel Kahn Gillmor ]
   * debuild:
diff --git a/scripts/chdist.pl b/scripts/chdist.pl
index 21daaa6..222bd14 100755
--- a/scripts/chdist.pl
+++ b/scripts/chdist.pl
@@ -272,12 +272,19 @@ sub apt_file
 {
     my ($dist, @args) = @_;
     dist_check($dist);
-    my $sources_list = $datadir . '/' . $dist . "/etc/apt/sources.list";
-    my $cache_directory = $datadir . '/' . $dist . "/var/cache/apt/apt-file";
-    unshift(@args,
-      '--sources-list', $sources_list,
-      '--cache', $cache_directory
-    );
+    aptconfig($dist);
+    my $aptconfdir = '/etc/apt/apt.conf.d';
+    my ($aptfile_conf) = glob($aptconfdir.'/*apt-file.conf');
+    if ($aptfile_conf) {
+	# New-style apt-file
+	cp($aptfile_conf, "$datadir/$dist/$aptconfdir");
+    }
+    else {
+	my $cache_directory = $datadir . '/' . $dist . "/var/cache/apt/apt-file";
+	unshift(@args,
+	    '--cache', $cache_directory
+	);
+    }
     exec('apt-file', @args);
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list