RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 13-Jun-2009 04:34:25 Branch: HEAD Handle: 2009061302342401 Modified files: rpm CHANGES rpm/js rpmaug-js.c rpm/rpmio librpmio.vers rpmaug.c rpmaug.h Log: - augeas: add aug_init() and aug_close() calls to the rpmaug wrapper. Summary: Revision Changes Path 1.3021 +1 -0 rpm/CHANGES 1.2 +1 -1 rpm/js/rpmaug-js.c 2.121 +2 -0 rpm/rpmio/librpmio.vers 1.2 +20 -5 rpm/rpmio/rpmaug.c 1.2 +7 -4 rpm/rpmio/rpmaug.h ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3020 -r1.3021 CHANGES --- rpm/CHANGES 12 Jun 2009 19:29:27 -0000 1.3020 +++ rpm/CHANGES 13 Jun 2009 02:34:24 -0000 1.3021 @@ -1,5 +1,6 @@ 5.2b1 -> 5.3a1 + - jbj: augeas: add aug_init() and aug_close() calls to the rpmaug wrapper. - jbj: js: stub-in a Aug class. - jbj: augeas: stub-in rpmaug object with ctors/dtors. - jbj: augeas: add AutoFu to find augeas libraries. @@ . patch -p0 <<'@@ .' Index: rpm/js/rpmaug-js.c ============================================================================ $ cvs diff -u -r1.1 -r1.2 rpmaug-js.c --- rpm/js/rpmaug-js.c 12 Jun 2009 19:29:27 -0000 1.1 +++ rpm/js/rpmaug-js.c 13 Jun 2009 02:34:25 -0000 1.2 @@ -141,7 +141,7 @@ { rpmaug aug; - if ((aug = rpmaugNew(NULL, 0)) == NULL) + if ((aug = rpmaugNew(NULL, NULL, 0)) == NULL) return NULL; if (!JS_SetPrivate(cx, obj, aug)) { /* XXX error msg */ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/librpmio.vers ============================================================================ $ cvs diff -u -r2.120 -r2.121 librpmio.vers --- rpm/rpmio/librpmio.vers 2 Jun 2009 20:53:07 -0000 2.120 +++ rpm/rpmio/librpmio.vers 13 Jun 2009 02:34:25 -0000 2.121 @@ -256,6 +256,8 @@ _RequestPass; Rmdir; _Rmdir; + _rpmaug_debug; + rpmaugNew; rpmbcImplVecs; rpmCleanPath; rpmCLIMacroContext; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmaug.c ============================================================================ $ cvs diff -u -r1.1 -r1.2 rpmaug.c --- rpm/rpmio/rpmaug.c 12 Jun 2009 19:04:34 -0000 1.1 +++ rpm/rpmio/rpmaug.c 13 Jun 2009 02:34:25 -0000 1.2 @@ -4,7 +4,7 @@ #include "system.h" -#if defined(HAVE_AUGEAS_H) +#if defined(WITH_AUGEAS) && defined(HAVE_AUGEAS_H) #include "augeas.h" #endif @@ -27,8 +27,11 @@ rpmaug aug = _aug; #if defined(WITH_AUGEAS) + (void) aug_close(aug->I); + aug->I = NULL; #endif - aug->fn = _free(aug->fn); + aug->root = _free(aug->root); + aug->loadpath = _free(aug->loadpath); } /*...@=mustmod@*/ @@ -49,14 +52,26 @@ return (rpmaug) rpmioGetPool(pool, sizeof(*aug)); } -rpmaug rpmaugNew(const char * fn, int flags) +/*...@unchecked@*/ +static const char _root[] = "/"; +/*...@unchecked@*/ +static const char _loadpath[] = ""; /* XXX /usr/lib/rpm/lib? */ + +rpmaug rpmaugNew(const char * root, const char * loadpath, unsigned int flags) { rpmaug aug = rpmaugGetPool(_rpmaugPool); int xx; - if (fn) - aug->fn = xstrdup(fn); + if (root == NULL) + root = _root; + if (loadpath == NULL) + loadpath = _loadpath; + aug->root = xstrdup(root); + aug->loadpath = xstrdup(loadpath); + aug->flags = flags; #if defined(WITH_AUGEAS) + aug->I = (void *) aug_init(aug->root, aug->loadpath, aug->flags); +assert(aug->I != NULL); #endif return rpmaugLink(aug); @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmaug.h ============================================================================ $ cvs diff -u -r1.1 -r1.2 rpmaug.h --- rpm/rpmio/rpmaug.h 12 Jun 2009 19:04:34 -0000 1.1 +++ rpm/rpmio/rpmaug.h 13 Jun 2009 02:34:25 -0000 1.2 @@ -19,8 +19,9 @@ */ struct rpmaug_s { struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ - const char * fn; - int flags; + const char * root; + const char * loadpath; + unsigned int flags; /*...@relnull@*/ void * I; #if defined(__LCLINT__) @@ -70,12 +71,14 @@ /** * Create and load a augeas wrapper. - * @param fn augeas file + * @param root augeas filesystem root + * @param loadpath augeas load path (colon separated) * @param flags augeas flags * @return new augeas wrapper */ /*...@newref@*/ /*...@null@*/ -rpmaug rpmaugNew(const char * fn, int flags) +rpmaug rpmaugNew(/*...@null@*/ const char * root, /*...@null@*/ const char * loadpath, + unsigned int flags) /*...@globals fileSystem, internalState @*/ /*...@modifies fileSystem, internalState @*/; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org