Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/ configure.ac rpm/m...
Could you push all these changes back to the rpm-5_4 branch too please? That's where the buildbot's are running, and I am active. Otherwise these changes are gonna reside on HEAD until a ROADMAP or participation exists, and that isn't likely soon. Thanks! 73 de Jeff On Sep 6, 2011, at 10:41 AM, Pinto Elia wrote: RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Pinto Elia Root: /v/rpm/cvs Email: devzero2...@rpm5.org Module: rpm Date: 06-Sep-2011 16:41:18 Branch: HEAD Handle: 2011090614411701 Modified files: rpm CHANGES configure.ac rpm/build parsePrep.c rpm/macros macros.in rpm/rpmio macro.c rpmmacro.h Log: Add lzip support Summary: RevisionChanges Path 1.3674 +1 -0 rpm/CHANGES 2.137 +3 -0 rpm/build/parsePrep.c 2.501 +1 -0 rpm/configure.ac 1.61+2 -1 rpm/macros/macros.in 2.253 +6 -0 rpm/rpmio/macro.c 2.58+2 -1 rpm/rpmio/rpmmacro.h patch -p0 '@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.3673 -r1.3674 CHANGES --- rpm/CHANGES 6 Sep 2011 13:39:52 - 1.3673 +++ rpm/CHANGES 6 Sep 2011 14:41:17 - 1.3674 @@ -1,4 +1,5 @@ HEAD: +- devzero2000: add lzip support - devzero2000: add lrzip support (blueprint https://blueprints.launchpad.net/rpm/+spec/rpm5-use-lrzip-as-new-compression-program) - devzero2000: merge commit 31d807ffa8cdf91addf7c39fdf9abf6c61d77944 @@ . patch -p0 '@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.136 -r2.137 parsePrep.c --- rpm/build/parsePrep.c6 Sep 2011 13:39:52 - 2.136 +++ rpm/build/parsePrep.c6 Sep 2011 14:41:17 - 2.137 @@ -323,6 +323,9 @@ case COMPRESSED_XZ: t = %{__xz} -dc; break; +case COMPRESSED_LZIP: +t = %{__lzip} -dc; +break; case COMPRESSED_LRZIP: t = %{__lrzip} -dqo-; break; @@ . patch -p0 '@@ .' Index: rpm/configure.ac $ cvs diff -u -r2.500 -r2.501 configure.ac --- rpm/configure.ac 6 Sep 2011 13:39:52 - 2.500 +++ rpm/configure.ac 6 Sep 2011 14:41:17 - 2.501 @@ -571,6 +571,7 @@ AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH) AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH) AC_PATH_PROG(__LRZIP, lrzip, /usr/bin/lrzip, $MYPATH) +AC_PATH_PROG(__LZIP, lzip, /usr/bin/lzip, $MYPATH) AC_PATH_PROG(__INSTALL_INFO, install-info, /sbin/install-info, $MYPATH) AC_PATH_PROG(__LDCONFIG, ldconfig, /sbin/ldconfig, $MYPATH) AC_PATH_PROG(__LN, ln, /bin/ln, $MYPATH) @@ . patch -p0 '@@ .' Index: rpm/macros/macros.in $ cvs diff -u -r1.60 -r1.61 macros.in --- rpm/macros/macros.in 6 Sep 2011 13:39:53 - 1.60 +++ rpm/macros/macros.in 6 Sep 2011 14:41:18 - 1.61 @@ -1,7 +1,7 @@ #/*! \page config_macros Default configuration: @USRLIBRPM@/macros # \verbatim # -# $Id: macros.in,v 1.60 2011/09/06 13:39:53 devzero2000 Exp $ +# $Id: macros.in,v 1.61 2011/09/06 14:41:18 devzero2000 Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -91,6 +91,7 @@ %__ldconfig @__LDCONFIG@ %__ln @__LN@ %__ln_s @LN_S@ +%__lzip @__LZIP@ %__lrzip@__LRZIP@ %__lzma @__LZMA@ %__lzop @__LZOP@ @@ . patch -p0 '@@ .' Index: rpm/rpmio/macro.c $ cvs diff -u -r2.252 -r2.253 macro.c --- rpm/rpmio/macro.c6 Sep 2011 13:39:53 - 2.252 +++ rpm/rpmio/macro.c6 Sep 2011 14:41:18 - 2.253 @@ -1356,6 +1356,9 @@ case 7: /* COMPRESSED_LRZIP */ sprintf(be, %%__lrzip -dqo- %s, b); break; +case 8: /* COMPRESSED_LZIP */ +sprintf(be, %%__lzip -dc %s, b); +break; } b = be; } else if (STREQ(mkstemp, f, fn)) { @@ -3036,6 +3039,9 @@ if (magic[0] == (unsigned char) 0xFD magic[1] == 0x37 magic[2] == 0x7A magic[3] == 0x58 magic[4] == 0x5A magic[5] ==
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/ configure.ac rpm/m...
On Tue, Sep 6, 2011 at 4:43 PM, Jeff Johnson n3...@mac.com wrote: Could you push all these changes back to the rpm-5_4 branch too please? That's where the buildbot's are running, and I am active. Otherwise these changes are gonna reside on HEAD until a ROADMAP or participation exists, and that isn't likely soon. Thanks! Done : lzip and lrzip support are in HEAD and in the 5_4 Branch. Tomorrow i will search if there are some my patch that live only in HEAD and i will merge in 5_4 as well. Best Regards 73 de Jeff On Sep 6, 2011, at 10:41 AM, Pinto Elia wrote: RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Pinto Elia Root: /v/rpm/cvs Email: devzero2...@rpm5.org Module: rpm Date: 06-Sep-2011 16:41:18 Branch: HEAD Handle: 2011090614411701 Modified files: rpm CHANGES configure.ac rpm/build parsePrep.c rpm/macros macros.in rpm/rpmio macro.c rpmmacro.h Log: Add lzip support Summary: RevisionChanges Path 1.3674 +1 -0 rpm/CHANGES 2.137 +3 -0 rpm/build/parsePrep.c 2.501 +1 -0 rpm/configure.ac 1.61+2 -1 rpm/macros/macros.in 2.253 +6 -0 rpm/rpmio/macro.c 2.58+2 -1 rpm/rpmio/rpmmacro.h patch -p0 '@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.3673 -r1.3674 CHANGES --- rpm/CHANGES 6 Sep 2011 13:39:52 - 1.3673 +++ rpm/CHANGES 6 Sep 2011 14:41:17 - 1.3674 @@ -1,4 +1,5 @@ HEAD: +- devzero2000: add lzip support - devzero2000: add lrzip support (blueprint https://blueprints.launchpad.net/rpm/+spec/rpm5-use-lrzip-as-new-compression-program ) - devzero2000: merge commit 31d807ffa8cdf91addf7c39fdf9abf6c61d77944 @@ . patch -p0 '@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.136 -r2.137 parsePrep.c --- rpm/build/parsePrep.c6 Sep 2011 13:39:52 - 2.136 +++ rpm/build/parsePrep.c6 Sep 2011 14:41:17 - 2.137 @@ -323,6 +323,9 @@ case COMPRESSED_XZ: t = %{__xz} -dc; break; +case COMPRESSED_LZIP: +t = %{__lzip} -dc; +break; case COMPRESSED_LRZIP: t = %{__lrzip} -dqo-; break; @@ . patch -p0 '@@ .' Index: rpm/configure.ac $ cvs diff -u -r2.500 -r2.501 configure.ac --- rpm/configure.ac 6 Sep 2011 13:39:52 - 2.500 +++ rpm/configure.ac 6 Sep 2011 14:41:17 - 2.501 @@ -571,6 +571,7 @@ AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH) AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH) AC_PATH_PROG(__LRZIP, lrzip, /usr/bin/lrzip, $MYPATH) +AC_PATH_PROG(__LZIP, lzip, /usr/bin/lzip, $MYPATH) AC_PATH_PROG(__INSTALL_INFO, install-info, /sbin/install-info, $MYPATH) AC_PATH_PROG(__LDCONFIG, ldconfig, /sbin/ldconfig, $MYPATH) AC_PATH_PROG(__LN, ln, /bin/ln, $MYPATH) @@ . patch -p0 '@@ .' Index: rpm/macros/macros.in $ cvs diff -u -r1.60 -r1.61 macros.in --- rpm/macros/macros.in 6 Sep 2011 13:39:53 - 1.60 +++ rpm/macros/macros.in 6 Sep 2011 14:41:18 - 1.61 @@ -1,7 +1,7 @@ #/*! \page config_macros Default configuration: @USRLIBRPM@/macros # \verbatim # -# $Id: macros.in,v 1.60 2011/09/06 13:39:53 devzero2000 Exp $ +# $Id: macros.in,v 1.61 2011/09/06 14:41:18 devzero2000 Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -91,6 +91,7 @@ %__ldconfig @__LDCONFIG@ %__ln @__LN@ %__ln_s @LN_S@ +%__lzip @__LZIP@ %__lrzip@__LRZIP@ %__lzma @__LZMA@ %__lzop @__LZOP@ @@ . patch -p0 '@@ .' Index: rpm/rpmio/macro.c $ cvs diff -u -r2.252 -r2.253 macro.c --- rpm/rpmio/macro.c6 Sep 2011 13:39:53 - 2.252 +++ rpm/rpmio/macro.c6 Sep 2011 14:41:18 - 2.253 @@ -1356,6 +1356,9 @@ case 7: /* COMPRESSED_LRZIP */ sprintf(be,
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/ configure.ac rpm/m...
On Sep 6, 2011, at 11:05 AM, devzero2000 wrote: Done : lzip and lrzip support are in HEAD and in the 5_4 Branch. Tomorrow i will search if there are some my patch that live only in HEAD and i will merge in 5_4 as well. Best Regards BTW, the buildbot master is now running at http://harwich.jbj.org:8010 I can wire you up for access whenever. Its also a single command to set up your own buildslave (and some specific configuration on the buildbot master and in devtool.conf to adjust to your specific platform and build options). And rpm-5.4.2 was released quietly yesterday. rpm-5.4.3 might be needed this week as well to start stabilizing linkages with multiple versions of Berkeley DB external. I will be targeting db-5.2.28 going forward with development. hth 73 de Jeff
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/macros/ ruby.in
Instead of adding sparkly rubt gem's, you ought to teach %setup to unpack from *.src.rpm's by adding a rpm2cpio layer and recursing through the unpacked %prep in the *.spec. The other approach is with rpm -q --yaml onto the *.src.rpm, one would need to expand the %setup there. But --yaml works only with @rpm5.org. but nice hack for ruby gem's. just, well, I ain't sure where %setup + ruby gems ends up, gems WILL download and install stuff. hth 73 de Jeff On Oct 18, 2010, at 7:27 AM, Per Øyvind Karlsen wrote: RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Per Øyvind Karlsen Root: /v/rpm/cvs Email: pkarl...@rpm5.org Module: rpm Date: 18-Oct-2010 13:27:13 Branch: HEAD Handle: 2010101811271200 Modified files: rpm CHANGES rpm/build parsePrep.c rpm/macros ruby.in Log: ditch %gem_unpack macro and make %setup automatically handle ruby gem extraction in stead. Summary: RevisionChanges Path 1.3478 +2 -0 rpm/CHANGES 2.131 +37 -2 rpm/build/parsePrep.c 1.4 +0 -5 rpm/macros/ruby.in patch -p0 '@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.3477 -r1.3478 CHANGES --- rpm/CHANGES 18 Oct 2010 05:46:19 - 1.3477 +++ rpm/CHANGES 18 Oct 2010 11:27:12 - 1.3478 @@ -1,4 +1,6 @@ 5.3.4 - 5.4a1: +proyvind: ditch %gem_unpack macro and make %setup automatically handle +ruby gem extraction in stead. - jbj: sqlite: fix: permit building without sqlite, db51/dbsql.h instead. - jbj: beecrypt: fix: polluted builds due to my brain fart. revert. - jbj: popt: permit builds with --with-popt=internal all over again. todo++. @@ . patch -p0 '@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.130 -r2.131 parsePrep.c --- rpm/build/parsePrep.c16 Mar 2009 21:06:44 - 2.130 +++ rpm/build/parsePrep.c18 Oct 2010 11:27:12 - 2.131 @@ -218,12 +218,13 @@ { const char *fn, *Lurlfn; static char buf[BUFSIZ]; -char *taropts; +char taropts[8]; char *t = NULL; struct Source *sp; rpmCompressedMagic compressed = COMPRESSED_NOT; int urltype; const char *tar; +int rubygem = 0; for (sp = spec-sources; sp != NULL; sp = sp-next) { if ((sp-flags RPMFILE_SOURCE) (sp-num == c)) { @@ -235,8 +236,18 @@ return NULL; } +t = rindex(sp-source, '.'); +if(!strcasecmp(t, .gem)) +rubygem = 1; + +t = stpcpy(taropts, -x); /*...@-internalglobs@*/ /* FIX: shrug */ -taropts = ((rpmIsVerbose() !quietly) ? -xvvf : -xf); +if(rpmIsVerbose() !quietly) +t = stpcpy(t, vv); +if(rubygem) +t = stpcpy(t, m); + +t = stpcpy(t, f); /*...@=internalglobs@*/ #if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ @@ -350,6 +361,16 @@ t = stpcpy(t, taropts); *t++ = ' '; t = stpcpy(t, fn); +if(rubygem) { +t = stpcpy(t, +\n +if [ -f data.tar.gz ]; then\n + tar ); +t = stpcpy(t, taropts); +t = stpcpy(t, + data.tar.gz\n +fi); +} } tar = _free(tar); @@ -465,6 +486,20 @@ spec-prep = rpmiobAppend(spec-prep, buf, 1); } +/* check if source is a ruby gem */ +{ struct Source *sp; +for (sp = spec-sources; sp != NULL; sp = sp-next) { +if ((sp-flags RPMFILE_SOURCE) (sp-num == 0)) { +break; +} +} +if (sp != NULL) { +char *t = rindex(sp-source, '.'); +if(!strcasecmp(t, .gem)) +createDir = 1; +} +} + /* if necessary, create and cd into the proper dir */ if (createDir) { char *mkdir_p; @@ . patch -p0 '@@ .' Index: rpm/macros/ruby.in $ cvs diff -u -r1.3 -r1.4 ruby.in --- rpm/macros/ruby.in 16 Oct 2010 21:56:34 - 1.3 +++ rpm/macros/ruby.in 18 Oct 2010 11:27:12 - 1.4 @@ -22,11 +22,6 @@ %ruby_gemdir%(%{__ruby} -rrbconfig -e 'include Config; print CONFIG[rubylibdir].sub(CONFIG[ruby_version], gems/#{CONFIG[ruby_version]})') %ruby_ridir %(%{__ruby} -rrbconfig -e 'include Config; print File.join(CONFIG[datadir], ri, CONFIG[ruby_version])')
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/ macros.in
It sure would be nice to have %patch as a macro rather than flip-flopping and jiggering up Yet More Complicated Silly Stuff, all forcing rpm rpm be recompiled. I haven't a clue anymore (because of the number of flip-flops) how patches are applied by rpmbuild. Can the #ifndef DYING sections perhaps be finally deleted instead? 73 de Jeff On Dec 18, 2008, at 12:11 PM, Anders F. Björklund wrote: RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Anders F. Björklund Root: /v/rpm/cvs Email: a...@rpm5.org Module: rpm Date: 18-Dec-2008 18:11:34 Branch: HEAD Handle: 2008121817113301 Modified files: rpm CHANGES macros.in rpm/build parsePrep.c Log: add default patch flags macro Summary: RevisionChanges Path 1.2692 +1 -0 rpm/CHANGES 2.128 +8 -5 rpm/build/parsePrep.c 1.264 +5 -2 rpm/macros.in patch -p0 '@@ .' Index: rpm/CHANGES = = = = = = == $ cvs diff -u -r1.2691 -r1.2692 CHANGES --- rpm/CHANGES18 Dec 2008 00:01:15 - 1.2691 +++ rpm/CHANGES18 Dec 2008 17:11:33 - 1.2692 @@ -1,5 +1,6 @@ 5.2a2 - 5.2a3: +- rpm.org: add %{_default_patch_flags} macro for patch options - proyvind: add -Werror=format-security to gcc warning flags. - proyvind: xzdio: rename from lzdio. - proyvind: lzdio: set memlimit for decoding to 100MiB. @@ . patch -p0 '@@ .' Index: rpm/build/parsePrep.c = = = = = = == $ cvs diff -u -r2.127 -r2.128 parsePrep.c --- rpm/build/parsePrep.c 15 Dec 2008 22:43:43 - 2.127 +++ rpm/build/parsePrep.c 18 Dec 2008 17:11:34 - 2.128 @@ -87,7 +87,7 @@ struct Source *sp; rpmCompressedMagic compressed = COMPRESSED_NOT; int urltype; -const char *patch; +const char *patch, *flags; *t = '\0'; if (db) @@ -146,6 +146,8 @@ if (strcmp(patch, %{__patch}) == 0) patch = xstrdup(patch); +flags = rpmExpand(%{?_default_patch_flags}%{!? _default_patch_flags:-s}, NULL); + if (compressed) { const char *zipper; @@ -173,7 +175,7 @@ sprintf(buf, echo \Patch #%d (%s):\\n - %s -d '%s' | %s -p%d %s -s\n + %s -d '%s' | %s -p%d %s %s\n STATUS=$?\n if [ $STATUS -ne 0 ]; then\n exit $STATUS\n @@ -183,19 +185,20 @@ (const char *) basename((char *)fn), /*...@=moduncon@*/ zipper, - fn, patch, strip, args); + fn, patch, strip, args, flags); zipper = _free(zipper); } else { sprintf(buf, echo \Patch #%d (%s):\\n - %s -p%d %s -s '%s', c, + %s -p%d %s %s '%s', c, /*...@-moduncon@*/ (const char *) basename((char *)fn), /*...@=moduncon@*/ - patch, strip, args, fn); + patch, strip, args, flags, fn); } patch = _free(patch); +flags = _free(flags); Lurlfn = _free(Lurlfn); return buf; } @@ . patch -p0 '@@ .' Index: rpm/macros.in = = = = = = == $ cvs diff -u -r1.263 -r1.264 macros.in --- rpm/macros.in 15 Dec 2008 22:43:43 - 1.263 +++ rpm/macros.in 18 Dec 2008 17:11:34 - 1.264 @@ -1,7 +1,7 @@ #/*! \page config_macros Default configuration: @USRLIBRPM@/macros # \verbatim # -# $Id: macros.in,v 1.263 2008/12/15 22:43:43 pkarlsen Exp $ +# $Id: macros.in,v 1.264 2008/12/18 17:11:34 afb Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -382,6 +382,9 @@ # Default fuzz level for %patch in spec file. #%_default_patch_fuzz -1 +# Default patch flags +%_default_patch_flags -s + #= = = = = = = = == # Build configuration macros. # @@ -407,7 +410,7 @@ %define __patch_file%{P:%{__patch_number}} \ %define __patch_suffix %{-b:-b --suffix %{-b*}} %{-z:--suffix %{- z*}} \ %define __patch_fuzz%{?_default_patch_fuzz:%(test % {_default_patch_fuzz} -ge 0 echo --fuzz=%{_default_patch_fuzz} )} \ -%define __patch_options -s %{-p:-p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{- d*}} %{-R} %{-E} %{__patch_suffix} \ +%define __patch_options %{_default_patch_flags} %{-p:-p%{-p*}} %{-
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/ macros.in
Jeff Johnson wrote: It sure would be nice to have %patch as a macro rather than flip-flopping and jiggering up Yet More Complicated Silly Stuff, all forcing rpm rpm be recompiled. The change was supposed to be to macros (and %patch)... I haven't a clue anymore (because of the number of flip-flops) how patches are applied by rpmbuild. Can the #ifndef DYING sections perhaps be finally deleted instead? ... I just changed both for consistency, until dead. --anders __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/ macros.in
Jeff Johnson wrote: Fussing with --fuzz opens up a world of pain and voids the warranty of %patch macros. Right, so that's why I left the default as -1 (which translates to 2) rather than changing the default to the stricter 0 as done elsewhere. If you want pain, try #%patchN in spec files. Yup, learned the hard way to comment my %patchN as #patchN instead. Using %% would have worked too, I suppose, but wasn't what I was doing. I'm unable to convince myself that burying New Fangled Secret Sauce Switches internally to the rpmbuild parser is in anyone's interest whatsoever. I only added it to the rpmbuild parser for completeness, should the dying parser could ever be used. The main path is through the macro ? There certainly has been nothing stopping use of %{PATCHn} within % prep (and any other spec file section, %patch was traditionally %prep-only) as %{__patch} --whatever --bleeping --options --you --wish %{PATCHn} Right, and this is useful when e.g. doing a runtime sed on the patch... Maybe editing specs would have been better than trusting a runtime setting. Contrast the aesthetics of that naked shell line with the Secret Sauce %patchN --revetahw --gnipeelb --snoitpo --uoy --hsiw for a net gain of perhaps sizeof( %{PATCHn}) in the amount of typing effort and a net loss (because hardly standard or documented within rpmbuild) of portability and utility. But whatever ... if you want the gain of --fuzz, you can have the pain too. All that was added was a optional default parameter to %{__patch}. :-) One could have just defined %__patch macro as patch -F0 instead, but. --anders __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c rpm/ macros.in
Fussing with --fuzz opens up a world of pain and voids the warranty of %patch macros. If you want pain, try #%patchN in spec files. I'm unable to convince myself that burying New Fangled Secret Sauce Switches internally to the rpmbuild parser is in anyone's interest whatsoever. There certainly has been nothing stopping use of %{PATCHn} within %prep (and any other spec file section, %patch was traditionally %prep-only) as %{__patch} --whatever --bleeping --options --you --wish %{PATCHn} Contrast the aesthetics of that naked shell line with the Secret Sauce %patchN --revetahw --gnipeelb --snoitpo --uoy --hsiw for a net gain of perhaps sizeof( %{PATCHn}) in the amount of typing effort and a net loss (because hardly standard or documented within rpmbuild) of portability and utility. But whatever ... if you want the gain of --fuzz, you can have the pain too. 73 de Jeff On Oct 19, 2008, at 12:50 PM, Anders F. Björklund wrote: RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Anders F. Björklund Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 19-Oct-2008 18:50:04 Branch: HEAD Handle: 2008101916500300 Modified files: rpm CHANGES macros.in rpm/build parsePrep.c Log: add default patch fuzz macro Summary: RevisionChanges Path 1.2620 +1 -0 rpm/CHANGES 2.125 +4 -3 rpm/build/parsePrep.c 1.259 +6 -2 rpm/macros.in patch -p0 '@@ .' Index: rpm/CHANGES = = = = = = == $ cvs diff -u -r1.2619 -r1.2620 CHANGES --- rpm/CHANGES19 Oct 2008 07:46:48 - 1.2619 +++ rpm/CHANGES19 Oct 2008 16:50:03 - 1.2620 @@ -1,5 +1,6 @@ 5.2a2 - 5.2a3: +- rpm.org: add %{_default_patch_fuzz} macro for patch --fuzz - afb: make buildroot path configurable, but keep old defaults - rpm.org: add %{_buildrootdir} macro for use with %{buildroot} @@ . patch -p0 '@@ .' Index: rpm/build/parsePrep.c = = = = = = == $ cvs diff -u -r2.124 -r2.125 parsePrep.c --- rpm/build/parsePrep.c 3 Aug 2008 14:00:58 - 2.124 +++ rpm/build/parsePrep.c 19 Oct 2008 16:50:03 - 2.125 @@ -71,7 +71,7 @@ * @param db saved file suffix (i.e. patch --suffix argument) * @param reverse include -R? * @param removeEmpties include -E? - * @param fuzzinclude -F? + * @param fuzzinclude -F? (fuzz0 means no) * @param subdir sub-directory (i.e patch -d argument); * @returnexpanded %patch macro (NULL on error) */ @@ -99,7 +99,7 @@ #endif if (subdir) t = stpcpy( stpcpy(t, -d ), subdir); -if (fuzz) { +if (fuzz = 0) { t = stpcpy(t, -F ); sprintf(t, %10.10d, fuzz); t += strlen(t); @@ -527,7 +527,8 @@ int patch_index, x; memset(patch_nums, 0, sizeof(patch_nums)); -opt_P = opt_p = opt_R = opt_E = opt_F = 0; +opt_P = opt_p = opt_R = opt_E = 0; +opt_F = rpmExpandNumeric(%{?_default_patch_fuzz}%{!? _default_patch_fuzz:-1}); opt_b = NULL; opt_d = NULL; patch_index = 0; @@ . patch -p0 '@@ .' Index: rpm/macros.in = = = = = = == $ cvs diff -u -r1.258 -r1.259 macros.in --- rpm/macros.in 19 Oct 2008 07:46:48 - 1.258 +++ rpm/macros.in 19 Oct 2008 16:50:03 - 1.259 @@ -1,7 +1,7 @@ #/*! \page config_macros Default configuration: @USRLIBRPM@/macros # \verbatim # -# $Id: macros.in,v 1.258 2008/10/19 07:46:48 afb Exp $ +# $Id: macros.in,v 1.259 2008/10/19 16:50:03 afb Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -378,6 +378,9 @@ # #%vendor +# Default fuzz level for %patch in spec file. +#%_default_patch_fuzz -1 + #= = = = = = = = == # Build configuration macros. # @@ -402,8 +405,9 @@ %define __patch_number %{-P:%{-P*}}%{!-P:0} \ %define __patch_file%{P:%{__patch_number}} \ %define __patch_suffix %{-b:-b --suffix %{-b*}} %{-z:--suffix %{- z*}} \ +%define __patch_fuzz%{?_default_patch_fuzz:%(test % {_default_patch_fuzz} -ge 0 echo --fuzz=%{_default_patch_fuzz} )} \ %define __patch_options -s %{-p:-p%{-p*}} %{-F:-F%{-F*}} %{-d:-d%{- d*}} %{-R} %{-E} %{__patch_suffix} \ -echo
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c
This brings up something we've discussed here at Wind River. Would it be possible to make %setup and/or %patch into macros (perhaps using lua?) (I'm thinking for rpm5 - HEAD, not 4_5.) The reason we're interested is that we have mechanisms that track patches being applied (think quilt), and would like to tap in and track source expansion and patch applying so that we can write a tool that allows a user to be able to modify the sources, generate a patch and automatically update the spec file. --Mark Ralf S. Engelschall wrote: RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Ralf S. Engelschall Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 21-Jun-2007 15:53:44 Branch: HEAD Handle: 2007062114534400 Modified files: rpm CHANGES rpm/build parsePrep.c Log: Although %setup and %patch look like regular RPM macros on the first spot they are not real macros, of course. Instead they are parsed and treated very special by RPM internally. Unfortunately, this internal handling didn't allow for any leading whitespaces in front of %setup and %patch in *.spec files. This is a problem if one uses ultra strictly formatted .spec files (as we do in OpenPKG) where all section content is consequently indented. Hence for cosmetics and consistency addicts like me this short-coming in the parsing of %setup and %patch was never acceptable, so I applied this little change to the OpenPKG RPM since six years now. I think it will not cause trouble, but better to let it be reviewed by others first. Summary: RevisionChanges Path 1.1386 +1 -0 rpm/CHANGES 2.73+7 -4 rpm/build/parsePrep.c patch -p0 '@@ .' Index: rpm/CHANGES $ cvs diff -u -r1.1385 -r1.1386 CHANGES --- rpm/CHANGES 21 Jun 2007 12:25:43 - 1.1385 +++ rpm/CHANGES 21 Jun 2007 13:53:44 - 1.1386 @@ -1,4 +1,5 @@ 4.5 - 5.0: +- rse: allow leading whitespaces on %setup and %patch lines in *.spec files - rse: resolve portability issue related to double definition of mergesort(3) - rse: fix building under UnixWare (blind port) - rse: fix building under FreeBSD 7-CURRENT @@ . patch -p0 '@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.72 -r2.73 parsePrep.c --- rpm/build/parsePrep.c 19 Jun 2007 13:48:44 - 2.72 +++ rpm/build/parsePrep.c 21 Jun 2007 13:53:44 - 2.73 @@ -674,6 +674,7 @@ int nextPart, res, rc; StringBuf sb; char **lines, **saveLines; +char *cp; if (spec-prep != NULL) { rpmError(RPMERR_BADSPEC, _(line %d: second %%prep\n), spec-lineNum); @@ -713,11 +714,13 @@ /[EMAIL PROTECTED]@*/ for (lines = saveLines; *lines; lines++) { res = 0; + for (cp = *lines; *cp == ' ' || *cp == '\t'; cp++) + ; /[EMAIL PROTECTED]@*/ - if (! strncmp(*lines, %setup, sizeof(%setup)-1)) { - res = doSetupMacro(spec, *lines); - } else if (! strncmp(*lines, %patch, sizeof(%patch)-1)) { - res = doPatchMacro(spec, *lines); + if (! strncmp(cp, %setup, sizeof(%setup)-1)) { + res = doSetupMacro(spec, cp); + } else if (! strncmp(cp, %patch, sizeof(%patch)-1)) { + res = doPatchMacro(spec, cp); } else { appendLineStringBuf(spec-prep, *lines); } @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repository[EMAIL PROTECTED] __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c
On Jun 21, 2007, at 12:42 PM, Mark Hatle wrote: This brings up something we've discussed here at Wind River. Would it be possible to make %setup and/or %patch into macros (perhaps using lua?) (I'm thinking for rpm5 - HEAD, not 4_5.) Why ask for a buttload of legacy pain? Just use names other than % setup/%patch. FWIW, the major flaw in %setup is how %buildsubdir is set using %setup -q -n foo-X.Y.Z A different means to set %buildsubdir needs to be done. And the major flaw in %patchN is the N in the name, so there is no abstraction possible. What should have been done instead of clutterning the name space with %patchN is to force %patch -P n usage instead. Way too late for change, now was too late in 1998. The reason we're interested is that we have mechanisms that track patches being applied (think quilt), and would like to tap in and track source expansion and patch applying so that we can write a tool that allows a user to be able to modify the sources, generate a patch and automatically update the spec file. Yep. applying patches using patch invocations is so so so 1990's. 73 de Jeff __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c
While there's nothing wrong withe your patch, there's simply no reason not to just pass *all* patch options directly to patch. That dumps a bunch of silly code from rpmbuild. The reason for the parsePrep.c jiggery pokery is transparently remapping ancient patch's CLI option change that was encoded in %patch syntax to the new (heh, now 7+ year old) patch-2.5. There's no reason why the return code of patch execution with bogus arguments cannot be substituted for the feeble syntax checks imho. Yes I should have done that implementation instead of tricking Panu into adding a -F patch for rpm-4.4.2.1 ;-) 73 de Jeff On Jun 21, 2007, at 2:08 PM, Ralf S. Engelschall wrote: RPM Package Manager, CVS Repository http://rpm5.org/cvs/ __ __ Server: rpm5.org Name: Ralf S. Engelschall Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 21-Jun-2007 20:08:38 Branch: HEAD Handle: 2007062119083701 Modified files: rpm CHANGES rpm/build parsePrep.c Log: Improve %setup and %patch: 1. Let %setup use the existing %{__tar} macro (instead of hard- coding a simple tar) and let %patch use the existing %{__patch} macro (instead of hard-coding a simple patch) in order to allow one to specify particular absolute paths to tar(1) and patch(1) via macros file. 2. Add support for patch(1)'s -d option (for changing into a sub-dir before applying the patch) in %patch macros. PS: The expansion of %{__tar} and %{__patch} soon might be replaced with a more elegant approach, too. Summary: RevisionChanges Path 1.1388 +2 -0 rpm/CHANGES 2.74+42 -10 rpm/build/parsePrep.c __ __ patch -p0 '@@ .' Index: rpm/CHANGES == == $ cvs diff -u -r1.1387 -r1.1388 CHANGES --- rpm/CHANGES 21 Jun 2007 15:55:29 - 1.1387 +++ rpm/CHANGES 21 Jun 2007 18:08:37 - 1.1388 @@ -1,4 +1,6 @@ 4.5 - 5.0: +- rse: allow actually used tar(1) and patch(1) tools to be set via %__tar and %__patch +- rse: add support for patch(1)'s -d option to internal macro %patch - fray: allow -bb --short-circuit - rse: allow leading whitespaces on %setup and %patch lines in *.spec files - rse: resolve portability issue related to double definition of mergesort(3) @@ . patch -p0 '@@ .' Index: rpm/build/parsePrep.c == == $ cvs diff -u -r2.73 -r2.74 parsePrep.c --- rpm/build/parsePrep.c 21 Jun 2007 13:53:44 - 2.73 +++ rpm/build/parsePrep.c 21 Jun 2007 18:08:38 - 2.74 @@ -68,7 +68,7 @@ /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ static char *doPatch(Spec spec, int c, int strip, const char *db, - int reverse, int removeEmpties, int fuzz) + int reverse, int removeEmpties, int fuzz, const char *subdir) /[EMAIL PROTECTED] rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /[EMAIL PROTECTED] rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -78,6 +78,7 @@ struct Source *sp; rpmCompressedMagic compressed = COMPRESSED_NOT; int urltype; +const char *patch; *t = '\0'; if (db) { @@ -86,6 +87,8 @@ #endif t = stpcpy( stpcpy(t, --suffix ), db); } +if (subdir) + t = stpcpy( stpcpy(t, -d ), subdir); if (fuzz) { t = stpcpy(t, -F ); sprintf(t, %10.10d, fuzz); @@ -129,6 +132,10 @@ /[EMAIL PROTECTED]@*/ break; } +patch = rpmGetPath(%{__patch}, NULL); +if (strcmp(patch, %{__patch}) == 0) +patch = patch; + if (compressed) { const char *zipper; @@ -153,22 +160,23 @@ sprintf(buf, echo \Patch #%d (%s):\\n - %s -d '%s' | patch -p%d %s -s\n + %s -d '%s' | %s -p%d %s -s\n STATUS=$?\n if [ $STATUS -ne 0 ]; then\n exit $STATUS\n fi, c, /[EMAIL PROTECTED]@*/ (const char *) basename(fn), /[EMAIL PROTECTED]@*/ zipper, - fn, strip, args); + fn, patch, strip, args); zipper = _free(zipper); } else { sprintf(buf, echo \Patch #%d (%s):\\n - patch -p%d %s -s '%s', c, (const char *) basename(fn), - strip, args, fn); + %s -p%d %s -s '%s', c, (const char *) basename(fn), + patch, strip, args, fn);
Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parsePrep.c
On Thu, Jun 21, 2007, Jeff Johnson wrote: While there's nothing wrong withe your patch, there's simply no reason not to just pass *all* patch options directly to patch. That dumps a bunch of silly code from rpmbuild. The reason for the parsePrep.c jiggery pokery is transparently remapping ancient patch's CLI option change that was encoded in %patch syntax to the new (heh, now 7+ year old) patch-2.5. There's no reason why the return code of patch execution with bogus arguments cannot be substituted for the feeble syntax checks imho. Ah, I see your point now. Well, we really could change this and fully pass through simply everything to patch(1), yes. I see no reason why not. Sounds reasonable. Well, Jeff, then just do it, please. Ralf S. Engelschall [EMAIL PROTECTED] www.engelschall.com __ RPM Package Managerhttp://rpm5.org Developer Communication Listrpm-devel@rpm5.org