The following commit has been merged in the master branch:
commit a3dd7c610183c6f5515d69178b8a848ea1d82b87
Author: Guillem Jover <[email protected]>
Date:   Sun Oct 24 03:16:00 2010 +0200

    libdpkg: Rename informative to pkg_is_informative

diff --git a/dselect/pkgdepcon.cc b/dselect/pkgdepcon.cc
index ca69ec7..267dfaa 100644
--- a/dselect/pkgdepcon.cc
+++ b/dselect/pkgdepcon.cc
@@ -38,7 +38,7 @@ packagelist::useavailable(pkginfo *pkg)
 {
   if (pkg->clientdata &&
       pkg->clientdata->selected == pkginfo::want_install &&
-      informative(pkg,&pkg->available) &&
+      pkg_is_informative(pkg, &pkg->available) &&
       (!(pkg->status == pkginfo::stat_installed ||
          pkg->status == pkginfo::stat_triggersawaited ||
          pkg->status == pkginfo::stat_triggerspending) ||
@@ -133,10 +133,12 @@ static int dep_update_best_to_change_stop(perpackagestate 
*& best, pkginfo *tryt
   if (!best) goto yes;
 
   // If only one of the packages is available, use that one
-  if (!informative(trythis,&trythis->available) &&
-      informative(best->pkg,&best->pkg->available)) return 0;
-  if (informative(trythis,&trythis->available) &&
-      !informative(best->pkg,&best->pkg->available)) goto yes;
+  if (!pkg_is_informative(trythis, &trythis->available) &&
+      pkg_is_informative(best->pkg, &best->pkg->available))
+    return 0;
+  if (pkg_is_informative(trythis, &trythis->available) &&
+      !pkg_is_informative(best->pkg, &best->pkg->available))
+    goto yes;
   
   // Select the package with the lowest priority (ie, the one of whom
   // we were least sure we wanted it deselected).
diff --git a/lib/dpkg/database.c b/lib/dpkg/database.c
index 866c8b0..188132a 100644
--- a/lib/dpkg/database.c
+++ b/lib/dpkg/database.c
@@ -93,7 +93,7 @@ void blankpackageperfile(struct pkginfoperfile *pifp) {
 static int nes(const char *s) { return s && *s; }
 
 bool
-informative(struct pkginfo *pkg, struct pkginfoperfile *info)
+pkg_is_informative(struct pkginfo *pkg, struct pkginfoperfile *info)
 {
   /* Used by dselect and dpkg query options as an aid to decide
    * whether to display things, and by dump to decide whether to write them
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index decd5e5..ee0878b 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -216,7 +216,7 @@ const char *pkgadminfile(struct pkginfo *pkg, const char 
*whichfile);
 void blankpackage(struct pkginfo *pp);
 void blankpackageperfile(struct pkginfoperfile *pifp);
 void blankversion(struct versionrevision*);
-bool informative(struct pkginfo *pkg, struct pkginfoperfile *info);
+bool pkg_is_informative(struct pkginfo *pkg, struct pkginfoperfile *info);
 
 struct pkginfo *pkg_db_find(const char *name);
 int pkg_db_count(void);
diff --git a/lib/dpkg/dump.c b/lib/dpkg/dump.c
index 0d3a587..7980dc1 100644
--- a/lib/dpkg/dump.c
+++ b/lib/dpkg/dump.c
@@ -386,7 +386,8 @@ writedb(const char *filename, bool available, bool mustsync)
   while ((pigp = pkg_db_iter_next(it)) != NULL) {
     pifp= available ? &pigp->available : &pigp->installed;
     /* Don't dump records which have no useful content. */
-    if (!informative(pigp,pifp)) continue;
+    if (!pkg_is_informative(pigp, pifp))
+      continue;
     varbufrecord(&vb,pigp,pifp);
     varbufaddc(&vb,'\n'); varbufaddc(&vb,0);
     if (fputs(vb.buf,file) < 0)
diff --git a/lib/dpkg/libdpkg.Versions b/lib/dpkg/libdpkg.Versions
index 5a5329e..af1e299 100644
--- a/lib/dpkg/libdpkg.Versions
+++ b/lib/dpkg/libdpkg.Versions
@@ -166,7 +166,7 @@ LIBDPKG_PRIVATE {
        blankpackage;
        blankpackageperfile;
        pkg_name_is_illegal;
-       informative;
+       pkg_is_informative;
        copy_dependency_links;
        pkg_sorter_by_name;
        pkg_summary;
diff --git a/lib/dpkg/test/t-pkginfo.c b/lib/dpkg/test/t-pkginfo.c
index dbb3098..3fab78e 100644
--- a/lib/dpkg/test/t-pkginfo.c
+++ b/lib/dpkg/test/t-pkginfo.c
@@ -30,14 +30,14 @@ test_pkginfo_informative(void)
        struct pkginfo pkg;
 
        blankpackage(&pkg);
-       test_fail(informative(&pkg, &pkg.installed));
+       test_fail(pkg_is_informative(&pkg, &pkg.installed));
 
        pkg.want = want_purge;
-       test_pass(informative(&pkg, &pkg.installed));
+       test_pass(pkg_is_informative(&pkg, &pkg.installed));
 
        blankpackage(&pkg);
        pkg.installed.description = "test description";
-       test_pass(informative(&pkg, &pkg.installed));
+       test_pass(pkg_is_informative(&pkg, &pkg.installed));
 
        /* FIXME: Complete. */
 }
diff --git a/src/querycmd.c b/src/querycmd.c
index 8a5a71b..8bd9077 100644
--- a/src/querycmd.c
+++ b/src/querycmd.c
@@ -332,7 +332,7 @@ enqperpackage(const char *const *argv)
           !(pkg->section && *pkg->section) &&
           !pkg->files &&
           pkg->want == want_unknown &&
-          !informative(pkg,&pkg->installed)) {
+          !pkg_is_informative(pkg, &pkg->installed)) {
         fprintf(stderr,_("Package `%s' is not installed and no info is 
available.\n"),pkg->name);
         failures++;
       } else {
@@ -341,7 +341,7 @@ enqperpackage(const char *const *argv)
       break;
 
     case act_printavail:
-      if (!informative(pkg,&pkg->available)) {
+      if (!pkg_is_informative(pkg, &pkg->available)) {
         fprintf(stderr,_("Package `%s' is not available.\n"),pkg->name);
         failures++;
       } else {

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to