Package: dctrl-tools
Version: 2.24-2+b1
Severity: wishlist
Tags: upstream patch

Hi,

More than a year ago I submitted a patch upstream to include a
"grep-sources" command in dctrl-tools:
https://github.com/ajkaijanaho/dctrl-tools/pull/1

I hoped we could have that for stretch, but that didn't happen. Maybe we
want to carry this patch in Debian?

I'm attaching the patch as well.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.12.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8), 
LANGUAGE=pt_BR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dctrl-tools depends on:
ii  libc6  2.24-17

dctrl-tools recommends no packages.

Versions of packages dctrl-tools suggests:
ii  apt      1.5
pn  debtags  <none>

-- no debconf information
>From 38452b916f7d4d3e7a1620a10205f579f5fb957f Mon Sep 17 00:00:00 2001
From: Antonio Terceiro <terce...@debian.org>
Date: Wed, 4 May 2016 09:13:28 -0300
Subject: [PATCH] Add grep-sources command

It will use as input the contents of all the source repositories present
in the system.
---
 GNUmakefile             | 2 +-
 grep-dctrl/grep-dctrl.c | 4 ++++
 man/grep-dctrl.1.cp     | 7 +++++--
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 5039167..5006e2d 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -56,7 +56,7 @@ all :	all-no-mo mo translated-man
 all-no-mo :	sync-available/sync-available \
 		man/grep-dctrl.1 \
 		$(exe)
-aliases = grep-status grep-available grep-aptavail grep-debtags
+aliases = grep-status grep-available grep-aptavail grep-debtags grep-sources
 
 install :
 	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
diff --git a/grep-dctrl/grep-dctrl.c b/grep-dctrl/grep-dctrl.c
index 42857c9..5aa4b4b 100644
--- a/grep-dctrl/grep-dctrl.c
+++ b/grep-dctrl/grep-dctrl.c
@@ -935,6 +935,10 @@ int main (int argc, char * argv[])
                                 fname = (struct ifile){
                                         .mode = m_exec,
                                         .s = "debtags dumpavail" };
+                        } else if (strcmp(argv0, "grep-sources") == 0) {
+                                fname = (struct ifile){
+                                        .mode = m_exec,
+                                        .s = "apt-get indextargets --format '$(FILENAME)' 'Created-By: Sources' | xargs /usr/lib/apt/apt-helper cat-file" };
 			} else {
                                 message(L_FATAL, 0,
                                         _("executable name '%s' is not recognised"),
diff --git a/man/grep-dctrl.1.cp b/man/grep-dctrl.1.cp
index 004390d..adf1299 100644
--- a/man/grep-dctrl.1.cp
+++ b/man/grep-dctrl.1.cp
@@ -49,7 +49,8 @@ given a useful input file.
 The programs
 .BR grep\-available ,
 .BR grep\-status ,
-.B grep\-aptavail
+.B grep\-aptavail,
+.B grep\-sources,
 and
 .B grep\-debtags
 are aliases of (actually, symbolic links to)
@@ -62,7 +63,9 @@ and
 .I status
 files, the
 .B apt\-cache dumpavail
-output and the
+output,
+.B all APT source repositories,
+and the
 .B debtags dumpavail
 output, respectively.
 .PP

Reply via email to