Author: wade
Date: 2006-06-28 16:43:56 -0400 (Wed, 28 Jun 2006)
New Revision: 62131

Modified:
   trunk/release/monobuild/scheduler-daemon.py
   trunk/release/monobuild/sync-daemon.py
   trunk/release/monobuild/tarball-builder-daemon.py
   trunk/release/monobuild/www/build.js
   trunk/release/monobuild/www/python/monobuild.py
   trunk/release/monobuild/www/python/test.py
   trunk/release/packaging/build
   trunk/release/packaging/conf/sunos-10-x86
   trunk/release/packaging/defs/mono
   trunk/release/packaging/do-zip-build
   trunk/release/packaging/mktarball
   trunk/release/pyutils/config.py
   trunk/release/pyutils/datastore.py
   trunk/release/pyutils/packaging.py
   trunk/release/pyutils/sshutils.py
   trunk/release/pyutils/utils.py
   trunk/release/pyutils/www_utils.py
Log:
defs/mono / packaging/build:
-disable cas tests on ia64

conf/sunos-10-x86:
-solaris build is working now

packaging/do-zip-build:
-fixups for solaris
-fix tar_path typo

packaging/mktarball:
-new state: inprogress to see when a tarball is being created
-set failed state here instead of in tarball-builder-daemon.py

monobuild/www/python/monobuild.py:
-get timezone cookie and adjust times accordingly

monobuild/www/build.js:
-get timezone from javascript and set in cookie

monobuild/scheduler-daemon.py:
-revamp scheduler daemon to have one thread per jail (less idle time) and only 
sleep for 60 seconds

monobuild/tarball-builder-daemon.py:
-new option (default) to only build the latest tarball instead of last n 
tarballs
 -not every tarball will be built, but this will allow faster scheduling of the 
most recent checkins
-don't set failed tarball state (set in mktarball instead)
-only sleep for 30 seconds

pyutils/sshutils.py:
-implement terminate reg with launch_process.py (client) instead of on the host 
side

pytuils/packaging.py
-less chatty on package object creation

www_utils.py/utils.py:
-helper methods for timezone feature above

pytuils/datastore.py:
-rename 'tarball_creation_failed' to 'failure' (to match state names of 
buildinfo) and check for 'inprogress' state



Modified: trunk/release/monobuild/scheduler-daemon.py
===================================================================
--- trunk/release/monobuild/scheduler-daemon.py 2006-06-28 20:38:41 UTC (rev 
62130)
+++ trunk/release/monobuild/scheduler-daemon.py 2006-06-28 20:43:56 UTC (rev 
62131)
@@ -3,7 +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) But, if we have jail multiplicity, the current design would be better
+# 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) But, if we have jail multiplicity, the current design would be 
better, or we just start another thread for the mirror jail?
 # Possible TODO: For the slower build platforms, we could check to make sure 
the build succeeded on i386 before starting... ?
 
 import sys
@@ -29,94 +29,87 @@
 tarballs = datastore.source_file_repo()
 
 
-class build_latest(threading.Thread):
+class jail_scheduler(threading.Thread):
 
-       def __init__(self, distro, package_name):
+       def __init__(self, distro):
                threading.Thread.__init__(self)
 
                self.distro = distro
-               self.package_name = package_name
 
-               self.setName("%s - %s" % (distro, package))
+               self.setName(distro)
 
-               self.done = False
+       def exit_if_interrupted(self):
+               if sigint_event.isSet():
+                       # TODO: what's the best way to exit a thread? _exit?  
return?
+                       print "%s:\tExiting because of user interruption" % 
self.distro
+                       sys.exit(1)
 
-       def interrupt(self):
-               self.done = True
-
-
        def run(self):
 
                distro = self.distro
-               package_name = self.package_name
+               print "%s:\tStarting scheduler" % (distro)
 
-               pack_obj = packaging.package("", package_name)
-
-               if not pack_obj.valid_build_platform(distro):
-                       print "%s does not build on %s (BUILD_HOSTS), thread 
exiting..." % (package_name, distro)
-                       return
-
-               while not self.done:
-                       # Reload config info (only useful for wakeup)
+               while True:
+                       # Reload config info (only useful for sleep times and 
which packages to build for a distro)
                        reload(config)
-                       started_build = 0
 
