[or-cvs] r6898 - tor/trunk/src/or
nickm at seul.org
nickm at seul.org
Tue Jul 25 04:34:18 UTC 2006
Author: nickm
Date: 2006-07-25 00:34:14 -0400 (Tue, 25 Jul 2006)
New Revision: 6898
Modified:
tor/trunk/src/or/or.h
tor/trunk/src/or/routerparse.c
tor/trunk/src/or/test.c
Log:
Remove code to special-case "-cvs" ending, since it has not actually mattered since 0.0.9. Perhaps we can special-case even more...
Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h 2006-07-25 01:26:20 UTC (rev 6897)
+++ tor/trunk/src/or/or.h 2006-07-25 04:34:14 UTC (rev 6898)
@@ -2464,9 +2464,6 @@
* 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;
Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c 2006-07-25 01:26:20 UTC (rev 6897)
+++ tor/trunk/src/or/routerparse.c 2006-07-25 04:34:14 UTC (rev 6898)
@@ -1803,7 +1803,7 @@
{
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 @@
if (!*eos) {
out->status = VER_RELEASE;
out->patchlevel = 0;
- out->cvs = IS_NOT_CVS;
return 0;
}
cp = eos;
@@ -1857,11 +1856,6 @@
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 @@
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.
Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c 2006-07-25 01:26:20 UTC (rev 6897)
+++ tor/trunk/src/or/test.c 2006-07-25 04:34:14 UTC (rev 6898)
@@ -1387,35 +1387,30 @@
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_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))
More information about the tor-commits
mailing list