Commits

Henri Sivonen  committed 8686b0e

Get rid of symlinks

  • Participants
  • Parent commits 90db2ff

Comments (0)

Files changed (1)

           self.directories.append(self.baseUrl + value)
         if leafPat.match(value):
           self.leaves.append(self.baseUrl + value)    
-
-def symlinkOrCopytree(pointer, linkfile):
-  if hasattr(os, 'symlink'):
-    if not os.path.exists(linkfile):
-      os.symlink(pointer, linkfile)
-  else:
-    if os.path.exists(linkfile):
-      shutil.rmtree(linkfile)
-    shutil.copytree(os.path.join(linkfile, "..", pointer), linkfile)
     
 def runCmd(cmd):
   if os.name == 'nt':
 
 def downloadLocalEntities():
   ensureDirExists(os.path.join(buildRoot, "local-entities"))
-  symlinkOrCopytree(os.path.join("..", "..", "syntax", "relaxng"), 
-             os.path.join(buildRoot, "validator", "schema", "html5"))
-  symlinkOrCopytree(os.path.join("..", "validator", "schema"), 
-             os.path.join(buildRoot, "local-entities", "schema"))
   f = open(os.path.join(buildRoot, "validator", "entity-map.txt"))
   try:
     for line in f:
       url, path = line.strip().split("\t")
-      if not (path.startswith("syntax/") or path.startswith("schema/")):
-        # XXX may not work on Windows
+      if not path.startswith("schema/"):
         if not os.path.exists(os.path.join(buildRoot, "local-entities", path)):
           fetchUrlTo(url, os.path.join(buildRoot, "local-entities", path))
   finally:
   try:
     for line in f:
       url, path = line.strip().split("\t")
-      entPath = os.path.join(buildRoot, "local-entities", path)
+      entPath = None
+      if path.startswith("schema/html5/"):
+        entPath = os.path.join(buildRoot, "syntax", "relaxng", path[13:])
+      elif path.startswith("schema/"):
+        entPath = os.path.join(buildRoot, "validator", path)
+      else:
+        entPath = os.path.join(buildRoot, "local-entities", path)
       safeName = localPathToJarCompatName(path)
       safePath = os.path.join(filesDir, safeName)
       if os.path.exists(entPath):