- bump popt to version to 1.10.
authorjbj <devnull@localhost>
Thu, 28 Oct 2004 23:57:36 +0000 (23:57 +0000)
committerjbj <devnull@localhost>
Thu, 28 Oct 2004 23:57:36 +0000 (23:57 +0000)
CVS patchset: 7519
CVS date: 2004/10/28 23:57:36

CHANGES
lib/depends.c
lib/rpmte.c
lib/rpmte.h
lib/rpmts.c
lib/rpmts.h
popt/configure.ac
popt/popt.spec
python/Makefile.am
rpm.spec.in

diff --git a/CHANGES b/CHANGES
index db70953..93b2d32 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -25,6 +25,7 @@
        - port to internal file-4.10 libmagic rather than libfmagic.
        - fix: handle non-unique dirnames in rpmalAdd().
        - integrate rpmgi "generic iterator" with query/verify.
+       - bump popt to version to 1.10.
 
 4.3.1 -> 4.3.2:
        - use /etc/selinux/targeted/contexts/files/file_contexts for now.
index 7070323..37ecef3 100644 (file)
@@ -1126,6 +1126,8 @@ static inline int addRelation(rpmts ts,
 
     if (rpmteDepth(p) <= rpmteDepth(q))        /* Save max. depth in dependency tree */
        (void) rpmteSetDepth(p, (rpmteDepth(q) + 1));
+    if (rpmteDepth(p) > ts->maxDepth)
+       ts->maxDepth = rpmteDepth(p);
 
     tsi = xcalloc(1, sizeof(*tsi));
     tsi->tsi_suc = p;
@@ -1225,6 +1227,8 @@ int rpmtsOrder(rpmts ts)
     int newOrderCount = 0;
     orderListIndex orderList;
     int numOrderList;
+    int npeer = 128;   /* XXX more than deep enough for now. */
+    int * peer = memset(alloca(npeer*sizeof(*peer)), 0, (npeer*sizeof(*peer)));
     int nrescans = 10;
     int _printed = 0;
     char deptypechar;
@@ -1232,6 +1236,7 @@ int rpmtsOrder(rpmts ts)
     int oType = 0;
     int treex;
     int depth;
+    int breadth;
     int qlen;
     int i, j;
 
@@ -1340,6 +1345,7 @@ int rpmtsOrder(rpmts ts)
        npreds = rpmteTSI(p)->tsi_count;
 
        (void) rpmteSetNpreds(p, npreds);
+       (void) rpmteSetDepth(p, 1);
 
        if (npreds == 0)
            (void) rpmteSetTree(p, treex++);
@@ -1351,9 +1357,10 @@ int rpmtsOrder(rpmts ts)
 
     }
     pi = rpmtsiFree(pi);
+    ts->ntrees = treex;
 
     /* T4. Scan for zeroes. */
-    rpmMessage(RPMMESS_DEBUG, _("========== tsorting packages (order, #predecessors, #succesors, tree, depth)\n"));
+    rpmMessage(RPMMESS_DEBUG, _("========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)\n"));
 
 rescan:
     if (pi != NULL) pi = rpmtsiFree(pi);
@@ -1396,15 +1403,19 @@ rescan:
        }
        deptypechar = (rpmteType(q) == TR_REMOVED ? '-' : '+');
 
-       rpmMessage(RPMMESS_DEBUG, "%5d%5d%5d%5d%5d %*s%c%s\n",
+       treex = rpmteTree(q);
+       depth = rpmteDepth(q);
+       breadth = ((depth < npeer) ? peer[depth]++ : 0);
+       (void) rpmteSetBreadth(q, breadth);
+
+       rpmMessage(RPMMESS_DEBUG, "%5d%5d%5d%5d%5d%5d %*s%c%s\n",
                        orderingCount, rpmteNpreds(q),
-                       rpmteTSI(q)->tsi_qcnt, rpmteTree(q), rpmteDepth(q),
-                       (2 * rpmteDepth(q)), "",
+                       rpmteTSI(q)->tsi_qcnt,
+                       treex, depth, breadth,
+                       (2 * depth), "",
                        deptypechar,
                        (rpmteNEVRA(q) ? rpmteNEVRA(q) : "???"));
 
-       treex = rpmteTree(q);
-       depth = rpmteDepth(q);
        (void) rpmteSetDegree(q, 0);
        tsbytes += rpmtePkgFileSize(q);
 
index dab00a8..e4961dc 100644 (file)
@@ -339,6 +339,21 @@ int rpmteSetDepth(rpmte te, int ndepth)
     return odepth;
 }
 
+int rpmteBreadth(rpmte te)
+{
+    return (te != NULL ? te->depth : 0);
+}
+
+int rpmteSetBreadth(rpmte te, int nbreadth)
+{
+    int obreadth = 0;
+    if (te != NULL) {
+       obreadth = te->breadth;
+       te->breadth = nbreadth;
+    }
+    return obreadth;
+}
+
 int rpmteNpreds(rpmte te)
 {
     return (te != NULL ? te->npreds : 0);
index 68410f1..724ab24 100644 (file)
@@ -83,9 +83,10 @@ struct rpmte_s {
 
     rpmte parent;              /*!< Parent transaction element. */
     int degree;                        /*!< No. of immediate children. */
-    int depth;                 /*!< Max. depth in dependency tree. */
     int npreds;                        /*!< No. of predecessors. */
     int tree;                  /*!< Tree index. */
+    int depth;                 /*!< Depth in dependency tree. */
+    int breadth;               /*!< Breadth in dependency tree. */
     unsigned int db_instance;   /*!< Database Instance after add */
 /*@owned@*/
     tsortInfo tsi;             /*!< Dependency ordering chains. */
@@ -307,7 +308,7 @@ uint_32 rpmtePkgFileSize(rpmte te)
        /*@*/;
 
 /**
- * Retrieve tsort tree depth of transaction element.
+ * Retrieve dependency tree depth of transaction element.
  * @param te           transaction element
  * @return             depth
  */
@@ -315,7 +316,7 @@ int rpmteDepth(rpmte te)
        /*@*/;
 
 /**
- * Set tsort tree depth of transaction element.
+ * Set dependency tree depth of transaction element.
  * @param te           transaction element
  * @param ndepth       new depth
  * @return             previous depth
@@ -324,6 +325,23 @@ int rpmteSetDepth(rpmte te, int ndepth)
        /*@modifies te @*/;
 
 /**
+ * Retrieve dependency tree breadth of transaction element.
+ * @param te           transaction element
+ * @return             breadth
+ */
+int rpmteBreadth(rpmte te)
+       /*@*/;
+
+/**
+ * Set dependency tree breadth of transaction element.
+ * @param te           transaction element
+ * @param nbreadth     new breadth
+ * @return             previous breadth
+ */
+int rpmteSetBreadth(rpmte te, int nbreadth)
+       /*@modifies te @*/;
+
+/**
  * Retrieve tsort no. of predecessors of transaction element.
  * @param te           transaction element
  * @return             no. of predecessors
index db52683..54e16c7 100644 (file)
@@ -767,6 +767,8 @@ void rpmtsEmpty(rpmts ts)
     pi = rpmtsiFree(pi);
 
     ts->orderCount = 0;
+    ts->ntrees = 0;
+    ts->maxDepth = 0;
 
     ts->numRemovedPackages = 0;
 /*@-nullstate@*/       /* FIX: partial annotations */
@@ -1519,6 +1521,8 @@ rpmts rpmtsCreate(void)
     ts->orderAlloced = 0;
     ts->orderCount = 0;
     ts->order = NULL;
+    ts->ntrees = 0;
+    ts->maxDepth = 0;
 
     ts->probs = NULL;
 
index f209c7d..64ec136 100644 (file)
@@ -294,6 +294,8 @@ struct rpmts_s {
     int orderCount;            /*!< No. of transaction elements. */
     int orderAlloced;          /*!< No. of allocated transaction elements. */
     int unorderedSuccessors;   /*!< Index of 1st element of successors. */
+    int ntrees;                        /*!< No. of dependency trees. */
+    int maxDepth;              /*!< Maximum depth of dependency tree(s). */
 
     int selinuxEnabled;                /*!< Is SE linux enabled? */
     int chrootDone;            /*!< Has chroot(2) been been done? */
index ac8f764..5935014 100755 (executable)
@@ -2,7 +2,7 @@ AC_INIT(popt.h)
 AC_CANONICAL_SYSTEM
 AC_PREREQ(2.12)
 AC_CONFIG_HEADERS
-AM_INIT_AUTOMAKE(popt, 1.9)
+AM_INIT_AUTOMAKE(popt, 1.10)
 AM_CONFIG_HEADER(config.h)
 
 ALL_LINGUAS="cs da de es eu_ES fi fr gl hu id is it ja ko no pl pt pt_BR ro ru sk sl sr sv tr uk wa zh zh_CN.GB2312"
index f84fabd..df33aaa 100644 (file)
@@ -4,9 +4,9 @@
 #
 Summary: A C library for parsing command line parameters.
 Name: popt
-Version: 1.9
+Version: 1.10
 Release: 0.1
-Copyright: X Consortium
+License: X Consortium
 Group: System Environment/Libraries
 Source: ftp://ftp.redhat.com/pub/redhat/code/popt/popt-%{version}.tar.gz
 BuildRoot: /var/tmp/%{name}root
index 3cb04ea..4e7ea38 100644 (file)
@@ -7,7 +7,7 @@ LINT = splint
 pylibdir = ${prefix}/lib@MARK64@/python@WITH_PYTHON_VERSION@
 pyincdir = $(prefix)/include/python@WITH_PYTHON_VERSION@
 
-SUBDIRS = rpmdb rpm
+SUBDIRS = rpmdb rpm
 
 EXTRA_DIST = system.h rpmdebug-py.c
 
@@ -38,16 +38,16 @@ mylibs= \
 LDADD =
 
 pythondir = $(pylibdir)/site-packages
-python_LTLIBRARIES = poptmodule.la
+python_LTLIBRARIES = rpmmodule.la poptmodule.la
 
-rpmdir = $(pylibdir)/site-packages/rpm
-rpm_LTLIBRARIES = _rpmmodule.la
+#rpmdir = $(pylibdir)/site-packages/rpm
+#rpm_LTLIBRARIES = rpmmodule.la
 
 rpmdbdir = $(pylibdir)/site-packages/rpmdb
 rpmdb_LTLIBRARIES = _rpmdb.la
 
-_rpmmodule_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version
-_rpmmodule_la_LIBADD =  @WITH_BEECRYPT_LIB@
+rpmmodule_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version
+rpmmodule_la_LIBADD =  @WITH_BEECRYPT_LIB@
 
 _rpmdb_la_SOURCES = _rpmdb.c
 _rpmdb_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version
@@ -55,7 +55,7 @@ _rpmdb_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version
 poptmodule_la_SOURCES = poptmodule.c
 poptmodule_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version
 
-_rpmmodule_la_SOURCES = rpmmodule.c header-py.c \
+rpmmodule_la_SOURCES = rpmmodule.c header-py.c \
                       rpmal-py.c rpmds-py.c rpmdb-py.c rpmfd-py.c rpmfts-py.c \
                       rpmfi-py.c rpmmi-py.c rpmps-py.c rpmrc-py.c rpmte-py.c \
                       rpmts-py.c spec-py.c
index 9c782ca..bbca6f4 100644 (file)
@@ -28,7 +28,7 @@ Conflicts: patch < 2.5
 %ifos linux
 Prereq: fileutils shadow-utils
 %endif
-Requires: popt = 1.9
+Requires: popt = 1.10
 Obsoletes: rpm-perl < %{version}
 
 # XXX necessary only to drag in /usr/lib/libelf.a, otherwise internal elfutils.
@@ -110,7 +110,7 @@ programs that will manipulate RPM packages and databases.
 %package -n popt
 Summary: A C library for parsing command line parameters.
 Group: Development/Libraries
-Version: 1.9
+Version: 1.10
 
 %description -n popt
 Popt is a C library for parsing command line parameters. Popt was