opkg: Enable Debian style revision field by default and remove "familiar" specific...
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 04:51:51 +0000 (04:51 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 04:51:51 +0000 (04:51 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@41 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/pkg.c
libopkg/pkg_parse.c

index 887b217..93fd20a 100644 (file)
@@ -1067,15 +1067,11 @@ int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg)
          return r;
      }
 
-#ifdef USE_DEBVERSION
      r = verrevcmp(pkg->revision, ref_pkg->revision);
      if (r) {
          return r;
      }
 
-     r = verrevcmp(pkg->familiar_revision, ref_pkg->familiar_revision);
-#endif
-
      return r;
 }
 
@@ -1189,10 +1185,7 @@ char *pkg_version_str_alloc(pkg_t *pkg)
 {
      char *complete_version;
      char *epoch_str;
-#ifdef USE_DEBVERSION
      char *revision_str;
-     char *familiar_revision_str;
-#endif
 
      if (pkg->epoch) {
          sprintf_alloc(&epoch_str, "%d:", pkg->epoch);
@@ -1200,33 +1193,18 @@ char *pkg_version_str_alloc(pkg_t *pkg)
          epoch_str = strdup("");
      }
 
-#ifdef USE_DEBVERSION
      if (pkg->revision && strlen(pkg->revision)) {
          sprintf_alloc(&revision_str, "-%s", pkg->revision);
      } else {
          revision_str = strdup("");
      }
 
-     if (pkg->familiar_revision && strlen(pkg->familiar_revision)) {
-         sprintf_alloc(&familiar_revision_str, "-fam%s", pkg->familiar_revision);
-     } else {
-         familiar_revision_str = strdup("");
-     }
-#endif
 
-#ifdef USE_DEBVERSION
-     sprintf_alloc(&complete_version, "%s%s%s%s",
-                  epoch_str, pkg->version, revision_str, familiar_revision_str);
-#else
-     sprintf_alloc(&complete_version, "%s%s",
-                  epoch_str, pkg->version);
-#endif
+     sprintf_alloc(&complete_version, "%s%s%s",
+                  epoch_str, pkg->version, revision_str);
 
      free(epoch_str);
-#ifdef USE_DEBVERSION
      free(revision_str);
-     free(familiar_revision_str);
-#endif
 
      return complete_version;
 }
index 0bb4433..a8a1f2a 100644 (file)
@@ -105,9 +105,7 @@ void parseConffiles(pkg_t * pkg, char * raw)
 int parseVersion(pkg_t *pkg, char *raw)
 {
   char *colon, *eepochcolon;
-#ifdef USE_DEBVERSION
   char *hyphen;
-#endif
   unsigned long epoch;
 
   if (!*raw) {
@@ -149,23 +147,12 @@ int parseVersion(pkg_t *pkg, char *raw)
   }
   strcpy(pkg->version, raw);
 
-#ifdef USE_DEBVERSION
   hyphen= strrchr(pkg->version,'-');
 
   if (hyphen) {
     *hyphen++= 0;
-    if (strncmp("fam", hyphen, 3) == 0) {
-      pkg->familiar_revision=hyphen+3;
-      hyphen= strrchr(pkg->version,'-');
-      if (hyphen) {
-       *hyphen++= 0;
-       pkg->revision = hyphen;
-      }
-    } else {
       pkg->revision = hyphen;
-    }
   }
-#endif
 
 /*
   fprintf(stderr,"Parsed version: %lu, %s, %s, %s\n",