public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: - preserve empty lines in spec prep section (#573339)
Date: Mon, 23 Nov 2026 09:26:32 GMT [thread overview]
Message-ID: <179542599211.1.10411542733808080929.rpms-rpm-e3441ce16a15@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/rpm
Branch : pmatilai-v6
Commit : e3441ce16a15ceb4788db3047f4c26e92dc8c75c
Author : Panu Matilainen <pmatilai@fedoraproject.org>
Date : 2010-03-16T09:23:27+00:00
Stats : +99/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rpm/c/e3441ce16a15ceb4788db3047f4c26e92dc8c75c?branch=pmatilai-v6
Log:
- preserve empty lines in spec prep section (#573339)
---
diff --git a/rpm-4.8.0-prep-keep-empty.patch b/rpm-4.8.0-prep-keep-empty.patch
new file mode 100644
index 0000000..fb9cc3b
--- /dev/null
+++ b/rpm-4.8.0-prep-keep-empty.patch
@@ -0,0 +1,96 @@
+commit 35052b96232810cbf0d91a4f1d1d3ff25a142fd0
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date: Mon Mar 15 11:54:55 2010 +0200
+
+ Add an enhanced argvSplitString() function for splitting strings to argv's
+ - Returns the newly created argv instead of useless "this always returns 0"
+ - By default make a "real" split, including empty strings
+ - Flags argument allows controlling behavior, for now only flag is to
+ preserve argvSplit() behavior but leaves room for future enhancements
+ such as quoted splitting etc
+
+commit 12802c36c9a3b7260d9f788afc826b1cc5ee05e2
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date: Mon Mar 15 12:00:55 2010 +0200
+
+ Avoid eating empty lines in spec %prep section (RhBug:573339)
+ - In spec %prep context empty lines don't usually matter but they can
+ be significant in eg here-documents.
+ - Fixes regression from commit 94ff22b129aeb31c38848231e40f87aa4a5613a1
+
+diff --git a/rpmio/argv.c b/rpmio/argv.c
+index d633462..f21da1c 100644
+--- a/rpmio/argv.c
++++ b/rpmio/argv.c
+@@ -168,7 +168,7 @@ int argvAppend(ARGV_t * argvp, ARGV_const_t av)
+ return 0;
+ }
+
+-int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
++ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags)
+ {
+ char *dest = xmalloc(strlen(str) + 1);
+ ARGV_t argv;
+@@ -189,14 +189,22 @@ int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
+ argv = xmalloc( (argc + 1) * sizeof(*argv));
+
+ for (c = 0, s = dest; s < t; s+= strlen(s) + 1) {
+- if (*s == '\0')
++ if (*s == '\0' && (flags & ARGV_SKIPEMPTY))
+ continue;
+ argv[c] = xstrdup(s);
+ c++;
+ }
+ argv[c] = NULL;
+- *argvp = argv;
+ free(dest);
++ return argv;
++}
++
++/* Backwards compatibility */
++int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
++{
++ if (argvp) {
++ *argvp = argvSplitString(str, seps, ARGV_SKIPEMPTY);
++ }
+ return 0;
+ }
+
+diff --git a/rpmio/argv.h b/rpmio/argv.h
+index 6a6fc7f..86ec137 100644
+--- a/rpmio/argv.h
++++ b/rpmio/argv.h
+@@ -138,6 +138,20 @@ int argvAddNum(ARGV_t * argvp, int val);
+ */
+ int argvAppend(ARGV_t * argvp, ARGV_const_t av);
+
++typedef enum argvFlags_e {
++ ARGV_NONE = 0,
++ ARGV_SKIPEMPTY = (1 << 0), /* omit empty strings from result */
++} argvFlags;
++
++/** \ingroup rpmargv
++ * Split a string into an argv array.
++ * @param str string arg to split
++ * @param seps seperator characters
++ * @param flags flags to control behavior
++ * @return argv array
++ */
++ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags);
++
+ /** \ingroup rpmargv
+ * Split a string into an argv array.
+ * @retval *argvp argv array
+diff --git a/build/parsePrep.c b/build/parsePrep.c
+index 8e10c00..394c162 100644
+--- a/build/parsePrep.c
++++ b/build/parsePrep.c
+@@ -522,7 +522,7 @@ int parsePrep(rpmSpec spec)
+ }
+ }
+
+- argvSplit(&saveLines, getStringBuf(sb), "\n");
++ saveLines = argvSplitString(getStringBuf(sb), "\n", ARGV_NONE);
+ for (lines = saveLines; *lines; lines++) {
+ res = 0;
+ if (rstreqn(*lines, "%setup", sizeof("%setup")-1)) {
diff --git a/rpm.spec b/rpm.spec
index 5027385..14d09ea 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -45,6 +45,7 @@ Patch202: rpm-4.8.0-pythondeps-parallel.patch
Patch203: rpm-4.8.0-python-bytecompile.patch
Patch204: rpm-4.8.0-lazy-statfs.patch
Patch205: rpm-4.8.0-erasure-dsi.patch
+Patch206: rpm-4.8.0-prep-keep-empty.patch
# These are not yet upstream
Patch301: rpm-4.6.0-niagara.patch
@@ -196,6 +197,7 @@ packages on a system.
%patch203 -p1 -b .python-bytecompile
%patch204 -p1 -b .lazy-statfs
%patch205 -p1 -b .erasure-dsi
+%patch206 -p1 -b .prep-keep-empty
%patch301 -p1 -b .niagara
%patch302 -p1 -b .geode
@@ -415,6 +417,7 @@ exit 0
* Tue Mar 16 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-11
- support single PPD providing driver for devices (#568351)
- merge the psdriver patch pile into one
+- preserve empty lines in spec prep section (#573339)
* Mon Feb 15 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-10
- drop bogus dependency on lzma, xz is used to handle the lzma format too
reply other threads:[~2026-11-23 9:26 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=179542599211.1.10411542733808080929.rpms-rpm-e3441ce16a15@fedoraproject.org \
--to=pmatilai@fedoraproject.org \
--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