[devscripts] 01/02: Add option -m to only look in the Maintainer field

Axel Beckert abe at deuxchevaux.org
Mon Jan 15 21:15:56 UTC 2018


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

abe pushed a commit to branch master
in repository devscripts.

commit a4720289f8c068885a8101d80ae3cba57f19a98a
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Mon Jan 15 21:57:55 2018 +0100

    Add option -m to only look in the Maintainer field
    
    This ignores e-mail address appearances in the Uploaders field to only
    display personally maintained packages and skip team-maintained
    packages.
    
    Closes: #887380
---
 debian/changelog |  5 +++++
 scripts/ltnu.pod | 14 ++++++++++++--
 scripts/ltnu.sh  | 15 +++++++++++++--
 3 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 16b7a52..95a017c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,11 @@ devscripts (2.18.1) UNRELEASED; urgency=medium
   * debrepro:
     + Add a --help option and include options description in the usage output.
 
+  [ Axel Beckert ]
+  * ltnu:
+    + Add option "-m" to only look in the Maintainer field and not also in
+      the Uploaders field.  Closes: #887380
+
  -- Mattia Rizzolo <mattia at debian.org>  Wed, 03 Jan 2018 14:31:54 +0100
 
 devscripts (2.17.12) unstable; urgency=medium
diff --git a/scripts/ltnu.pod b/scripts/ltnu.pod
index ca883fa..53998f7 100644
--- a/scripts/ltnu.pod
+++ b/scripts/ltnu.pod
@@ -4,9 +4,9 @@ ltnu - lists packages of a maintainer ordered by last upload
 
 =head1 SYNOPSIS
 
-B<env> DEBEMAIL=I<maintainer> B<ltnu>
+B<env> DEBEMAIL=I<maintainer> B<ltnu> [-m]
 
-B<ltnu> I<maintainer>
+B<ltnu> [-m] I<maintainer>
 
 B<ltnu> --help
 
@@ -24,6 +24,16 @@ packaging revamp. It's less suitable for MIA team purposes as it
 doesn't make a difference with regards to who actually uploaded a
 package.
 
+=head1 OPTIONS
+
+=over 4
+
+=item -m
+
+Only search in the Maintainer field and ignore the Uploaders field.
+
+=back
+
 =head1 PARAMETERS
 
 The maintainer/uploader to query can be given either by setting
diff --git a/scripts/ltnu.sh b/scripts/ltnu.sh
index 08c37d9..f0362d5 100755
--- a/scripts/ltnu.sh
+++ b/scripts/ltnu.sh
@@ -33,6 +33,13 @@ if [ ! -x /usr/bin/psql ]; then
     exit 2
 fi
 
+# Some option parsing
+QUERY_UPLOADER=1
+if [ "$1" = "-m" ]; then
+    QUERY_UPLOADER=0
+    shift
+fi
+
 MAINT="${DEBEMAIL}"
 if [ -n "${1}" ]; then
     if echo "${1}" | fgrep -q @; then
@@ -59,6 +66,11 @@ if [ -z "${PAGER}" -o "${PAGER}" = "less" ]; then
     export PAGER="less -S"
 fi
 
+UPLOADER=''
+if [ "$QUERY_UPLOADER" = 1 ]; then
+   UPLOADER=" or uploaders like '%<${MAINT}>%'"
+fi
+
 env PGPASSWORD=udd-mirror psql --host=udd-mirror.debian.net --user=udd-mirror udd --command="
 select source,
        max(version) as ver,
@@ -67,8 +79,7 @@ from upload_history
 where distribution='unstable' and
       source in (select source
                  from sources
-                 where ( maintainer_email='${MAINT}' or
-                         uploaders like '%<${MAINT}>%' ) and
+                 where ( maintainer_email='${MAINT}' $UPLOADER ) and
                        release='sid')
 group by source
 order by max(date) asc;

-- 
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