summaryrefslogtreecommitdiffstats
path: root/libopkg
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-14 23:51:51 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-14 23:51:51 (EST)
commitd281eab6487605176bd20efcfe21dabbd1514735 (patch)
tree6196285cbf0a91b39bdbcb8c827a64340acf19c3 /libopkg
parent3da076c8ece54d126f3708b5e6b10182f465e18b (diff)
opkg: Enable Debian style revision field by default and remove "familiar" specific code. Patch from Richard Purdie <rpurdie rpsys net>
git-svn-id: http://opkg.googlecode.com/svn/trunk@41 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r--libopkg/pkg.c26
-rw-r--r--libopkg/pkg_parse.c13
2 files changed, 2 insertions, 37 deletions
diff --git a/libopkg/pkg.c b/libopkg/pkg.c
index 887b217..93fd20a 100644
--- a/libopkg/pkg.c
+++ b/libopkg/pkg.c
@@ -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;
}
diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
index 0bb4433..a8a1f2a 100644
--- a/libopkg/pkg_parse.c
+++ b/libopkg/pkg_parse.c
@@ -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",