Author: wade
Date: 2006-05-11 20:35:28 -0400 (Thu, 11 May 2006)
New Revision: 60614

Modified:
   trunk/release/monobuild/scheduler-daemon.py
   trunk/release/packaging/build
   trunk/release/packaging/defs/heap-buddy
   trunk/release/packaging/defs/mono-1.1.13
   trunk/release/packaging/defs/mono-1.1.7
   trunk/release/packaging/defs/mono-1.1.8
   trunk/release/packaging/do-msvn-tar
   trunk/release/packaging/install-deps
   trunk/release/packaging/mktarball
   trunk/release/pyutils/datastore.py
   trunk/release/pyutils/packaging.py
Log:
defs:
-add s390x for heap-buddy (since we have a s390x jail now)
-add option: source_package_path_name (this is used in defs that are branches
 where sources are packages will be in the same spot.  Ex, mono-1.1.13 def will
 have the same package path and sources as mono)

Fix HEAD_or_RELEASE/RELEASE_or_HEAD typos so all are consistent

Implement source_package_path_name:
-packaging.py, mktarball, build: if the def has source_package_path_name, 
create a symlink to point to
 the value of source_package_path_name




Modified: trunk/release/monobuild/scheduler-daemon.py
===================================================================
--- trunk/release/monobuild/scheduler-daemon.py 2006-05-11 23:59:31 UTC (rev 
60613)
+++ trunk/release/monobuild/scheduler-daemon.py 2006-05-12 00:35:28 UTC (rev 
60614)
@@ -3,6 +3,7 @@
 # Probably will only build HEAD packages for now...  No reason it couldn't 
build RELEASE... ?
 
 # TODO: Logging
+# TODO: Prioritize builds: Maybe there should be one thread per jail, and that 
thread chooses a tarball to build, and prioritizes.  That way, there are no 
wait times for startup (we'll only sleep when there are no tarballs available 
to build)
 
 import sys
 import os

Modified: trunk/release/packaging/build
===================================================================
--- trunk/release/packaging/build       2006-05-11 23:59:31 UTC (rev 60613)
+++ trunk/release/packaging/build       2006-05-12 00:35:28 UTC (rev 60614)
@@ -18,6 +18,7 @@
 import sys
 import glob
 import os.path
+import os
 import distutils.dir_util
 import signal
 
@@ -126,9 +127,26 @@
 
 print package_path
 
+# Create symlink to the real location if it's not there already if this def is 
configured with 'source_package_path_name'
+#  (Only do for RELEASE packages, since HEAD configure.in numbers can be 
inconsistant)
+if package.info.has_key('source_package_path_name') and HEAD_or_RELEASE == 
"RELEASE":
+       link_path = os.path.dirname(package_path) + os.sep + package_name
+       print "Link path: %s" % link_path
+       if not os.path.islink(link_path):
+               if os.path.exists(link_path):
+                       print "%s is not a symbolic link (it should be)" % 
link_path
+                       build_env.unlock_env()
+                       sys.exit(1)
+               try:
+                       os.symlink(package.info['source_package_path_name'], 
link_path)
+               except:
+                       print "Error creating symlink: %s" % link_path
+                       build_env.unlock_env()
+                       sys.exit(1)
+
+
 package_version_path = package_path + os.sep + ver_path
 
-
 if os.path.exists(package_version_path):
        print "The path for this package (%s) already exists. You probably need 
to bump the revision number" % package_version_path
        build_env.unlock_env()

Modified: trunk/release/packaging/defs/heap-buddy
===================================================================
--- trunk/release/packaging/defs/heap-buddy     2006-05-11 23:59:31 UTC (rev 
60613)
+++ trunk/release/packaging/defs/heap-buddy     2006-05-12 00:35:28 UTC (rev 
60614)
@@ -5,7 +5,7 @@
        sles-9-x86_64
        sles-9-ia64
        sles-9-s390
-       #sles-9-s390x
+       sles-9-s390x
 #      win-4-i386
 )
 

Modified: trunk/release/packaging/defs/mono-1.1.13
===================================================================
--- trunk/release/packaging/defs/mono-1.1.13    2006-05-11 23:59:31 UTC (rev 
60613)
+++ trunk/release/packaging/defs/mono-1.1.13    2006-05-12 00:35:28 UTC (rev 
60614)
@@ -1,5 +1,7 @@
 web_index=1
 
+source_package_path_name="mono"
+
 BUILD_HOSTS=(
         redhat-9-i386
         sles-9-ia64

Modified: trunk/release/packaging/defs/mono-1.1.7
===================================================================
--- trunk/release/packaging/defs/mono-1.1.7     2006-05-11 23:59:31 UTC (rev 
60613)
+++ trunk/release/packaging/defs/mono-1.1.7     2006-05-12 00:35:28 UTC (rev 
60614)
@@ -1,5 +1,7 @@
 web_index=2
 
+source_package_path_name="mono"
+
 BUILD_HOSTS=(
         redhat-9-i386
         sles-9-x86_64

Modified: trunk/release/packaging/defs/mono-1.1.8
===================================================================
--- trunk/release/packaging/defs/mono-1.1.8     2006-05-11 23:59:31 UTC (rev 
60613)
+++ trunk/release/packaging/defs/mono-1.1.8     2006-05-12 00:35:28 UTC (rev 
60614)
@@ -1,5 +1,7 @@
 web_index=3
 
+source_package_path_name="mono"
+
 BUILD_HOSTS=(
         redhat-9-i386
         sles-9-x86_64

Modified: trunk/release/packaging/do-msvn-tar
===================================================================
--- trunk/release/packaging/do-msvn-tar 2006-05-11 23:59:31 UTC (rev 60613)
+++ trunk/release/packaging/do-msvn-tar 2006-05-12 00:35:28 UTC (rev 60614)
@@ -12,7 +12,7 @@
 
 import packaging
 
-RELEASE_or_HEAD = sys.argv[1]
+HEAD_or_RELEASE = sys.argv[1]
 package = sys.argv[2]
 version = sys.argv[3]
 
@@ -30,7 +30,7 @@
 
 # Construct subversion path of location we want to create a tarball from
 svn_paths = []
-if RELEASE_or_HEAD == "HEAD":
+if HEAD_or_RELEASE == "HEAD":
        rev_arg = "-r " + version
        if package_obj.info.has_key('HEAD_PATH'):
                svn_paths += package_obj.info['HEAD_PATH']
@@ -65,11 +65,11 @@
 print "SVN_SSH: %s" % SVN_SSH
 print "SVNEXPORT: %s" % SVNEXPORT
 print "MONO_ROOT: %s" % MONO_ROOT
-print "RELEASE_or_HEAD: %s" % RELEASE_or_HEAD
+print "HEAD_or_RELEASE: %s" % HEAD_or_RELEASE
 print "SVN_PATHS: %s" % SVN_PATHS
 print "VERSION: %s" % VERSION
 
-env_string = 'export SVN_SSH="%s"; export SVNEXPORT="%s"; export 
MONO_ROOT="%s"; export RELEASE_or_HEAD="%s"; export SVN_PATHS="%s"; export 
VERSION="%s"' % (SVN_SSH, SVNEXPORT, MONO_ROOT, RELEASE_or_HEAD, SVN_PATHS, 
VERSION)
+env_string = 'export SVN_SSH="%s"; export SVNEXPORT="%s"; export 
MONO_ROOT="%s"; export HEAD_or_RELEASE="%s"; export SVN_PATHS="%s"; export 
VERSION="%s"' % (SVN_SSH, SVNEXPORT, MONO_ROOT, HEAD_or_RELEASE, SVN_PATHS, 
VERSION)
 
 # If they don't have any svn_paths, they MUST specify BUILD_DIR
 if package_obj.info.has_key('BUILD_DIR'):
@@ -113,7 +113,7 @@
        print "Command: %s" % command
        os.system(command)
 else:
-       cache_dir = "/tmp/src_cache/%s/%s" % (package, RELEASE_or_HEAD)
+       cache_dir = "/tmp/src_cache/%s/%s" % (package, HEAD_or_RELEASE)
        for path in svn_paths:
                module = os.path.basename(path)
 
@@ -154,7 +154,7 @@
 os.chdir(build_dir)
 
 # update_version_file (If this is a snapshot build)
-if RELEASE_or_HEAD == "HEAD":
+if HEAD_or_RELEASE == "HEAD":
        if package_obj.info.has_key('update_version_file'):
                script = def_file
        else:

Modified: trunk/release/packaging/install-deps
===================================================================
--- trunk/release/packaging/install-deps        2006-05-11 23:59:31 UTC (rev 
60613)
+++ trunk/release/packaging/install-deps        2006-05-12 00:35:28 UTC (rev 
60614)
@@ -7,7 +7,7 @@
 #           local packages is packages in the defs dir and/or urls if distro 
is zip based
 #
 
-# TODO: be able to install from snapshot_packages  (RELEASE_or_HEAD)
+# TODO: be able to install from snapshot_packages  (HEAD_or_RELEASE)
 
 
 import os

Modified: trunk/release/packaging/mktarball
===================================================================
--- trunk/release/packaging/mktarball   2006-05-11 23:59:31 UTC (rev 60613)
+++ trunk/release/packaging/mktarball   2006-05-12 00:35:28 UTC (rev 60614)
@@ -37,11 +37,11 @@
        except IndexError:
                usage()
                sys.exit(1)
-       RELEASE_or_HEAD = "HEAD"
+       HEAD_or_RELEASE = "HEAD"
        source_path = "snapshot_sources"
 else:
        version=sys.argv[2]
-       RELEASE_or_HEAD = "RELEASE"
+       HEAD_or_RELEASE = "RELEASE"
        source_path = "sources"
 
 
@@ -50,16 +50,14 @@
 repo = datastore.source_file_repo()
 
 # Check to see if this is already there
-if repo.contains(RELEASE_or_HEAD, package, version):
-       print "Source file for %s version %s (%s) exists" % (package, version, 
RELEASE_or_HEAD) 
+if repo.contains(HEAD_or_RELEASE, package, version):
+       print "Source file for %s version %s (%s) exists" % (package, version, 
HEAD_or_RELEASE) 
        sys.exit(1)
 
-LOGFILE = "%s/%s/%s/%s.log" % (config.mktarball_logs, RELEASE_or_HEAD, 
package, version)
+LOGFILE = "%s/%s/%s/%s.log" % (config.mktarball_logs, HEAD_or_RELEASE, 
package, version)
 log_obj = logger.Logger(filename=LOGFILE)
 log_obj.log("Sources path: %s\n" % source_path)
 
-package_path = source_path + os.sep + package
-distutils.dir_util.mkpath(package_path)
 
 # Get tarball path from def file
 package_obj = packaging.package("", package)
@@ -69,6 +67,25 @@
        distro = config.mktarball_host
 log_obj.log("Using distro: %s\n" % distro)
 
+# Create symlink to the real location if it's not there already
+#  (Only do for RELEASE packages, since HEAD configure.in numbers can be 
inconsistant)
+if package_obj.info.has_key('source_package_path_name') and HEAD_or_RELEASE == 
"RELEASE":
+       link_path = source_path + os.sep + package
+       log_obj.log("Link path: %s\n" % link_path)
+       if not os.path.islink(link_path):
+               if os.path.exists(link_path):
+                       log_obj.log("%s is not a symbolic link (it should 
be)\n" % link_path)
+                       sys.exit(1)
+               try:
+                       
os.symlink(package_obj.info['source_package_path_name'], link_path)
+               except:
+                       log_obj.log("Error creating symlink: %s\n" % link_path)
+                       sys.exit(1)
+
+
+package_path = source_path + os.sep + package
+distutils.dir_util.mkpath(package_path)
+
 env = packaging.buildenv(distro, logger=log_obj)
 
 if env.is_locked():
