Explorar o código

Rename informativeversion() to dpkg_version_is_informative()

Guillem Jover %!s(int64=14) %!d(string=hai) anos
pai
achega
ada8ee446e
Modificáronse 11 ficheiros con 21 adicións e 16 borrados
  1. 2 2
      dselect/pkglist.cc
  2. 1 1
      dselect/pkgtop.cc
  3. 4 2
      lib/dpkg/dump.c
  4. 1 1
      lib/dpkg/libdpkg.map
  5. 1 1
      lib/dpkg/parsehelp.c
  6. 2 2
      lib/dpkg/pkg.c
  7. 1 1
      lib/dpkg/version.c
  8. 1 1
      lib/dpkg/version.h
  9. 1 1
      src/configure.c
  10. 1 1
      src/depcon.c
  11. 6 3
      src/enquiry.c

+ 2 - 2
dselect/pkglist.cc

@@ -190,7 +190,7 @@ void packagelist::ensurestatsortinfo() {
         break;
       case pkginfo::stat_notinstalled:
       case pkginfo::stat_configfiles:
-        if (!informativeversion(&pkg->available.version)) {
+        if (!dpkg_version_is_informative(&pkg->available.version)) {
           table[index]->ssavail= ssa_notinst_gone;
 // FIXME: Disable for now as a workaround, until dselect knows how to properly
 //        store seen packages.
@@ -205,7 +205,7 @@ void packagelist::ensurestatsortinfo() {
       case pkginfo::stat_installed:
         veri= &table[index]->pkg->installed.version;
         vera= &table[index]->pkg->available.version;
-        if (!informativeversion(vera)) {
+        if (!dpkg_version_is_informative(vera)) {
           table[index]->ssavail= ssa_installed_gone;
         } else if (versioncompare(vera,veri) > 0) {
           table[index]->ssavail= ssa_installed_newer;

+ 1 - 1
dselect/pkgtop.cc

@@ -206,7 +206,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
                 versioninstalled_width, versioninstalled_width,
                 versiondescribe(&pkg->installed.version, vdew_nonambig));
     if (versionavailable_width) {
-      if (informativeversion(&pkg->available.version) &&
+      if (dpkg_version_is_informative(&pkg->available.version) &&
           versioncompare(&pkg->available.version,&pkg->installed.version) > 0)
         wattrset(listpad, part_attr[selected ? selstatesel : selstate]);
       mvwprintw(listpad, screenline, versionavailable_column, "%-*.*s",

+ 4 - 2
lib/dpkg/dump.c

@@ -63,7 +63,8 @@ w_version(struct varbuf *vb,
           const struct pkginfo *pigp, const struct pkgbin *pifp,
           enum fwriteflags flags, const struct fieldinfo *fip)
 {
-  if (!informativeversion(&pifp->version)) return;
+  if (!dpkg_version_is_informative(&pifp->version))
+    return;
   if (flags&fw_printheader)
     varbuf_add_str(vb, "Version: ");
   varbufversion(vb,&pifp->version,vdew_nonambig);
@@ -77,7 +78,8 @@ w_configversion(struct varbuf *vb,
                 enum fwriteflags flags, const struct fieldinfo *fip)
 {
   if (pifp != &pigp->installed) return;
-  if (!informativeversion(&pigp->configversion)) return;
+  if (!dpkg_version_is_informative(&pigp->configversion))
+    return;
   if (pigp->status == stat_installed ||
       pigp->status == stat_notinstalled ||
       pigp->status == stat_triggerspending)

+ 1 - 1
lib/dpkg/libdpkg.map

@@ -178,7 +178,7 @@ LIBDPKG_PRIVATE {
 
 	# Version struct handling
 	dpkg_version_blank;
-	informativeversion;
+	dpkg_version_is_informative;
 	epochsdiffer;
 	versioncompare;
 	versiondescribe;

+ 1 - 1
lib/dpkg/parsehelp.c

@@ -181,7 +181,7 @@ const char *versiondescribe
 
   struct varbuf *vb;
 
-  if (!informativeversion(version))
+  if (!dpkg_version_is_informative(version))
     return C_("version", "<none>");
 
   vb= &bufs[bufnum]; bufnum++; if (bufnum == 10) bufnum= 0;

+ 2 - 2
lib/dpkg/pkg.c

@@ -194,7 +194,7 @@ pkg_is_informative(struct pkginfo *pkg, struct pkgbin *pkgbin)
 	    (pkg->want != want_unknown ||
 	     pkg->eflag != eflag_ok ||
 	     pkg->status != stat_notinstalled ||
-	     informativeversion(&pkg->configversion)))
+	     dpkg_version_is_informative(&pkg->configversion)))
 		return true;
 
 	if (pkgbin->depends ||
@@ -204,7 +204,7 @@ pkg_is_informative(struct pkginfo *pkg, struct pkgbin *pkgbin)
 	    nes(pkgbin->bugs) ||
 	    nes(pkgbin->installedsize) ||
 	    nes(pkgbin->source) ||
-	    informativeversion(&pkgbin->version) ||
+	    dpkg_version_is_informative(&pkgbin->version) ||
 	    pkgbin->conffiles ||
 	    pkgbin->arbs)
 		return true;

+ 1 - 1
lib/dpkg/version.c

@@ -32,7 +32,7 @@ dpkg_version_blank(struct versionrevision *version)
 }
 
 bool
-informativeversion(const struct versionrevision *version)
+dpkg_version_is_informative(const struct versionrevision *version)
 {
 	return (version->epoch ||
 	        (version->version && *version->version) ||

+ 1 - 1
lib/dpkg/version.h

@@ -34,7 +34,7 @@ struct versionrevision {
 };
 
 void dpkg_version_blank(struct versionrevision *version);
-bool informativeversion(const struct versionrevision *version);
+bool dpkg_version_is_informative(const struct versionrevision *version);
 
 DPKG_END_DECLS
 

+ 1 - 1
src/configure.c

@@ -386,7 +386,7 @@ deferred_configure(struct pkginfo *pkg)
 	modstatdb_note(pkg);
 
 	maintainer_script_postinst(pkg, "configure",
-	                           informativeversion(&pkg->configversion) ?
+	                           dpkg_version_is_informative(&pkg->configversion) ?
 	                           versiondescribe(&pkg->configversion,
 	                                           vdew_nonambig) : "",
 	                           NULL);

+ 1 - 1
src/depcon.c

@@ -415,7 +415,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
           case stat_unpacked:
           case stat_halfconfigured:
             if (allowunconfigd) {
-              if (!informativeversion(&pkg_pos->configversion)) {
+              if (!dpkg_version_is_informative(&pkg_pos->configversion)) {
                 sprintf(linebuf, _("  %.250s is unpacked, but has never been "
                                    "configured.\n"),
                         pkg_name(pkg_pos, pnaw_nonambig));

+ 6 - 3
src/enquiry.c

@@ -619,9 +619,12 @@ cmpversions(const char *const *argv)
   } else {
     dpkg_version_blank(&b);
   }
-  if (!informativeversion(&a)) {
-    return informativeversion(&b) ? rip->if_none_a : rip->if_none_both;
-  } else if (!informativeversion(&b)) {
+  if (!dpkg_version_is_informative(&a)) {
+    if (dpkg_version_is_informative(&b))
+      return rip->if_none_a;
+    else
+      return rip->if_none_both;
+  } else if (!dpkg_version_is_informative(&b)) {
     return rip->if_none_b;
   }
   r= versioncompare(&a,&b);