public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: - accept files as command line arguments to rpmdeps again (#807767)
Date: Mon, 23 Nov 2026 09:27:42 GMT	[thread overview]
Message-ID: <179542606264.1.477947562764999005.rpms-rpm-99eadda67302@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 99eadda6730216a419e376804803421bc0fe30f4
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2012-03-29T11:41:48+03:00
Stats  : +50/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/99eadda6730216a419e376804803421bc0fe30f4?branch=pmatilai-v6

Log:
- accept files as command line arguments to rpmdeps again (#807767)

---
diff --git a/rpm-4.9.90-rpmdeps-args.patch b/rpm-4.9.90-rpmdeps-args.patch
new file mode 100644
index 0000000..5be354b
--- /dev/null
+++ b/rpm-4.9.90-rpmdeps-args.patch
@@ -0,0 +1,44 @@
+commit 9a2547ff49ae2fa9a4c9118e5472bba045379f3d
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date:   Thu Mar 29 11:26:57 2012 +0300
+
+    Accept files as command line arguments again in rpmdeps (RhBug:807767)
+    
+    - Commit a25c3c7bac95ab7eb55f0ecf0b8793d8da341611 removed what was
+      supposedly a non-supported method of passing files as arguments
+      (instead of the normal stdin method) to rpmdeps. Turns out
+      rpmdeps is even documented to take files as cli args, and that's
+      how Fedora's %filter_setup macros are calling it...
+    - Allow files as arguments again, but in a way that doesn't cause
+      argvFoo() vs popt crash-n-burn.
+    (cherry picked from commit fe252f21b370331016a952b085465cd97837aaef)
+
+diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c
+index 6b0b527..c3112eb 100644
+--- a/tools/rpmdeps.c
++++ b/tools/rpmdeps.c
+@@ -60,11 +60,19 @@ main(int argc, char *argv[])
+     if (optCon == NULL)
+ 	goto exit;
+ 
+-    while (fgets(buf, sizeof(buf), stdin) != NULL) {
+-	char *be = buf + strlen(buf) - 1;
+-	while (strchr("\r\n", *be) != NULL)
+-	    *be-- = '\0';
+-	argvAdd(&av, buf);
++    /* normally files get passed through stdin but also accept files as args */
++    if (poptPeekArg(optCon)) {
++	const char *arg;
++	while ((arg = poptGetArg(optCon)) != NULL) {
++	    argvAdd(&av, arg);
++	}
++    } else {
++	while (fgets(buf, sizeof(buf), stdin) != NULL) {
++	    char *be = buf + strlen(buf) - 1;
++	    while (strchr("\r\n", *be) != NULL)
++		*be-- = '\0';
++	    argvAdd(&av, buf);
++	}
+     }
+     /* Make sure file names are sorted. */
+     argvSort(av, NULL);

diff --git a/rpm.spec b/rpm.spec
index 54ff906..794d50a 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -22,7 +22,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}8%{?dist}
+Release: %{?snapver:0.%{snapver}.}9%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -48,6 +48,7 @@ Patch200: rpm-4.9.90-rpmte-fileinfo.patch
 Patch201: rpm-4.9.90-rpmte-fileinfo-2.patch
 Patch202: rpm-4.9.90-keyid-size.patch
 Patch203: rpm-4.9.90-header-datalength.patch
+Patch204: rpm-4.9.90-rpmdeps-args.patch
 
 # These are not yet upstream
 Patch301: rpm-4.6.0-niagara.patch
@@ -221,6 +222,7 @@ packages on a system.
 %patch201 -p1 -b .rpmte-fileinfo-2
 %patch202 -p1 -b .keyid-size
 %patch203 -p1 -b .header-datalength
+%patch204 -p1 -b .rpmdeps-args
 
 %patch301 -p1 -b .niagara
 %patch302 -p1 -b .geode
@@ -447,6 +449,9 @@ exit 0
 %doc COPYING doc/librpm/html/*
 
 %changelog
+* Thu Mar 29 2012 Panu Matilainen <pmatilai@redhat.com> - 4.9.90-0.git11505.9
+- accept files as command line arguments to rpmdeps again (#807767)
+ 
 * Mon Mar 26 2012 Panu Matilainen <pmatilai@redhat.com> - 4.9.90-0.git11505.8
 - remove fake library provide hacks now that deltarpm got rebuilt
 

                 reply	other threads:[~2026-11-23  9:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542606264.1.477947562764999005.rpms-rpm-99eadda67302@fedoraproject.org \
    --to=pmatilai@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox