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: 14-May-2009 22:30:12 Branch: rpm-5_2 Handle: 2009051420301001 Modified files: (Branch: rpm-5_2) rpm CHANGES rpm/lib rpmrc.c Log: make it possible to set macro files to load predefines from by defining PREMACROFILES at build time. Summary: Revision Changes Path 1.2970.2.11 +2 -0 rpm/CHANGES 2.278.2.4 +9 -5 rpm/lib/rpmrc.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2970.2.10 -r1.2970.2.11 CHANGES --- rpm/CHANGES 14 May 2009 20:08:58 -0000 1.2970.2.10 +++ rpm/CHANGES 14 May 2009 20:30:10 -0000 1.2970.2.11 @@ -1,5 +1,7 @@ 5.2a4 -> 5.2b1: + - proyvind: make it possible to set macro files to load predefines from by + defining PREMACROFILES at build time. - proyvind: rpmhash: add htGetKeys() for retrieving the keys of the hash table. - proyvind: rpmsyck: clean up, use rpmioPool and add destructor. - proyvind: remove %distepoch from %provideversion as it will break @@ . patch -p0 <<'@@ .' Index: rpm/lib/rpmrc.c ============================================================================ $ cvs diff -u -r2.278.2.3 -r2.278.2.4 rpmrc.c --- rpm/lib/rpmrc.c 14 May 2009 20:06:49 -0000 2.278.2.3 +++ rpm/lib/rpmrc.c 14 May 2009 20:30:11 -0000 2.278.2.4 @@ -1062,8 +1062,8 @@ * Read macro configuration file(s). * @return 0 on success */ -static int rpmReadRC(void) - /*...@globals defaultsInitialized, rpmMacrofiles, +static int rpmReadRC(const char *macrofiles) + /*...@globals defaultsInitialized, rpmGlobalMacroContext, rpmCLIMacroContext, h_errno, fileSystem, internalState @*/ /*...@modifies defaultsInitialized, rpmGlobalMacroContext, @@ -1077,7 +1077,7 @@ } /* Read macro files. */ - { const char *mfpath = rpmExpand(rpmMacrofiles, NULL); + { const char *mfpath = rpmExpand(macrofiles, NULL); if (mfpath != NULL) { rpmInitMacros(NULL, mfpath); @@ -1090,11 +1090,15 @@ int rpmReadConfigFiles(/*...@unused@*/ const char * file, const char * target) - /*...@globals configTarget @*/ + /*...@globals configTarget, rpmMacrofiles @*/ /*...@modifies configTarget @*/ { mode_t mode = 0022; +#ifdef PREMACROFILES + if (rpmReadRC(PREMACROFILES)) return -1; +#endif + /* Reset umask to its default umask(2) value. */ mode = umask(mode); @@ -1106,7 +1110,7 @@ /* Read the files */ /*...@-globs@*/ - if (rpmReadRC()) return -1; + if (rpmReadRC(rpmMacrofiles)) return -1; /*...@=globs@*/ /* Reset target macros */ @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org