The following commit has been merged in the master branch:
commit 2a8d85923aeef458910f99e0515d99c7fbdd6c5e
Author: James McCoy <[email protected]>
Date: Thu Oct 27 21:12:54 2011 -0400
dd-list: Allow specifying which sources files to read.
Closes: #509983
Signed-off-by: James McCoy <[email protected]>
diff --git a/debian/changelog b/debian/changelog
index 1620a3a..ac2e4c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -30,6 +30,7 @@ devscripts (2.11.2) UNRELEASED; urgency=low
(Closes: #638602)
+ Parse sources files directly instead of invoking apt-cache. (Closes:
#376595)
+ + Allow specifying which sources files to read. (Closes: #509983)
[ Stefano Rivera ]
* debchange: Add precise as a recognised Ubuntu distro.
diff --git a/scripts/dd-list.1 b/scripts/dd-list.1
index 1984f32..e301ba0 100644
--- a/scripts/dd-list.1
+++ b/scripts/dd-list.1
@@ -13,13 +13,14 @@
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
.\"
-.TH DD\-LIST 1 2005-06-28 "Debian"
+.TH DD\-LIST 1 2011-10-27 "Debian"
.\" --------------------------------------------------------------------
.SH NAME
dd\-list \- nicely list .deb packages and their maintainers
.\" --------------------------------------------------------------------
.SH SYNOPSIS
-.BR dd\-list " [" \-hiuV "] [" \-\-help "] [" \-\-stdin "]"
+.BR dd\-list " [" \-hiusV "] [" \-\-help "] [" \-\-stdin "]"
+.BR "" "[" "\-\-sources \fIsources_file" "]
.BR "" "[" \-\-dctrl "] [" \-\-version "] [" \-\-uploaders "] [" \fIpackage "
...]"
.\" --------------------------------------------------------------------
.SH DESCRIPTION
@@ -29,7 +30,7 @@ maintainers.
.PP
Input is a list of source or binary package names on the command line
(or the standard input if
-.B --stdin
+.B \-\-stdin
is given).
Output is a list of the following format, where package names are source
packages by default:
@@ -73,6 +74,13 @@ of each listed package.
If no \fISource:\fP line is given, the \fIPackage:\fP name is used for
output, which might be a binary package name.
.TP
+.BR \-s , \-\-sources \fISOURCES_FILE
+Read package information from the specified \fISOURCES_FILE\fRs. This can be
+given multiple times.
+.IP
+If no \fISOURCES_FILES\fR are specified, any files matching
+\fI/var/lib/apt/lists/*_source_Sources\fR will be used.
+.TP
.BR \-u , \-\-uploaders
Also list developers who are named as uploaders of packages, not only
the maintainers; this is the default behaviour, use \-\-nouploaders to
diff --git a/scripts/dd-list.pl b/scripts/dd-list.pl
index f6d19f0..343020e 100755
--- a/scripts/dd-list.pl
+++ b/scripts/dd-list.pl
@@ -45,6 +45,11 @@ Usage: dd-list [options] [package ...]
-d, --dctrl
Read package list in Debian control data from standard input.
+ -s, --sources SOURCES_FILE
+ Read package information from given SOURCES_FILE instead of all files
+ matching /var/lib/apt/lists/*_source_Sources. Can be specified
+ multiple times.
+
-u, --uploaders
Also list Uploaders of packages, not only the listed Maintainers
(this is the default behaviour, use --nouploaders to prevent this).
@@ -63,12 +68,14 @@ EOF
my $use_stdin=0;
my $use_dctrl=0;
+my $source_files=[];
my $show_uploaders=1;
my $print_binary=0;
GetOptions(
"help" => sub { help(); exit },
"stdin|i" => \$use_stdin,
"dctrl|d" => \$use_dctrl,
+ "sources|s:s@" => \$source_files,
"uploaders|u!" => \$show_uploaders,
"print-binary|b" => \$print_binary,
"version" => sub { print "dd-list version $version\n" })
@@ -136,7 +143,11 @@ else {
map { $package_name{lc($_)} = 1 } @ARGV;
}
- foreach my $source (glob('/var/lib/apt/lists/*_source_Sources')) {
+ unless (@{$source_files}) {
+ $source_files = [glob('/var/lib/apt/lists/*_source_Sources')];
+ }
+
+ foreach my $source (@{$source_files}) {
my $fh = FileHandle->new("<$source");
unless (defined $fh) {
warn "E: Couldn't open $fh\n";
--
Git repository for devscripts
--
To unsubscribe, send mail to [email protected].