summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-07-25 04:34:14 +0000
committerNick Mathewson <nickm@torproject.org>2006-07-25 04:34:14 +0000
commit96bcbb1e1c7e8246d1d93c628c587d2511ce315a (patch)
tree1e5cca50f30a26f9155a3bf0f554f37ebb477ccd
parent8d2a71a47aea445cfbe4d4fed75520d1924b71ab (diff)
downloadtor-96bcbb1e1c7e8246d1d93c628c587d2511ce315a.tar.gz
tor-96bcbb1e1c7e8246d1d93c628c587d2511ce315a.zip
Remove code to special-case "-cvs" ending, since it has not actually mattered since 0.0.9. Perhaps we can special-case even more...
svn:r6898
-rw-r--r--src/or/or.h3
-rw-r--r--src/or/routerparse.c14
-rw-r--r--src/or/test.c6
3 files changed, 2 insertions, 21 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 06d32e5031..3ca90d4ae1 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2464,9 +2464,6 @@ typedef struct tor_version_t {
* VER_RELEASE. */
enum { VER_PRE=0, VER_RC=1, VER_RELEASE=2, } status;
int patchlevel;
- /** CVS status. For version in the post-0.1 format, this is always
- * IS_NOT_CVS */
- enum { IS_CVS=0, IS_NOT_CVS=1} cvs;
char status_tag[MAX_STATUS_TAG_LEN];
} tor_version_t;
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index b1dd2e30dc..ebcff84866 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1803,7 +1803,7 @@ tor_version_parse(const char *s, tor_version_t *out)
{
char *eos=NULL, *cp=NULL;
/* Format is:
- * "Tor " ? NUM dot NUM dot NUM [ ( pre | rc | dot ) NUM [ -cvs ] ]
+ * "Tor " ? NUM dot NUM dot NUM [ ( pre | rc | dot ) NUM [ - tag ] ]
*/
tor_assert(s);
tor_assert(out);
@@ -1829,7 +1829,6 @@ tor_version_parse(const char *s, tor_version_t *out)
if (!*eos) {
out->status = VER_RELEASE;
out->patchlevel = 0;
- out->cvs = IS_NOT_CVS;
return 0;
}
cp = eos;
@@ -1857,11 +1856,6 @@ tor_version_parse(const char *s, tor_version_t *out)
if (*cp == '-' || *cp == '.')
++cp;
strlcpy(out->status_tag, cp, sizeof(out->status_tag));
- if (0==strcmp(cp, "cvs")) {
- out->cvs = IS_CVS;
- } else {
- out->cvs = IS_NOT_CVS;
- }
return 0;
}
@@ -1885,11 +1879,7 @@ tor_version_compare(tor_version_t *a, tor_version_t *b)
else if ((i = a->patchlevel - b->patchlevel))
return i;
- if (a->major > 0 || a->minor > 0) {
- return strcmp(a->status_tag, b->status_tag);
- } else {
- return (a->cvs - b->cvs);
- }
+ return strcmp(a->status_tag, b->status_tag);
}
/** Return true iff versions <b>a</b> and <b>b</b> belong to the same series.
diff --git a/src/or/test.c b/src/or/test.c
index e7c460ba84..3e18df9d33 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -1387,35 +1387,30 @@ test_dir_format(void)
test_eq(4, ver1.micro);
test_eq(VER_PRE, ver1.status);
test_eq(2, ver1.patchlevel);
- test_eq(IS_CVS, ver1.cvs);
test_eq(0, tor_version_parse("0.3.4rc1", &ver1));
test_eq(0, ver1.major);
test_eq(3, ver1.minor);
test_eq(4, ver1.micro);
test_eq(VER_RC, ver1.status);
test_eq(1, ver1.patchlevel);
- test_eq(IS_NOT_CVS, ver1.cvs);
test_eq(0, tor_version_parse("1.3.4", &ver1));
test_eq(1, ver1.major);
test_eq(3, ver1.minor);
test_eq(4, ver1.micro);
test_eq(VER_RELEASE, ver1.status);
test_eq(0, ver1.patchlevel);
- test_eq(IS_NOT_CVS, ver1.cvs);
test_eq(0, tor_version_parse("1.3.4.999", &ver1));
test_eq(1, ver1.major);
test_eq(3, ver1.minor);
test_eq(4, ver1.micro);
test_eq(VER_RELEASE, ver1.status);
test_eq(999, ver1.patchlevel);
- test_eq(IS_NOT_CVS, ver1.cvs);
test_eq(0, tor_version_parse("0.1.2.4-alpha", &ver1));
test_eq(0, ver1.major);
test_eq(1, ver1.minor);
test_eq(2, ver1.micro);
test_eq(4, ver1.patchlevel);
test_eq(VER_RELEASE, ver1.status);
- test_eq(IS_NOT_CVS, ver1.cvs);
test_streq("alpha", ver1.status_tag);
test_eq(0, tor_version_parse("0.1.2.4", &ver1));
test_eq(0, ver1.major);
@@ -1423,7 +1418,6 @@ test_dir_format(void)
test_eq(2, ver1.micro);
test_eq(4, ver1.patchlevel);
test_eq(VER_RELEASE, ver1.status);
- test_eq(IS_NOT_CVS, ver1.cvs);
test_streq("", ver1.status_tag);
#define test_eq_vs(vs1, vs2) test_eq_type(version_status_t, "%d", (vs1), (vs2))