]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Define an elaborate set of lunacy to make sure that RPM versions do
authorNick Mathewson <nickm@torproject.org>
Sun, 14 Nov 2004 23:18:20 +0000 (23:18 +0000)
committerNick Mathewson <nickm@torproject.org>
Sun, 14 Nov 2004 23:18:20 +0000 (23:18 +0000)
the right thing with our recalcitrant versioning scheme.  See
tor.spec.in for full details.  Basically, the progression is now:

 Tor version         RPM version
  0.0.8          ---> 0.0.8
  0.0.8.1        ---> 0.0.8.1
  0.0.9pre1-cvs  ---> 0.0.8.99.0.0.9.pre.1.cvs
  0.0.9pre1      ---> 0.0.8.99.0.0.9.pre.1.release
  0.0.9pre2      ---> 0.0.8.99.0.0.9.pre.2.release
  0.0.9rc1       ---> 0.0.8.99.0.0.9.rc.1.release
  0.0.9          ---> 0.0.9
  0.0.9.1-cvs    ---> 0.0.9.0.99.0.0.9.1.cvs
  0.0.9.1        ---> 0.0.9.1

The spec file (but not the system) will break if a tor version ends in
".0", so don't do that yet.

svn:r2877

doc/TODO
tor.spec.in

index 22704d36ea1a09febe0c08b1f59229cd1df00752..559a0fa111e324e3964ca3e3e8d5bcfb2c9c8e63 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -31,13 +31,13 @@ R  - fix print_usage()
        running-routers so often?
 R  - document signals in man page
    o Check for hibernation on startup, hup, etc.
-N  - Test hibernation a lot.
+N  . Test hibernation a lot.
    o Document all undocumented configuration options.
      o Accounting
      o Control interface authentication
-N  - RPMs
+   o RPMs
      o Merge changes from jbash
-     - Figure out versioning
+     o Figure out versioning
    o Windows installer
      o Make installer get built
      o Write script to correct windows versions.
index 4eb0eea35d036cb91ea15343cd54a3ae85d99132..44f39b0f60a1b6bb450a677db572beca6a9560d3 100644 (file)
@@ -6,7 +6,7 @@
 # This should be incremented whenever the spec file changes, but
 # can drop back to zero at a new Tor version
 
-%define  specver 1
+%define  specver 2
 
 ## Things users may want to change
 #
 # including any "pre<x>" or "rc<y>" suffix. This gets massaged to
 # create the RPM version number, in a way that depends on the Tor
 # numbering scheme.
-%define  native_version       @VERSION@
+%define native_version       @VERSION@
 
 # Massage the version so that pre-releases will be treated as earlier
 # than release candidates which will be treated as earlier than released
-# versions... while making as few confusing changes to the standard
-# release naming as possible.
-# XXXX009 Execept that handling cvs breaks this.
-%define version %(echo %{native_version} | sed -e 's/-cvs/.cvs/' -e 's/pre/.pre./' -e 's/rc/.rc./' -e 's/([0-9])$/\1.release/')
+# versions.
+#
+# We do this as follows: 
+#   - If the version number has no "pre", "cvs", or "rc", we let it pass.
+#   - Otherwise, we mangle it heavily:
+#     * To make 0.0.Xpre come after 0.0.{X-1}* but before 0.0.X, we prepend
+#       0.0.{X-1}.99 to the version.
+#     * We replace pre with .pre. and rc with .rc.
+#     * We replace -cvs with .cvs, and lack of -cvs with .release.
+#
+# Note what this scheme will break if we ever use 0 as a last digit for a
+# Tor version: so don't do that.
+
+%define is_dev_version %(echo %{native_version} | grep 'cvs\\|pre\\|rc' > /dev/null && echo 1 || echo 0)
+
+%if %{is_dev_version}
+
+# The 0.0.X.pre.1.cvs part.
+%define safe_native_version %(echo %{native_version} | sed -e 's/-cvs/.cvs/' -e 's/pre/.pre./' -e 's/rc/.rc./' -e 's/\\([0-9]\\)$/\\1.release/')
+# The 0.0.X part -- the version we are leading up to.
+%define stub_version %(echo %{native_version} | sed -e 's/-cvs//' -e 's/pre.*//' -e 's/rc.*//')
+# The 0.0 part
+%define stub_start %(echo %{stub_version} | sed -e 's/\\.[0-9]*$//')
+# The X part.
+%define stub_last %(echo %{stub_version} | sed -e 's/.*\\.\\([0-9]*\\)$/\\1/')
+# The {X-1} part.
+%define stub_newlast %(expr %{stub_last} - 1)
+# The actual version: 0.0.{X-1}.99.0.0.X.pre.1.cvs
+%define version %{stub_start}.%{stub_newlast}.99.%{safe_native_version}
+
+%else
+%define version %{native_version}
+%endif
 
 ## Release and OS identification song and dance
 #