CVS: tmda-cgi ChangeLog,1.50,1.51 Install.py,1.23,1.24 THANKS,1.18,1.19

Gre7g Luterman <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda-cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv28840

Modified Files:
	ChangeLog Install.py THANKS 
Log Message:
Fixed a bug that broke virtual user installs if there are many users in a
domain.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/ChangeLog,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- ChangeLog	6 Aug 2003 02:14:02 -0000	1.50
+++ ChangeLog	7 Aug 2003 05:18:20 -0000	1.51
@@ -1,3 +1,8 @@
+2003-08-06  Gre7g Luterman  <[email protected]>
+
+	* Fixed a bug that broke virtual user installs if there are many users
+	  in a domain.
+
 2003-08-05  Gre7g Luterman  <[email protected]>
 
 	* Caught an extra exception in the generate addresses module.

Index: Install.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Install.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Install.py	13 Jul 2003 18:43:34 -0000	1.23
+++ Install.py	7 Aug 2003 05:18:20 -0000	1.24
@@ -94,12 +94,13 @@
   for Filename in Filelist:
     SrcFn = os.path.join(os.environ["HOME"], Filename)
     if os.path.isfile(SrcFn):
-      if Filename[:3] == "../":
+      if (Filename[:len(Dict["Parent"])] == Dict["Parent"]) and \
+        (Filename[:len(Dict["Home"])] != Dict["Home"]):
         try:
           os.mkdir(os.path.join(os.environ["HOME"], "%(Parent)s"))
         except OSError:
           pass
-        NewFilename = "%(Parent)s/" + Filename[3:]
+        NewFilename = "%(Parent)s" + Filename[len(Dict["Parent"]):]
         DstFn = os.path.join(os.environ["HOME"], NewFilename)
         Parents.append((SrcFn, DstFn))
         os.rename(SrcFn, DstFn)
@@ -143,8 +144,8 @@
     return None
   Files = ReadTgz(Archive)
   for i in range(len(Files)):
-    if Files[i][:11] == "%(Parent)s/":
-      NewFilename = "../" + Files[i][11:]
+    if Files[i][:10] == "%(Parent)s":
+      NewFilename = Dict["Parent"] + Files[i][10:]
       SrcFn = os.path.join(os.environ["HOME"], Files[i])
       DstFn = os.path.join(os.environ["HOME"], NewFilename)
       os.rename(SrcFn, DstFn)
@@ -246,6 +247,7 @@
 
 def GetAnomalies(Dir):
   "Find any anomaly instructions."
+  global Dict
   Filename = os.path.join("skel", Dir, "anomalies")
   RetVal = \
   {
@@ -260,6 +262,16 @@
       "Contact system administrator.")
   except IOError:
     pass
+  if RetVal.has_key("PARENT_RE"):
+    # PARENT_RE explains how to find a valid parent directory.  Simply remove
+    # directories one at a time until this regular expression matches.
+    Parent = ""
+    Path = Dict["Home"]
+    Test = re.compile(RetVal["PARENT_RE"])
+    while (Path != "/") and not Test.search(Path):
+      Parent += "../"
+      Path, Junk = os.path.split(Path)
+    Dict["Parent"] = Parent[:-1]
   return RetVal
 
 def ReimportDefaults(Files, Backup):

Index: THANKS
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/THANKS,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- THANKS	6 Aug 2003 02:14:02 -0000	1.18
+++ THANKS	7 Aug 2003 05:18:20 -0000	1.19
@@ -22,6 +22,8 @@
                          setup and the proper way to interface to the
                          libraries, suggesting a way to simplify anomalies
 
+    * Samuel Hill -- bug fixing
+
     * Bernard Johnson -- RPM & RPM guidance, bug finding, feature suggestions
 
     * Rob Leachman -- bug finding

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.