[cig-commits] r7542 - cs/buildbot/trunk/buildbot/scripts

leif at geodynamics.org leif at geodynamics.org
Wed Jun 27 19:02:00 PDT 2007


Author: leif
Date: 2007-06-27 19:02:00 -0700 (Wed, 27 Jun 2007)
New Revision: 7542

Modified:
   cs/buildbot/trunk/buildbot/scripts/packager.py
Log:
Set cwd correctly so that 'cygpath' works on relative paths.


Modified: cs/buildbot/trunk/buildbot/scripts/packager.py
===================================================================
--- cs/buildbot/trunk/buildbot/scripts/packager.py	2007-06-28 01:23:54 UTC (rev 7541)
+++ cs/buildbot/trunk/buildbot/scripts/packager.py	2007-06-28 02:02:00 UTC (rev 7542)
@@ -197,7 +197,7 @@
     return url, revision
 
 
-def itwindirs(l):
+def itwindirs(l, sourceDir):
     for src in l:
         if isinstance(src, tuple):
             src, dest = src
@@ -206,12 +206,14 @@
         else:
             dest = src
         src = cygpath("-w", src)
+        if src.startswith(sourceDir):
+            src = src[len(sourceDir)+1:]
         dest = "{app}\\" + dest.replace("/", "\\")
         yield src, dest
     return
 
 
-def itwinfiles(l):
+def itwinfiles(l, sourceDir):
     for src in l:
         if isinstance(src, tuple):
             src, dest = src
@@ -220,6 +222,8 @@
         else:
             dest = dirname(src)
         src = cygpath("-w", src)
+        if src.startswith(sourceDir):
+            src = src[len(sourceDir)+1:]
         dest = "{app}\\" + dest.replace("/", "\\")
         yield src, dest
     return
@@ -345,8 +349,8 @@
     return
 
 
-def generateISS(info, pl, bashrc, python):
-    s = open("buildbot.iss", "w")
+def generateISS(workdir, sourceDir, info, pl, bashrc, python):
+    s = open(workdir + "/buildbot.iss", "w")
 
 
     # [Setup]
@@ -384,9 +388,9 @@
 [Files]
 """
     )
-    for src, dest in itwindirs(pl.directories):
+    for src, dest in itwindirs(pl.directories, sourceDir):
         s.write("""Source: "%s\\*"; DestDir: "%s"; Flags: ignoreversion recursesubdirs\n""" % (src, dest))
-    for src, dest in itwinfiles(pl.files()):
+    for src, dest in itwinfiles(pl.files(), sourceDir):
         s.write("""Source: "%s"; DestDir: "%s"; Flags: ignoreversion\n""" % (src, dest))
     for f in [bashrc, "cig.ico"]:
         s.write("""Source: "%s"; DestDir: "{app}"; Flags: ignoreversion\n""" % f)
@@ -483,7 +487,7 @@
     return
 
     
-def createWindowsInstaller(python, prefix, name, package, version, pl,
+def createWindowsInstaller(python, prefix, workdir, name, package, version, pl,
                            installer):
 
     sourceDir = cygpath("-w", prefix)
@@ -499,8 +503,9 @@
     installCigIcon(prefix)
     bashrc = generateBashrc(prefix, package, info)
 
-    generateISS(info, pl, bashrc, python)
+    generateISS(workdir, sourceDir, info, pl, bashrc, python)
 
+    os.chdir(workdir)
     os.system("unix2dos buildbot.iss")
     
     status = os.system("iscc buildbot.iss")
@@ -620,11 +625,10 @@
     if url:
         installSource(pl, package, revision, url, workdir)
 
-    os.chdir(workdir)
-
     distdir_arch = distdir + "-" + arch
     if opSys == "darwin" or opSys == "linux":
         # No .dmg on Mac for now.
+        os.chdir(workdir)
         os.system("rm " + distdir_arch)
         os.system("ln -s " + prefix + " " + distdir_arch)
         packingList = [distdir_arch + "/" + m for m in pl.all()]
@@ -636,7 +640,7 @@
 
         os.system("mv " + archive + " " + taggedArchive)
     elif opSys == "win":
-        createWindowsInstaller(python, prefix, name, package, version, pl,
+        createWindowsInstaller(python, prefix, workdir, name, package, version, pl,
                                tag + "-" + distdir_arch)
     else:
         sys.exit("unknown OS: " + opSys)



More information about the cig-commits mailing list