Ver código fonte

libdpkg: Rename informative to pkg_is_informative

Guillem Jover 15 anos atrás
pai
commit
a3dd7c6101

+ 7 - 5
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).

+ 1 - 1
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

+ 1 - 1
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);

+ 2 - 1
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)

+ 1 - 1
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;

+ 3 - 3
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. */
 }

+ 2 - 2
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 {