[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tmda-users
Subject:    Patch: A fix for TMDA-cgi so it works with TMDA-0.1.10
From:       Jim Ramsay <i.am () jimramsay ! com>
Date:       2007-02-08 15:08:31
Message-ID: 20070208090831.72825e62 () sed-192 ! sedsystems ! ca
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


This fixes the wonderfully confusing error message:

tmda-cgi/0.15 requires TMDA/1.1.6 or later. TMDA/1.1.10 found.

This should probably work with earlier versions of TMDA-cgi as well
(although this is untested).

To apply:

1. Save the attachment somewhere, such as /tmp

2. CD into the directory where the tmda-cgi source is kept.

3. Run the following command as root (or whoever is allowed to make
changes in the tmda-cgi directory:

   patch -p0 < /tmp/tmda-cgi-0.15-TMDA_Version_Fix.patch

If you saved the patch somewhere besides /tmp, replace '/tmp' in the
command above with the full path to the patch file.

That should do it.

Enjoy!

--=20
Jim Ramsay
"Me fail English?  That's unpossible!"

["tmda-cgi-0.15-TMDA_Version_Fix.patch" (text/x-patch)]

Index: CgiVersion.py
===================================================================
--- CgiVersion.py	(revision 2114)
+++ CgiVersion.py	(working copy)
@@ -43,9 +43,25 @@
 All = 'tmda-cgi/%s "%s" (Python/%s on %s)' % \
   (tmda_cgi, Codename, Python, Platform)
 
+def parseVersion(versionString):
+	"""Returns a list of all the integers in the version string:
+		"1.1.3" will return [1,1,3,0]
+		"1.1.0+" will return [1,1,0,1]"""
+	if versionString.endswith("+"):
+		string = versionString[:-1]
+		dev = 1
+	else:
+		dev = 0
+		string = versionString
+	tuple = [ int(x) for x in string.split(".") ]
+	tuple.append(dev)
+	return tuple
+
 def Test():
   "Validate TMDAReqVer."
-  if Version.TMDA < TMDAReqVer:
+  current = parseVersion(Version.TMDA)
+  required = parseVersion(TMDAReqVer)
+  if current < required:
     raise ImportError, \
       "tmda-cgi/%s requires TMDA/%s or later.  TMDA/%s found." % \
       (tmda_cgi, TMDAReqVer, Version.TMDA)

["signature.asc" (application/pgp-signature)]

_____________________________________________
tmda-users mailing list (tmda-users@tmda.net)
http://tmda.net/lists/listinfo/tmda-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic