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: 24-Mar-2009 20:04:37 Branch: rpm-5_1 Handle: 2009032419043600 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/rpmdb rpmdb.c Log: - rpmdb: don't bother with the silly structure assignment initialize. Summary: Revision Changes Path 1.2288.2.238+1 -0 rpm/CHANGES 1.246.2.8 +14 -30 rpm/rpmdb/rpmdb.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2288.2.237 -r1.2288.2.238 CHANGES --- rpm/CHANGES 24 Mar 2009 18:01:17 -0000 1.2288.2.237 +++ rpm/CHANGES 24 Mar 2009 19:04:36 -0000 1.2288.2.238 @@ -1,4 +1,5 @@ 5.1.7 -> 5.1.8: + - jbj: rpmdb: don't bother with the silly structure assignment initialize. - jbj: yarn: wire up rpmdsFini, mark rpmdsFree for destruction. - jbj: yarn: wire up rpmtsFini, mark rpmtsFree for destruction. - jbj: yarn: for now, don't assert fail, just print FIXME. @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmdb.c ============================================================================ $ cvs diff -u -r1.246.2.7 -r1.246.2.8 rpmdb.c --- rpm/rpmdb/rpmdb.c 20 Mar 2009 19:13:23 -0000 1.246.2.7 +++ rpm/rpmdb/rpmdb.c 24 Mar 2009 19:04:36 -0000 1.246.2.8 @@ -915,23 +915,6 @@ return 0; } -#define _DB_ROOT "/" -#define _DB_HOME "%{?_dbpath}" -#define _DB_FLAGS 0 -#define _DB_MODE 0 -#define _DB_PERMS 0644 - -#define _DB_MAJOR -1 -#define _DB_ERRPFX "rpmdb" - -/*...@-fullinitblock@*/ -/*...@observer@*/ /*...@unchecked@*/ -static struct rpmdb_s dbTemplate = { { NULL, NULL}, - _DB_ROOT, _DB_HOME, _DB_FLAGS, _DB_MODE, _DB_PERMS, - _DB_MAJOR, _DB_ERRPFX -}; -/*...@=fullinitblock@*/ - /*...@unchecked@*/ /*...@null@*/ rpmioPool _rpmdbPool; @@ -1159,8 +1142,16 @@ return fn; } +#define _DB_ROOT "/" +#define _DB_HOME "%{?_dbpath}" +#define _DB_FLAGS 0 +#define _DB_MODE 0 +#define _DB_PERMS 0644 + +#define _DB_MAJOR -1 +#define _DB_ERRPFX "rpmdb" + /*...@-exportheader@*/ -/*...@-globs -mods -incond...@*/ /* FIX: dbTemplate structure assignment */ /*...@only@*/ /*...@null@*/ rpmdb rpmdbNew(/*...@kept@*/ /*...@null@*/ const char * root, /*...@kept@*/ /*...@null@*/ const char * home, @@ -1182,22 +1173,16 @@ oneshot = 1; } - { void * use = db->_item.use; - void * pool = db->_item.pool; - /*...@-assignexpose@*/ - *db = dbTemplate; /* structure assignment */ - /*...@=assignexpose@*/ - db->_item.pool = pool; - db->_item.use = use; - } + db->db_api = _DB_MAJOR; + db->db_errpfx = _DB_ERRPFX; db->_dbi = NULL; if (!(perms & 0600)) perms = 0644; /* XXX sanity */ - if (mode >= 0) db->db_mode = mode; - if (perms >= 0) db->db_perms = perms; - if (flags >= 0) db->db_flags = flags; + db->db_mode = (mode >= 0) ? mode : _DB_MODE; + db->db_perms = (perms >= 0) ? perms : _DB_PERMS; + db->db_flags = (flags >= 0) ? flags : _DB_FLAGS; db->db_root = rpmdbURIPath( (root && *root ? root : _DB_ROOT) ); db->db_home = rpmdbURIPath( (home && *home ? home : _DB_HOME) ); @@ -1220,7 +1205,6 @@ return rpmdbLink(db, "rpmdbCreate"); /*...@=globstate@*/ } -/*...@=globs =mods =incond...@*/ /*...@=exportheader@*/ /*...@-exportheader@*/ @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org