This patch has associated context ...
There are 2 levels of looping in rpmbuild, one over CLI args, the
other over comma separated --target arguments. Been there since 1998 ...
I persoallyy think that both loops are design flaws in rpmbuild.
Its really really easy to write a loop over rpmbuild invocations
with whatever arguments you wish for a single build.
OTOH, the end point of trying to continue with the 2 levels
of looping that have traditionally been in rpmbuild
is going to be positionally sensitive options/args like:
rpmbuild -ba --target noarch test1.spec --target i386,i686
test2.spec
Already rpmbuild has too many arguments, and I don't believe any good
will
result from attempting positionally sensitive options and arguments.
Meanwhile, the current patch (mostly, there are 2 flaws that I can see)
restores "traditional" (and hardly useful imho) rpmbuild looping.
Note that there's Yet Another Place where loops & configuration
become intertwined,
with --specfile/--specsrpm & --target queries. I'll continue to
pretend that
I don't know how to fix that flaw, thank you. Meanwhile similar to
the attached patch
would fix.
Seriously, I believe the rpmbuild loops are RPM design flaws, not
otherwise.
73 de Jeff
On Jun 4, 2008, at 3:53 PM, Jeff Johnson wrote:
> RPM Package Manager, CVS Repository
> http://rpm5.org/cvs/
>
> ______________________________________________________________________
> ______
>
> Server: rpm5.org Name: Jeff Johnson
> Root: /v/rpm/cvs Email: jbj@rpm5.org
> Module: rpm Date: 04-Jun-2008
> 21:53:25
> Branch: HEAD Handle: 2008060419532500
>
> Modified files:
> rpm CHANGES rpmqv.c
>
> Log:
> - jbj: trash-and-restore macro config for multiple CLI arg builds.
>
> Summary:
> Revision Changes Path
> 1.2394 +1 -0 rpm/CHANGES
> 1.147 +13 -0 rpm/rpmqv.c
>
> ______________________________________________________________________
> ______
>
> patch -p0 <<'@@ .'
> Index: rpm/CHANGES
>
> ======================================================================
> ======
> $ cvs diff -u -r1.2393 -r1.2394 CHANGES
> --- rpm/CHANGES 4 Jun 2008 12:24:50 -0000 1.2393
> +++ rpm/CHANGES 4 Jun 2008 19:53:25 -0000 1.2394
> @@ -1,5 +1,6 @@
>
> 5.1.0 -> 5.2a0:
> + - jbj: trash-and-restore macro config for multiple CLI arg
> builds.
> - rpm.org: use same code for creating the digest object on
> iteration and method call,
> - jbj: rpmrepo: correct requiressqlentry tag name typo.
> - jbj: fix: handle '%{arch}\' with \ at end-of-string
> correctly.
> @@ .
> patch -p0 <<'@@ .'
> Index: rpm/rpmqv.c
>
> ======================================================================
> ======
> $ cvs diff -u -r1.146 -r1.147 rpmqv.c
> --- rpm/rpmqv.c 6 Apr 2008 07:28:41 -0000 1.146
> +++ rpm/rpmqv.c 4 Jun 2008 19:53:25 -0000 1.147
> @@ -763,6 +763,7 @@
> case MODE_REBUILD:
> case MODE_RECOMPILE:
> { const char * pkg;
> + int nbuilds = 0;
>
> while (!rpmIsVerbose())
> rpmIncreaseVerbosity();
> @@ -783,6 +784,11 @@
> while ((pkg = poptGetArg(optCon))) {
> const char * specFile = NULL;
>
> + if (nbuilds++ > 0) {
> + rpmFreeMacros(NULL);
> + rpmFreeRpmrc();
> + (void) rpmReadConfigFiles(NULL, NULL);
> + }
> ba->cookie = NULL;
> ec = rpmInstallSource(ts, pkg, &specFile, &ba->cookie);
> if (ec == 0) {
> @@ -802,6 +808,8 @@
> case MODE_BUILD:
> case MODE_TARBUILD:
> { const char * pkg;
> + int nbuilds = 0;
> +
> #if defined(RPM_VENDOR_OPENPKG) /* no-auto-verbose-increase-for-
> track-and-fetch */
> if (ba->buildChar != 't' && ba->buildChar != 'f')
> #endif
> @@ -865,6 +873,11 @@
> }
>
> while ((pkg = poptGetArg(optCon))) {
> + if (nbuilds++ > 0) {
> + rpmFreeMacros(NULL);
> + rpmFreeRpmrc();
> + (void) rpmReadConfigFiles(NULL, NULL);
> + }
> ba->rootdir = rpmioRootDir;
> ba->passPhrase = passPhrase;
> ba->cookie = NULL;
> @@ .
> ______________________________________________________________________
> RPM Package Manager http://rpm5.org
> CVS Sources Repository rpm-cvs@rpm5.org
Received on Wed Jun 4 22:06:34 2008