@@ -93,7 +110,7 @@
 
 log_obj.log("Starting to build source dist...\n")
 (status, output) = env.ssh.execute('mount /proc &> /dev/null', exec_as_root=1)
-(status, output) = env.ssh.execute('/tmp/do-msvn-tar %s %s %s' % 
(RELEASE_or_HEAD, package, version) )
+(status, output) = env.ssh.execute('/tmp/do-msvn-tar %s %s %s' % 
(HEAD_or_RELEASE, package, version) )
 
 if status:
         env.unlock_env()
@@ -108,7 +125,7 @@
 env.ssh.copy_from('/tmp/built-tarball/%s' % tarball, package_path )
 
 # Keep a map of which params produce which tarball
-repo.add_file(RELEASE_or_HEAD, package, version, package_path + os.sep + 
tarball)
+repo.add_file(HEAD_or_RELEASE, package, version, package_path + os.sep + 
tarball)
 
 env.unlock_env()
 

Modified: trunk/release/pyutils/datastore.py
===================================================================
--- trunk/release/pyutils/datastore.py  2006-05-11 23:59:31 UTC (rev 60613)
+++ trunk/release/pyutils/datastore.py  2006-05-12 00:35:28 UTC (rev 60614)
@@ -47,22 +47,22 @@
                 self.info = {}
 
 