-                       # Check to see what the latest tarball is
-                       tarball_filename = tarballs.get_latest_tarball("HEAD", 
package_name)
+                       packages_to_build = []
+                       for pack_def in config.sd_latest_build_packages:
+                               pack_obj = packaging.package("", pack_def)
+                               if pack_obj.valid_build_platform(distro):
+                                       packages_to_build.append(pack_def)
 
-                       if not tarball_filename:
-                               print "*** Error getting latest tarball (%s, 
%s) (Probably doesn't exist...)!!!" % (distro, package_name)
-                               print "Sleeping %d minute(s)..." % 
config.sd_wakeup_interval
+                       num_started_builds = 0
+                       start_time = utils.get_time()
 
-                               time.sleep(config.sd_wakeup_interval * 60)
+                       # Build each package for this jail
+                       for package_name in packages_to_build:
 
-                               # Break out of the while loop and finish if 
CTRL-C is pushed
-                               if sigint_event.isSet():
-                                       self.interrupt()
+                               self.exit_if_interrupted()
 
-                               continue
+                               # Check to see what the latest tarball is
+                               tarball_filename = 
tarballs.get_latest_tarball("HEAD", package_name)
 
-                       #print "Latest tarball: " + tarball_filename
+                               if not tarball_filename:
+                                       print "%s:\t*** Error getting latest 
tarball (%s) (Probably doesn't exist...)!!!" % (distro, package_name)
 
-                       # Get version
-                       version, ext = 
version_re.search(tarball_filename).groups()
+                               else:
 
-                       info = datastore.build_info("HEAD", distro, 
package_name, version)
+                                       #print "Latest tarball: " + 
tarball_filename
 
-                       # Build if the build doesn't exist already
-                       if not info.exists:
-                               # TODO: this double check needs to be more 
accurate
-                               # Check one more time to make sure the build 
doesn't exist
-                               time.sleep(2)
-                               if not info.exists:
-                                       #print "Build! (%s, %s, %s)" % (distro, 
package_name, version)
+                                       # Get version
+                                       version, ext = 
version_re.search(tarball_filename).groups()
 
-                                       command = "cd %s; ./build %s %s %s" % 
(config.packaging_dir, distro, package_name, version)
-                                       print command
+                                       info = datastore.build_info("HEAD", 
distro, package_name, version)
 
-                                       (code, output) = 
utils.launch_process(command, print_output=0)
-                                       started_build = 1
-                                       # Testing...
-                                       #code = 2
-                                       
-                                       # Is the jail busy?  if so, just repeat 
this loop (and select a new tarball if a newer one exists)      
-                                       if code == 2:
-                                               print "Jail (%s) is busy or 
offline... will retry again" % distro
-                                               started_build = 0
-                               else:
-                                       print "Skipping existing build (%s, %s, 
%s)" % (distro, package_name, version)
+                                       # Build if the build doesn't exist 
already
+                                       if not info.exists:
+                                               command = "cd %s; ./build %s %s 
%s" % (config.packaging_dir, distro, package_name, version)
+                                               print "%s:\t%s" % (distro, 
command)
 
-                       else:
-                               print "Skipping existing build (%s, %s, %s)" % 
(distro, package_name, version)
+                                               num_started_builds += 1
+                                               # TODO: hmm... is this not 
blocking?  Seems this code continues before being able to run tests?
+                                               (code, output) = 
utils.launch_process(command, print_output=0)
+                                               # Testing...
+                                               #code = 2
+                                               
+                                               # Is the jail busy?  if so, 
just repeat this loop (and select a new tarball if a newer one exists)      
+                                               # Hmm... this really shouldn't 
happen, as much at least
+                                               if code == 2:
+                                                       print "%s:\tJail is 
busy or offline... will retry again (%s)" % (distro, package_name)
+                                                       num_started_builds -= 1
 
+                                               if code == 5:
+                                                       print "%s:\tbuild info 
is missing, but packages exist... ?? will retry again (%s)" % (distro, 
package_name)
+                                                       num_started_builds -= 1
+                                       else:
+                                               print "%s:\tSkipping existing 
build (%s, %s)" % (distro, package_name, version)
 
-                       if not started_build:
-                               print "Sleeping %d minute(s)..." % 
config.sd_wakeup_interval
-                               time.sleep(config.sd_wakeup_interval * 60)
 
