Hello community, here is the log from the commit of package net-snmp for openSUSE:Factory checked in at Thu May 19 16:06:34 CEST 2011.
-------- --- net-snmp/net-snmp.changes 2011-05-12 16:47:31.000000000 +0200 +++ /mounts/work_src_done/STABLE/net-snmp/net-snmp.changes 2011-05-19 14:43:36.000000000 +0200 @@ -1,0 +2,5 @@ +Thu May 19 14:43:13 CEST 2011 - [email protected] + +- switch from rpmdb to rpmts to support rpm-4.9.0 + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- net-snmp-5.6.1-rpm490.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ net-snmp.spec ++++++ --- /var/tmp/diff_new_pack.IMtM4J/_old 2011-05-19 16:05:45.000000000 +0200 +++ /var/tmp/diff_new_pack.IMtM4J/_new 2011-05-19 16:05:45.000000000 +0200 @@ -28,7 +28,7 @@ Name: net-snmp Version: 5.6.1 -Release: 8 +Release: 10 License: BSD3c(or similar) ; MIT License (or similar) Group: Productivity/Networking/Other BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -65,6 +65,7 @@ Patch7: net-snmp-5.5.0-velocity-mib.patch Patch9: net-snmp-5.6.0-enable-hrh-filesys.patch Patch10: net-snmp-5.6.1-recognize-jfs-and-xfs.patch +Patch11: net-snmp-5.6.1-rpm490.patch # Summary: SNMP Daemon @@ -208,6 +209,7 @@ %patch7 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 %build MIBS="misc/ipfwacc ucd-snmp/diskio etherlike-mib rmon-mib velocity smux \ ++++++ net-snmp-5.6.1-rpm490.patch ++++++ --- net-snmp-5.6.1/agent/mibgroup/host/data_access/swinst_rpm.c.orig 2011-05-19 13:09:07.000000000 +0000 +++ net-snmp-5.6.1/agent/mibgroup/host/data_access/swinst_rpm.c 2011-05-19 13:13:43.000000000 +0000 @@ -34,6 +34,7 @@ #endif #ifdef HAVE_RPM_RPMDB_H #include <rpm/rpmdb.h> +#include <rpm/rpmts.h> #endif #include <net-snmp/net-snmp-includes.h> @@ -96,9 +97,9 @@ netsnmp_swinst_arch_shutdown(void) int netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags) { - rpmdb db; + rpmts ts; -#if defined(RPMDBI_PACKAGES) +#if 1 /* defined(RPMDBI_PACKAGES) */ rpmdbMatchIterator mi; #else int offset; @@ -111,11 +112,12 @@ netsnmp_swinst_arch_load( netsnmp_contai int rc, i = 1; netsnmp_swinst_entry *entry; - if (rpmdbOpen("", &db, O_RDONLY, 0644)) - NETSNMP_LOGONCE((LOG_ERR, "rpmdbOpen() failed\n")); + ts = rpmtsCreate(); + if (rpmtsOpenDB(ts, O_RDONLY)) + NETSNMP_LOGONCE((LOG_ERR, "rpmtsOpenDB() failed\n")); -#if defined(RPMDBI_PACKAGES) - mi = rpmdbInitIterator( db, RPMDBI_PACKAGES, NULL, 0); +#if 1 /* defined(RPMDBI_PACKAGES) */ + mi = rpmtsInitIterator( ts, RPMDBI_PACKAGES, NULL, 0); while (NULL != (h = rpmdbNextIterator( mi ))) #else for (offset = rpmdbFirstRecNum( db ); @@ -129,7 +131,7 @@ netsnmp_swinst_arch_load( netsnmp_contai continue; /* error already logged by function */ rc = CONTAINER_INSERT(container, entry); -#if defined(RPMDBI_PACKAGES) +#if 1 /* defined(RPMDBI_PACKAGES) */ h = headerLink( h ); #else h = rpmdbGetRecord( db, offset ); @@ -154,10 +156,11 @@ netsnmp_swinst_arch_load( netsnmp_contai headerFree( h ); } -#if defined(RPMDBI_PACKAGES) +#if 1 /* defined(RPMDBI_PACKAGES) */ rpmdbFreeIterator( mi ); #endif - rpmdbClose( db ); + + rpmtsFree( ts ); DEBUGMSGTL(("swinst:load:arch", "loaded %d entries\n", (int)CONTAINER_SIZE(container))); --- net-snmp-5.6.1/agent/mibgroup/host/hr_swinst.c.orig 2011-05-19 12:33:25.000000000 +0000 +++ net-snmp-5.6.1/agent/mibgroup/host/hr_swinst.c 2011-05-19 13:01:12.000000000 +0000 @@ -43,6 +43,7 @@ #ifdef HAVE_LIBRPM #include <rpm/rpmlib.h> #include <rpm/header.h> +#include <rpm/rpmts.h> #include <fcntl.h> #ifdef HAVE_RPM_RPMFILEUTIL_H @@ -113,7 +114,7 @@ typedef struct { int swi_maxrec; /* no. of allocations */ int swi_nrec; /* no. of valid offsets */ int *swi_recs; /* db record offsets */ - rpmdb swi_rpmdb; + rpmts swi_rpmts; Header swi_h; int swi_prevx; #else @@ -567,10 +568,11 @@ Check_HRSW_cache(void *xxx) int ix = 0; int offset; -#if defined(RPMDBI_PACKAGES) + +#if 1 /* defined(RPMDBI_PACKAGES) */ rpmdbMatchIterator mi = NULL; Header h; - mi = rpmdbInitIterator(swi->swi_rpmdb, RPMDBI_PACKAGES, NULL, 0); + mi = rpmtsInitIterator(swi->swi_rpmts, RPMDBI_PACKAGES, NULL, 0); while ((h = rpmdbNextIterator(mi)) != NULL) { offset = rpmdbGetIteratorOffset(mi); #else @@ -588,7 +590,7 @@ Check_HRSW_cache(void *xxx) } swi->swi_recs[ix++] = offset; -#if !defined(RPMDBI_PACKAGES) +#if 0 /* !defined(RPMDBI_PACKAGES) */ } #else } @@ -607,10 +609,14 @@ Init_HR_SWInst(void) swi->swi_index = 0; #ifdef HAVE_LIBRPM - if (swi->swi_rpmdb != NULL) + if (swi->swi_rpmts != NULL) return; - if (rpmdbOpen("", &swi->swi_rpmdb, O_RDONLY, 0644) != 0) + swi->swi_rpmts = rpmtsCreate(); + if (rpmtsOpenDB(swi->swi_rpmts, O_RDONLY)) { + rpmtsFree(swi->swi_rpmts); + swi->swi_rpmts = 0; swi->swi_index = -1; + } Check_HRSW_cache(swi); #else if (swi->swi_directory != NULL) { @@ -673,10 +679,10 @@ Save_HR_SW_info(int ix) offset = swi->swi_recs[ix - 1]; -#if defined(RPMDBI_PACKAGES) +#if 1 /* defined(RPMDBI_PACKAGES) */ { rpmdbMatchIterator mi; - mi = rpmdbInitIterator(swi->swi_rpmdb, RPMDBI_PACKAGES, + mi = rpmtsInitIterator(swi->swi_rpmts, RPMDBI_PACKAGES, &offset, sizeof(offset)); if ((h = rpmdbNextIterator(mi)) != NULL) h = headerLink(h); @@ -737,8 +743,8 @@ End_HR_SWInst(void) SWI_t *swi = &_myswi; /* XXX static for now */ #ifdef HAVE_LIBRPM - rpmdbClose(swi->swi_rpmdb); /* or only on finishing ? */ - swi->swi_rpmdb = NULL; + rpmtsFree(swi->swi_rpmts); /* or only on finishing ? */ + swi->swi_rpmts = NULL; #else if (swi->swi_dp != NULL) closedir(swi->swi_dp); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