-        def add_file(self, RELEASE_or_HEAD, package_name, version, 
filename_path):
+        def add_file(self, HEAD_or_RELEASE, package_name, version, 
filename_path):
 
                 #print "Adding file: %s %s %s %s"  % (package_name, version, 
snapshot_rev, filename_path)
 
                 self.load_info()
                 # Add to structure
-                key = ":".join([RELEASE_or_HEAD, package_name, version])
+                key = ":".join([HEAD_or_RELEASE, package_name, version])
                 self.info[key] = filename_path
 
                 # Lock file
                 # Write out file
                 self.write_info()
 
-        def contains(self, RELEASE_or_HEAD, package_name, version):
+        def contains(self, HEAD_or_RELEASE, package_name, version):
                 self.load_info()
-                return self.info.has_key(":".join([RELEASE_or_HEAD, 
package_name, version]))
+                return self.info.has_key(":".join([HEAD_or_RELEASE, 
package_name, version]))
 
 
         # Probably won't need this...
@@ -110,7 +110,7 @@
                # Ex: 
/<full_path>/tarball_logs/RELEASE/libgdiplus-1.1/1.1.13.4.log
                return config.mktarball_logs + os.sep + key.replace(":", "/") + 
".log"
 
-       def get_latest_tarball(self, RELEASE_or_HEAD, package_name):
+       def get_latest_tarball(self, HEAD_or_RELEASE, package_name):
                self.load_info()
 
                versions = []
@@ -118,15 +118,15 @@
                for key in self.info.iterkeys():
                        stuff = key.split(":")
                        # If this is the release and packagename
-                       if stuff[0] == RELEASE_or_HEAD and stuff[1] == 
package_name:
+                       if stuff[0] == HEAD_or_RELEASE and stuff[1] == 
package_name:
                                # If the tarball creation succeeded
-                               if self.info[":".join([RELEASE_or_HEAD, 
package_name, stuff[2]])] != "tarball_creation_failed":
+                               if self.info[":".join([HEAD_or_RELEASE, 
package_name, stuff[2]])] != "tarball_creation_failed":
                                        versions.append(stuff[2])
 
                # TODO: Better error handling here
                try:
                        latest = utils.version_sort(versions).pop()
-                       latest_filename = self.info[":".join([RELEASE_or_HEAD, 
package_name, latest])]
+                       latest_filename = self.info[":".join([HEAD_or_RELEASE, 
package_name, latest])]
                except:
                        latest_filename = ""
 

Modified: trunk/release/pyutils/packaging.py
===================================================================
--- trunk/release/pyutils/packaging.py  2006-05-11 23:59:31 UTC (rev 60613)
+++ trunk/release/pyutils/packaging.py  2006-05-12 00:35:28 UTC (rev 60614)
@@ -199,9 +199,26 @@
 
                if HEAD_or_RELEASE == "HEAD": packages_dir = "snapshot_" + 
packages_dir
 
-               return os.path.join(config.packaging_dir, packages_dir, 
self.destroot, self.name)
+               package_path = os.path.join(config.packaging_dir, packages_dir, 
self.destroot, self.name)
 
+               # Create symlink if the package dir is there, but not the 
symlink
+               #  This is normally done in packaging/build, but do here just 
in case an installer script needs it,
+               #  but the link isn't there
+               if self.info.has_key('source_package_path_name') and 
HEAD_or_RELEASE == "RELEASE":
+                       print "Link path: %s" % package_path
+                       if not os.path.islink(package_path):
+                               if os.path.exists(package_path):
+                                       print "%s is not a symbolic link (it 
should be)" % package_path
+                                       sys.exit(1)
+                               try:
+                                       
os.symlink(self.info['source_package_path_name'], package_path)
+                               except:
+                                       print "Error creating symlink: %s" % 
package_path
+                                       sys.exit(1)
 
+               return package_path
+
+
        # Used for constructing filenames
        def get_revision(self, serial):
                """Args: serial number (equates to a release for rpms, and -5 
in 1.1.13.2-5 for all else)."""

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to