-                       # Break out of the while loop and finish if CTRL-C is 
pushed
-                       if sigint_event.isSet():
-                               self.interrupt()
+                       time_duration = utils.time_duration_asc(start_time, 
utils.get_time() ) * 60
+                       if num_started_builds == 0 and time_duration < 
config.sd_wakeup_interval:
+                               print "%s:\tSleeping %d seconds..." % (distro, 
config.sd_wakeup_interval - time_duration)
+                               time.sleep(config.sd_wakeup_interval - 
time_duration)
 
 
 
@@ -134,14 +127,13 @@
 threads = []
 
 for distro in config.sd_latest_build_distros:
-       for package in config.sd_latest_build_packages:
-               thread = build_latest(distro,package)
-               thread.start()
+       thread = jail_scheduler(distro)
+       thread.start()
 
-               # For debugging (This will run each thread one at a time)
-               #thread.run()
+       # For debugging (This will run each thread one at a time)
+       #thread.run()
 
-               threads.append(thread)
+       threads.append(thread)
 
 # Sleep if threads are still alive
 #  Wow... here was the key... the main thread would exit, but pressing ctrl-c 
would go to the main thread (which had already exited)

Modified: trunk/release/monobuild/sync-daemon.py
===================================================================
--- trunk/release/monobuild/sync-daemon.py      2006-06-28 20:38:41 UTC (rev 
62130)
+++ trunk/release/monobuild/sync-daemon.py      2006-06-28 20:43:56 UTC (rev 
62131)
@@ -36,6 +36,7 @@
        # Add tarball_map
        dirs += ['../../../packaging/tarball_map']
 
+       print " *** Gathering dirs ***"
        # Gather dirs to synchronize
        for i in ['HEAD', 'RELEASE']:
                for distro in os.listdir(config.build_info_dir + os.sep + i):
@@ -56,13 +57,13 @@
 
        os.chdir(config.build_info_dir)
 
+       print " *** Syncing ***"
        #  For some reason the --delete option crashes when running the second 
time to go-mono.com and mono.ximian.com ... ?
        # rsync all files over, and don't include the builds... just logs and 
info.xml
        status, output = utils.launch_process('rsync -avzR -e ssh 
--exclude=files %s %s:%s' % (" ".join(dirs), host, target_dir))
 
 
 while(1):
-       print " *** Syncing ***"
        sync_dirs()
        print " *** Sleeping ***"
        time.sleep(10)

Modified: trunk/release/monobuild/tarball-builder-daemon.py
===================================================================
--- trunk/release/monobuild/tarball-builder-daemon.py   2006-06-28 20:38:41 UTC 
(rev 62130)
+++ trunk/release/monobuild/tarball-builder-daemon.py   2006-06-28 20:43:56 UTC 
(rev 62131)
@@ -20,7 +20,7 @@
 
 log = logger.Logger(filename='tarball_builder.log')
 
-class mktarball_loop(threading.Thread):
+class tarball_builder(threading.Thread):
 
         def __init__(self):
                 threading.Thread.__init__(self)
@@ -31,7 +31,12 @@
                reload(config)
 
                self.max_poll_interval = config.td_max_poll_interval
+               self.network_error_interval = config.td_network_error_interval
 
+               self.num_sequential = config.td_num_sequential
+
+               self.sequential = config.td_sequential
+
                self.src_repo = src_repo_utils.svn(config.MONO_ROOT)
                self.distfiles = datastore.source_file_repo()
 
@@ -44,40 +49,41 @@
 
                while not sigint_event.isSet():
 
+                       start_time = utils.get_time()
+
                        self.load_info()
 
                        # routinely check for updates (sleep every so often)
+                       for pack_name, pack_obj in self.pack_objs.iteritems():
 
-                       # get latest version from the tree
-                       latest_tree_rev = self.src_repo.latest_tree_revision()
-                       log.log("Latest tree rev: %d\n" % latest_tree_rev)
+                               # get latest version from the tree
+                               latest_tree_rev = 
self.src_repo.latest_tree_revision()
+                               print "Latest tree rev: %d (%s)" % 
(latest_tree_rev, pack_name) 
 
-                       if not latest_tree_rev:
-                               log.log("Error getting latest tree rev, trying 
later...\n")
-                               
-                               log.log("Sleeping for %d minute(s)...\n" % 
self.max_poll_interval)
-                               time.sleep(60 * self.max_poll_interval)
-                               continue
+                               if not latest_tree_rev:
+                                       log.log("Error getting latest tree rev, 
trying later... (%s)\n" % pack_name)
 
-                       # Only do for the last couple of commits, rather than 
constantly updating a base revision
-                       if latest_tree_rev <= 10:
-                               starting_rev = 1
-                       else:
-                               starting_rev = latest_tree_rev - 10
+                                       # Restart for loop over...
+                                       break
 
+                               # Only do for the last couple of commits, 
rather than constantly updating a base revision
+                               if latest_tree_rev <= self.num_sequential:
+                                       starting_rev = 1
+                               else:
+                                       starting_rev = latest_tree_rev - 
self.num_sequential
 
-                       # Pretty much do every commit (for binary search on 
regressions) (should be adjustable)
-                       #  The + 1 is so that the latest tree revision will be 
checked (range func does not include the last number in the sequence)
-                       for i in range(starting_rev, latest_tree_rev + 1):
+                               # If we're not building each and every checkin, 
only build the latest
+                               if not self.sequential:
+                                       starting_rev = latest_tree_rev
 
-                               for pack_name, pack_obj in 
self.pack_objs.iteritems():
+                               # Pretty much do every commit (for binary 
search on regressions) (should be adjustable)
+                               #  The + 1 is so that the latest tree revision 
will be checked (range func does not include the last number in the sequence)
+                               for i in range(starting_rev, latest_tree_rev + 
1):
 
                                        latest_for_package = 
self.src_repo.latest_path_revision(pack_obj.info['HEAD_PATH'], revision=i)
                                        if not self.distfiles.contains('HEAD', 
pack_name, str(latest_for_package)) and not sigint_event.isSet():
                                                command = "cd %s; ./mktarball 
%s snap %d" % (config.packaging_dir, pack_name, latest_for_package)
-                                               log.log("Executing: %s\n" % 
command)
-                                               # TODO: Logging
-                                               #  daemon log
+                                               log.log("Executing: %s\n" % 
(command) )
 
                                                # TODO: the system needs to be 
smarter about reinstalling the same rpms over and over...
 
@@ -85,27 +91,29 @@
                                                #  Log will be for brief info, 
and the console will watch what's currently going on
                                                  # (For some reason my signal 
gets ignored if I'm using os.system... seems to work with popen)
                                                (code, output) = 
utils.launch_process(command)
-                                               print "Exit code: %d" % code
+                                               log.log("Exit code: %d (%s)\n" 
% (code, pack_name))
 
                                                # handle jail busy errors (exit 
code of 2)
                                                if code == 2:
-                                                       print "Jail busy, 
retrying later..."
+                                                       print "Jail busy, 
retrying later... (%s)" % pack_name
 
                                                # Handle failed tarballs...
-                                               elif not 
self.distfiles.contains('HEAD', pack_name, str(latest_for_package)):
-                                                       log.log("Tarball 
creation failed...\n")
-                                                       
self.distfiles.add_file('HEAD', pack_name, str(latest_for_package), 
"tarball_creation_failed")
+                                               elif code:
+                                                       log.log("Tarball 
creation failed...(%s)\n" %pack_name)
 
                                                        # Send out the log with 
the tarball, or at least a link... ?
                                                        link = 
"http://monobuild1.boston.ximian.com/tarball_logs/HEAD/%s/%d.log"; % (pack_name, 
latest_for_package)
                                                        utils.send_mail('[EMAIL 
PROTECTED]', '[EMAIL PROTECTED]', 'mktarball failed (%s %d)' % (pack_name, 
latest_for_package), "mktarball has failed for package %s revision %d\n\n%s" % 
(pack_name, latest_for_package, link))
 
-                       # TODO: Don't sleep if the above loop took longer than 
max_poll_interval
-                       if not sigint_event.isSet():
-                               log.log("Sleeping for %d minute(s)...\n" % 
self.max_poll_interval)
-                               time.sleep(60 * self.max_poll_interval)
+                       time_duration = utils.time_duration_asc(start_time, 
utils.get_time()) * 60
 
+                       # Only sleep if this loop was shorter than 
max_poll_interval
+                       #  and if we do sleep, discount the time_duration
+                       if not sigint_event.isSet() and time_duration < 
self.max_poll_interval:
+                               print "Sleeping for %d seconds..." % 
(self.max_poll_interval - time_duration)
+                               time.sleep(self.max_poll_interval - 
time_duration)
 
+
 # Signal handler routine
 #  This will let the thread finish when CTRL-C is pushed
 def keyboard_interrupt(signum, frame):
@@ -118,7 +126,7 @@
 # Set signal handler
 signal.signal(signal.SIGINT, keyboard_interrupt)
 
-thread = mktarball_loop()
+thread = tarball_builder()
 thread.start()
 
 # Sleep in main thread if child thread is still alive (This allows correct 
signal handling)

Modified: trunk/release/monobuild/www/build.js
===================================================================
--- trunk/release/monobuild/www/build.js        2006-06-28 20:38:41 UTC (rev 
62130)
+++ trunk/release/monobuild/www/build.js        2006-06-28 20:43:56 UTC (rev 
62131)
@@ -1,3 +1,20 @@
+// Set a cookie for the users timezone
+
+var today = new Date ()
+var inaweek = new Date ()
+
+// In seconds
+var monobuild_tzo = today.getTimezoneOffset()*60*(-1)
+
+inaweek.setTime (today.getTime () + (1000 * 60 * 60 * 24 * 7))
+var expires = "; expires=" + inaweek.toGMTString ()
+
+document.cookie = "monobuild_tzo=" + monobuild_tzo + expires
+
+// Testing...
+//document.write(monobuild_tzo)
+
+
 // Figure out which set of check boxes to toggle and then toggle them all
 function toggleCheckBoxes(checkboxName)
 {

Modified: trunk/release/monobuild/www/python/monobuild.py
===================================================================
--- trunk/release/monobuild/www/python/monobuild.py     2006-06-28 20:38:41 UTC 
(rev 62130)
+++ trunk/release/monobuild/www/python/monobuild.py     2006-06-28 20:43:56 UTC 
(rev 62131)
@@ -268,6 +268,8 @@
        except KeyError:
                return "Invalid arguments"
 
+       timezone_offset = www_utils.get_tz_cookie(req.headers_in)
+
        versions = build.get_versions(HEAD_or_RELEASE, platform, package)
        versions = utils.version_sort(versions)
        versions.reverse()
@@ -312,7 +314,11 @@
                                duration = "Running for %s" % 
utils.time_duration_asc(values['start'], utils.get_time())
                        else:
                                duration = "?"
-               
+
+                       # New times based on clients timezone (accurrate?)
+                       tz_start = utils.adjust_for_timezone(timezone_offset, 
values['start'])
+                       tz_finish = utils.adjust_for_timezone(timezone_offset, 
values['finish'])
+
                        html += """
 
                                <h3>Build status - %s</h3>
@@ -343,7 +349,7 @@
                                <h4>Build Steps</h4>
                                <p>
                                <table>
-                               <tbody>""" % (version, values['start'], 
values['finish'], duration, values['buildhost'])
+                               <tbody>""" % (version, tz_start, tz_finish, 
duration, values['buildhost'])
 
                        # Start through the build steps...      
                        for step in build_info.get_steps_info(read_info=0):

Modified: trunk/release/monobuild/www/python/test.py
===================================================================
--- trunk/release/monobuild/www/python/test.py  2006-06-28 20:38:41 UTC (rev 
62130)
+++ trunk/release/monobuild/www/python/test.py  2006-06-28 20:43:56 UTC (rev 
62131)
@@ -1,5 +1,8 @@
 #!/usr/bin/env python
 
+import Cookie
+import time
+import calendar
 
 def index(req, **vars):
         return "Hello world!"
@@ -14,3 +17,22 @@
 
         return return_string
 
+def cookie_tztest(req, **vars):
+
+       my_cookie = Cookie.SimpleCookie()
+
+        return_string = time.asctime(time.gmtime())
+
+       req.content_type = "text/html"
+
+       if req.headers_in.has_key('Cookie'):
+               my_cookie.load(req.headers_in['Cookie'])
+               tzo_seconds = my_cookie['monobuild_tzo'].value
+               timestamp = time.asctime(time.gmtime())
+
+               seconds_past_epoch = calendar.timegm(time.strptime(timestamp))
+               seconds_past_epoch += int(tzo_seconds)
+               return_string = time.asctime(time.gmtime(seconds_past_epoch))
+
+       return return_string
+

Modified: trunk/release/packaging/build
===================================================================
--- trunk/release/packaging/build       2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/packaging/build       2006-06-28 20:43:56 UTC (rev 62131)
@@ -248,6 +248,7 @@
 if not skip_steps:
        remote_env = {}
        remote_env['HEAD_or_RELEASE'] = "HEAD"
+       remote_env['DISTRO'] = distro
        counter = 1
        while(1):
                if package.info.has_key('POSTBUILD_STEP_NAME%d' % counter) and 
package.info.has_key('POSTBUILD_STEP%d' % counter):

Modified: trunk/release/packaging/conf/sunos-10-x86
===================================================================
--- trunk/release/packaging/conf/sunos-10-x86   2006-06-28 20:38:41 UTC (rev 
62130)
+++ trunk/release/packaging/conf/sunos-10-x86   2006-06-28 20:43:56 UTC (rev 
62131)
@@ -1,11 +1,13 @@
 [EMAIL PROTECTED]
 USE_ZIP_PKG=1
-#target_command_prefix='export PATH=/opt/csw/bin:/opt/csw/gcc4/bin:$PATH; '
 
-# Use the gnu andopensource software
-target_command_prefix='export PATH=/usr/sfw/bin:$PATH; '
+# Use the gnu and opensource software
+target_command_prefix='export PATH=/usr/sfw/bin:/usr/ccs/bin:$PATH; '
 
-#strip_path=/usr/ccs/bin/strip
+# Notes about this arch:
+# Removed -mt option from gthread .pc file
+
+strip_path=/usr/ccs/bin/strip
 tar_path=/usr/sfw/bin/gtar
 
 web_index=8

Modified: trunk/release/packaging/defs/mono
===================================================================
--- trunk/release/packaging/defs/mono   2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/packaging/defs/mono   2006-06-28 20:43:56 UTC (rev 62131)
@@ -160,7 +160,6 @@
        # Change offsize from 64 to 32 in configure
        # Removed -mt option from gthread .pc file
        
-       #./configure --prefix=/tmp/install
        ./configure --prefix=/opt/mono
        gmake || exit 1
 
@@ -282,9 +281,13 @@
 
 POSTBUILD_STEP_NAME4="test-cas"
 POSTBUILD_STEP4 () {
-       cd mono/tests/cas
-       #make -k check
-       make test
+       # These hang the tests on sles-9-ia64, so skip for now...
+       if [ $DISTRO != "sles-9-ia64" ] ; then
+               cd mono/tests/cas
+               make -k test
+       else
+               echo "Skipping..."
+       fi
 }
 
 POSTBUILD_STEP_NAME5="cleanup"

Modified: trunk/release/packaging/do-zip-build
===================================================================
--- trunk/release/packaging/do-zip-build        2006-06-28 20:38:41 UTC (rev 
62130)
+++ trunk/release/packaging/do-zip-build        2006-06-28 20:43:56 UTC (rev 
62131)
@@ -39,7 +39,7 @@
 
 
 # Find type of source
-source_dir = utils.unpack_source(os.path.basename(sources[0]), 
tar_path=utils.get_dict_var('jail_tar_path', env.info) )
+source_dir = utils.unpack_source(os.path.basename(sources[0]), 
tar_path=utils.get_dict_var('tar_path', env.info) )
 
 arch = pack_def.package_env.info['arch']
 
@@ -63,10 +63,17 @@
 os.environ['version'] = version
 build_command = shell_code
 
-# Trying to load this missing file fails on solaris 10... ? So, only load if 
it exists.
-if os.path.exists('/tmp/build_deps/env.sh'):
-       build_command = ". /tmp/build_deps/env.sh ; " + build_command
+# Trying to load this missing file fails on solaris 10... ?
+# Create an empty file if it's not there
+if not os.path.exists('/tmp/build_deps'):
+       os.mkdir('/tmp/build_deps')
+if not os.path.exists('/tmp/build_deps/env.sh'):
+       fd = open('/tmp/build_deps/env.sh', 'w')
+       fd.write("")
+       fd.close()
 
+build_command = ". /tmp/build_deps/env.sh ; " + build_command
+
 # TODO:  For some reason the above exit isn't being called on failures
 #  (Still an issue... ?)
 if(os.system(build_command)):

Modified: trunk/release/packaging/mktarball
===================================================================
--- trunk/release/packaging/mktarball   2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/packaging/mktarball   2006-06-28 20:43:56 UTC (rev 62131)
@@ -74,6 +74,9 @@
 
 env.lock_env()
 
+# Update tarball status to "inprogress"
+repo.add_file(HEAD_or_RELEASE, package, version, "inprogress")
+
 if package_obj.info.has_key('MONO_DEPS'):
        (status, output) = utils.launch_process('./install-deps %s %s' % 
(distro, package), logger=log_obj)
        if status:
@@ -96,6 +99,7 @@
 if status:
         env.unlock_env()
         log_obj.log("Source dist file creation failed\n")
+       repo.add_file(HEAD_or_RELEASE, package, version, "failure")
         sys.exit(1)
 
 # get tarball filename

Modified: trunk/release/pyutils/config.py
===================================================================
--- trunk/release/pyutils/config.py     2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/pyutils/config.py     2006-06-28 20:43:56 UTC (rev 62131)
@@ -50,21 +50,29 @@
 
 # Tarball daemon config info
 ##############################################
-# Minutes
-td_max_poll_interval = 5
-#td_max_poll_interval = 1
+# Seconds
+td_network_error_interval = 60
+td_max_poll_interval = 30
+#td_max_poll_interval = 10
 
+# How many revisions to go back when starting to build sequential tarballs
+td_num_sequential = 10
+
 # static list of packages to create tarballs for
 td_packages = ['mono', 'mono-1.1.13', 'mono-1.1.7', 'mono-1.1.8', 'libgdiplus']
 
+# builds each and every checkin if true, otherwise, only build the latest 
checkin
+td_sequential = False
+
 ##############################################
 
 
 # Scheduler daemon config info
 ##############################################
 #  (auto reloading only works for the wakeup_interval on the scheduler daemon)
-#sd_wakeup_interval = 1
-sd_wakeup_interval = 10
+# seconds
+sd_wakeup_interval = 60
+#sd_wakeup_interval = 300
 
 # Currently not used...
 sd_sequential_build_distros = [ 'redhat-9-i386' ]

Modified: trunk/release/pyutils/datastore.py
===================================================================
--- trunk/release/pyutils/datastore.py  2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/pyutils/datastore.py  2006-06-28 20:43:56 UTC (rev 62131)
@@ -140,7 +140,8 @@
                        # If this is the release and packagename
                        if stuff[0] == HEAD_or_RELEASE and stuff[1] == 
package_name:
                                # If the tarball creation succeeded
-                               if self.info[":".join([HEAD_or_RELEASE, 
package_name, stuff[2]])] != "tarball_creation_failed":
+                               key2 = self.info[":".join([HEAD_or_RELEASE, 
package_name, stuff[2]])]
+                               if key2 != "failure" and key2 != "inprogress":
                                        versions.append(stuff[2])
 
                # TODO: Better error handling here
@@ -148,6 +149,7 @@
                        latest = utils.version_sort(versions).pop()
                        latest_filename = self.info[":".join([HEAD_or_RELEASE, 
package_name, latest])]
                except:
+                       print "Error getting latest tarball (%s, %s, %s)..." % 
(HEAD_or_RELEASE, package_name, latest)
                        latest_filename = ""
 
                return latest_filename
@@ -158,7 +160,7 @@
 
                source_path = self.info[":".join([HEAD_or_RELEASE, 
package_name, rev])]
 
-               if source_path == "tarball_creation_failed":
+               if source_path == "failure" or source_path == "inprogress":
                        version = ""
                else:
                        filename = os.path.basename(source_path)
@@ -185,10 +187,11 @@
                for key in self.info.iterkeys():
                        H_or_R, name, revision = key.split(":")
                        if H_or_R == HEAD_or_RELEASE and name == component:
-                               if self.info[key] == "tarball_creation_failed":
-                                       state = "failure"
-                               else:   state = "success"
+                               state = self.info[key]
 
+                               if state != "failure" and state != "inprogress":
+                                       state = "success"
+
                                info['revisions'].append(revision)
                                info['state'][revision] = state
 

Modified: trunk/release/pyutils/packaging.py
===================================================================
--- trunk/release/pyutils/packaging.py  2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/pyutils/packaging.py  2006-06-28 20:43:56 UTC (rev 62131)
@@ -297,7 +297,7 @@
 
                # Create source and package symlinks if the dirs are there, but 
not the symlink
                if self.info.has_key('def_alias') and self.HEAD_or_RELEASE == 
"RELEASE" and self.create_dirs_links:
-                       print "Link alias: %s" % self.info['def_alias']
+                       #print "Link alias: %s" % self.info['def_alias']
                        for dir in (dirs):
                                if not os.path.islink(dir) and not 
self.inside_jail:
                                        if os.path.exists(dir):
@@ -544,7 +544,6 @@
                                        print "Required key (%s) not found in 
bundle config file" % key
                                        sys.exit(1)
                else:
-                       print "No bundle specified.  Using latest version of 
packages..."
+                       #print "No bundle specified.  Using latest version of 
packages..."
+                       pass
 
-
-

Modified: trunk/release/pyutils/sshutils.py
===================================================================
--- trunk/release/pyutils/sshutils.py   2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/pyutils/sshutils.py   2006-06-28 20:43:56 UTC (rev 62131)
@@ -80,11 +80,20 @@
                        else:
                                command = "sudo " + command
 
-               if output_timeout:
+               if output_timeout or terminate_reg:
                        # Copy some files over
                        self.copy_to([ config.packaging_dir + 
"/../pyutils/utils.py", config.packaging_dir + "/../pyutils/launch_process.py" 
], self.build_location)
+
+                       term_portion = ""
+                       if terminate_reg:
+                               term_portion = "--terminate_reg=%s" % 
terminate_reg
+
+                       output_portion = ""
+                       if output_timeout:
+                               output_portion = "--output_timeout=%s" % 
output_timeout
+
                        # Surround command with escaped double quotes in order 
to run multiline commands
-                       command = "%s/launch_process.py --kill_process_group 
--output_timeout=%s \\\"%s\\\" " % (self.build_location, output_timeout, 
command)
+                       command = "%s/launch_process.py --kill_process_group %s 
%s \\\"%s\\\" " % (self.build_location, term_portion, output_portion, command)
 
                if self.target_command_prefix:
                        command = self.target_command_prefix + command
@@ -122,7 +131,7 @@
                if self.print_command: self.log("Executing %s\n" % 
command_string)
 
                if self.execute_command:
-                       (code, output) = utils.launch_process(command_string, 
print_output=self.print_output, terminate_reg=terminate_reg, logger=self.logger)
+                       (code, output) = utils.launch_process(command_string, 
print_output=self.print_output, logger=self.logger)
                # restore logger
                if logger:
                        self.logger = primary_logger

Modified: trunk/release/pyutils/utils.py
===================================================================
--- trunk/release/pyutils/utils.py      2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/pyutils/utils.py      2006-06-28 20:43:56 UTC (rev 62131)
@@ -531,6 +531,17 @@
        # Return minutes of duration
        return (finish_time - start_time) / 60
 
+def adjust_for_timezone(tzo_seconds, time_string):
+
+       return_string = time_string
+       if time_string:
+               seconds_past_epoch = calendar.timegm(time.strptime(time_string))
+               seconds_past_epoch += int(tzo_seconds)
+               return_string = time.asctime(time.gmtime(seconds_past_epoch))
+
+       return return_string
+
+
 def rpm_query(query_format, file):
        """Args: query_format, file.
        query_format can be a list or a string.

Modified: trunk/release/pyutils/www_utils.py
===================================================================
--- trunk/release/pyutils/www_utils.py  2006-06-28 20:38:41 UTC (rev 62130)
+++ trunk/release/pyutils/www_utils.py  2006-06-28 20:43:56 UTC (rev 62131)
@@ -1,5 +1,9 @@
 import re
 
+import Cookie
+import time
+import calendar
+
 # all the arguments should be validated to only contain letters, a dash and 
numbers
 # Any characters outside of that range should be changed to '.'
 
@@ -16,4 +20,16 @@
        return new_args
                
 
-       
+def get_tz_cookie(headers_in):
+       """Returns 0 if timezone isn't set, otherwise, return seconds 
difference for that timezone"""
+
+       return_val = 0
+        my_cookie = Cookie.SimpleCookie()
+
+        if headers_in.has_key('Cookie'):
+                my_cookie.load(headers_in['Cookie'])
+                return_val = my_cookie['monobuild_tzo'].value
+
+        return return_val
+
+

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

Reply via email to