Commit by: bear Modified files: hardhat/cycle.py 1.10 1.11 hardhat/hardhatlib.py 1.90 1.91 hardhat/hardhatutil.py 1.7 1.8 hardhat/tinderbox.py 1.31 1.32 hardhat/buildscripts/newchandler.py 1.44 1.45
Log message: Hardhat changes for cleanup and to also change the download index.html text to more accurately reflect the new installers. Installer changes for bug fixes Change to the newchandler tinder script to have it pull the internal/installers tree since the distribution builds require it Bug 2650, Bug 2640, Bug 2626, Bug 2607 r=heikki Bug 2639 r=bear ViewCVS links: http://cvs.osafoundation.org/index.cgi/hardhat/cycle.py.diff?r1=text&tr1=1.10&r2=text&tr2=1.11 http://cvs.osafoundation.org/index.cgi/hardhat/hardhatlib.py.diff?r1=text&tr1=1.90&r2=text&tr2=1.91 http://cvs.osafoundation.org/index.cgi/hardhat/hardhatutil.py.diff?r1=text&tr1=1.7&r2=text&tr2=1.8 http://cvs.osafoundation.org/index.cgi/hardhat/tinderbox.py.diff?r1=text&tr1=1.31&r2=text&tr2=1.32 http://cvs.osafoundation.org/index.cgi/hardhat/buildscripts/newchandler.py.diff?r1=text&tr1=1.44&r2=text&tr2=1.45 Index: hardhat/cycle.py diff -u hardhat/cycle.py:1.10 hardhat/cycle.py:1.11 --- hardhat/cycle.py:1.10 Wed Feb 2 19:38:36 2005 +++ hardhat/cycle.py Thu Mar 10 15:30:33 2005 @@ -1,15 +1,12 @@ #!/usr/bin/env python -import hardhatutil, time, smtplib, os, sys -from optparse import OptionParser +import hardhatutil, time, os, sys whereAmI = os.path.dirname(os.path.abspath(hardhatutil.__file__)) homeDir = os.environ['HOME'] buildDir = os.path.join(homeDir, "tinderbuild") stopFile = os.path.join(buildDir, "stop") -defaultDomain = "osafoundation.org" -defaultRsyncServer = "192.168.101.46" # IP of current server def main(): curDir = os.path.abspath(os.getcwd()) Index: hardhat/buildscripts/newchandler.py diff -u hardhat/buildscripts/newchandler.py:1.44 hardhat/buildscripts/newchandler.py:1.45 --- hardhat/buildscripts/newchandler.py:1.44 Mon Nov 15 15:04:49 2004 +++ hardhat/buildscripts/newchandler.py Thu Mar 10 15:30:34 2005 @@ -81,7 +81,11 @@ # Initialize sources print "Setup source tree..." log.write("- - - - tree setup - - - - - - -\n") - + + outputList = hardhatutil.executeCommandReturnOutputRetry( + [cvsProgram, "-q -z3", "checkout", cvsVintage, "internal/installers"]) + hardhatutil.dumpOutputList(outputList, log) + outputList = hardhatutil.executeCommandReturnOutputRetry( [cvsProgram, "-q -z3", "checkout", cvsVintage, "chandler"]) hardhatutil.dumpOutputList(outputList, log) Index: hardhat/hardhatutil.py diff -u hardhat/hardhatutil.py:1.7 hardhat/hardhatutil.py:1.8 --- hardhat/hardhatutil.py:1.7 Fri Oct 15 10:00:29 2004 +++ hardhat/hardhatutil.py Thu Mar 10 15:30:33 2005 @@ -1,7 +1,10 @@ import os, sys, time, sha, md5 from stat import * -def findInPath(path,fileName): +def findInPath(path, fileName, strict=1): + """ + Find filename in path. + """ dirs = path.split(os.pathsep) for dir in dirs: if os.path.isfile(os.path.join(dir, fileName)): @@ -9,6 +12,9 @@ if os.name == 'nt' or sys.platform == 'cygwin': if os.path.isfile(os.path.join(dir, fileName + ".exe")): return os.path.join(dir, fileName + ".exe") + if strict: + raise CommandNotFound, fileName + return None Index: hardhat/hardhatlib.py diff -u hardhat/hardhatlib.py:1.90 hardhat/hardhatlib.py:1.91 --- hardhat/hardhatlib.py:1.90 Thu Mar 3 18:18:14 2005 +++ hardhat/hardhatlib.py Thu Mar 10 15:30:33 2005 @@ -1,5 +1,5 @@ -__version__ = "$Revision: 1.90 $" -__date__ = "$Date: 2005/03/04 02:18:14 $" +__version__ = "$Revision: 1.91 $" +__date__ = "$Date: 2005/03/10 23:30:33 $" __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation" __license__ = "GPL -- see LICENSE.txt" @@ -19,7 +19,7 @@ """ import os, sys, glob, fnmatch, errno, string, shutil, fileinput, re, popen2 - +import hardhatutil # Earlier versions of Python don't define these, so let's include them here: True = 1 @@ -28,12 +28,12 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - defaults = { - 'verbosity' : 1, - 'showenv' : 0, - 'version' : 'release', - 'showlog' : False, - 'interactive' : True, - 'outputdir' : "", + 'verbosity' : 1, + 'showenv' : 0, + 'version' : 'release', + 'showlog' : False, + 'interactive' : True, + 'outputdir' : "", } @@ -120,15 +120,13 @@ CHANDLERHOME, CHANDLERBIN = getCHANDLERvars(buildenv) - buildenv['sh'] = findInPath(buildenv['path'], "sh") - buildenv['make'] = findInPath(buildenv['path'], "make") - buildenv['cvs'] = findInPath(buildenv['path'], "cvs") - buildenv['scp'] = findInPath(buildenv['path'], "scp") - buildenv['tar'] = findInPath(buildenv['path'], "tar") - buildenv['gzip'] = findInPath(buildenv['path'], "gzip") - buildenv['zip'] = findInPath(buildenv['path'], "zip") - buildenv['cvs'] = findInPath(buildenv['path'], "cvs") - #buildenv['perl'] = findInPath(buildenv['path'], "perl") + buildenv['sh'] = hardhatutil.findInPath(buildenv['path'], "sh", 0) + buildenv['make'] = hardhatutil.findInPath(buildenv['path'], "make", 0) + buildenv['cvs'] = hardhatutil.findInPath(buildenv['path'], "cvs") + buildenv['scp'] = hardhatutil.findInPath(buildenv['path'], "scp", 0) + buildenv['tar'] = hardhatutil.findInPath(buildenv['path'], "tar", 0) + buildenv['gzip'] = hardhatutil.findInPath(buildenv['path'], "gzip", 0) + buildenv['zip'] = hardhatutil.findInPath(buildenv['path'], "zip", 0) # set OS-specific variables if buildenv['os'] == 'win': @@ -138,7 +136,7 @@ buildenv['swig'] = os.path.join(CHANDLERBIN, 'release', 'bin', 'swig.exe') buildenv['swig_d'] = os.path.join(CHANDLERBIN, 'debug', 'bin', 'swig.exe') - buildenv['makensis'] = findInPath(buildenv['path'], "makensis.exe") + buildenv['makensis'] = hardhatutil.findInPath(buildenv['path'], "makensis.exe", 0) import os_win @@ -1557,12 +1555,17 @@ "Running gzip on " + fileRoot + ".tar") return fileRoot + ".tar.gz" -def makeInstaller(buildenv, directories, fileRoot): - """This assumes that directory is an immediate child of the current dir""" +def makeInstaller(buildenv, directories, fileRoot, majorVersion='0', minorVersion='0', releaseVersion='1'): + """ + This assumes that directory is an immediate child of the current dir + """ # TODO: OS X (dmg?) support if buildenv['os'] == 'win': + if not buildenv['makensis']: + raise hardhatutil.CommandNotFound, 'makensis' nsisScriptPath = os.path.join(buildenv['root'], "internal", "installers", "win") - scriptOption = '/DSNAP_%s /DDISTRIB_DIR=%s' % (buildenv['version'].upper(), fileRoot) + scriptOption = '/DSNAP_%s /DDISTRIB_DIR=%s /DDISTRIB_VERSION=%s.%s-%s' % \ + (buildenv['version'].upper(), fileRoot, majorVersion, minorVersion, releaseVersion) if sys.platform == 'cygwin': scriptName = os.path.join(nsisScriptPath, "makeinstaller.sh") @@ -1585,9 +1588,10 @@ elif buildenv['os'] == 'posix': specPath = os.path.join(buildenv['root'], "internal", "installers", "rpm") scriptName = os.path.join(specPath, "makeinstaller.sh") + version = '%s.%s' % (majorVersion, minorVersion) executeCommand(buildenv, "HardHat", - [scriptName, specPath, os.path.join(specPath, "chandler.spec"), buildenv['root'], fileRoot], + [scriptName, specPath, os.path.join(specPath, "chandler.spec"), buildenv['root'], fileRoot, version, releaseVersion], "Building Linux (RPM) Installer") installTargetFile = '%s.i386.rpm' % fileRoot @@ -1610,16 +1614,6 @@ f.write(newtext) f.close() -def findInPath(path,fileName): - dirs = path.split(os.pathsep) - for dir in dirs: - if os.path.isfile(os.path.join(dir, fileName)): - return os.path.join(dir, fileName) - if os.name == 'nt' or sys.platform == 'cygwin': - if os.path.isfile(os.path.join(dir, fileName + ".exe")): - return os.path.join(dir, fileName + ".exe") - return None - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Exception Classes Index: hardhat/tinderbox.py diff -u hardhat/tinderbox.py:1.31 hardhat/tinderbox.py:1.32 --- hardhat/tinderbox.py:1.31 Tue Mar 8 00:33:43 2005 +++ hardhat/tinderbox.py Thu Mar 10 15:30:33 2005 @@ -82,8 +82,10 @@ path = os.environ.get('PATH', os.environ.get('path')) cvsProgram = hardhatutil.findInPath(path, "cvs") print "cvs =", cvsProgram - rsyncProgram = hardhatutil.findInPath(path, "rsync") - print "rsync =", rsyncProgram + + if not skipRsync: + rsyncProgram = hardhatutil.findInPath(path, "rsync") + print "rsync =", rsyncProgram startInt = int(time.time()) startTime = str(startInt) @@ -315,11 +317,14 @@ if os.path.isdir(subdir): hardhatutil.rmdirRecursive(subdir) -_descriptions = { - 'enduser' : ["End-Users' distribution", "If you just want to use Chandler, this distribution contains everything you need -- just download, install and run."], - 'developer' : ["Developers' distribution", "If you're a developer and want to run Chandler in debugging mode, this distribution contains debug versions of the binaries. Assertions are active, the __debug__ global is set to True, and memory leaks are listed upon exit. You can also use this distribution to develop your own parcels (See <a href='http://wiki.osafoundation.org/bin/view/Chandler/ParcelLoading'>Parcel Loading</a> for details on loading your own parcels)."], -} +_instructions = { + '.gz' : ['tarball', 'Download the tarball, extract into a new directory and run.'], + '.zip' : ['tarball', 'Download the zip file, extract into a new directory and run.'], + '.dmg' : ['install', 'Download the dmg file, double-click to open, copy the application to your preferred location and run.'], + '.rpm' : ['install', 'Download the rpm file, install and run.'], + '.exe' : ['install', 'Download the installation executable, double-click to install and run.'], +} def CreateIndex(outputDir, newDirName, nowString, buildName): """ @@ -351,20 +356,77 @@ 'biological weapons).</p>\n' index = head1 + head2 + cryptoblurb + userInstall = None + userTarball = None + devInstall = None + devTarball = None + for distro in ('enduser', 'developer'): lines = _readFile(os.path.join(outputDir, newDirName, distro)) - + for line in lines: actualDistroFile = line.strip() actualDistro = os.path.join(outputDir, newDirName, actualDistroFile) - index += '<p>Download <a href="' + actualDistroFile + '"> ' +\ - _descriptions[distro][0] + '</a> (' +\ - hardhatutil.fileSize(actualDistro) + '): <br>\n' +\ - ' MD5 checksum: ' + hardhatutil.MD5sum(actualDistro) +\ - '<br>\n' +\ - ' SHA checksum: ' + hardhatutil.SHAsum(actualDistro) +\ - '<br>\n<p>' + _descriptions[distro][1] + '</p>\n' + distroExt = os.path.splitext(actualDistroFile)[1] + + if _instructions.has_key(distroExt): + distroType = _instructions[distroExt][0] + else: + raise MissingFileError, ('Unknown distribution extension: %s' % distroExt) + + if distroType == 'tarball': + if distro == 'enduser': + userTarball = (actualDistroFile, actualDistro, _instructions[distroExt][1]) + else: + devTarball = (actualDistroFile, actualDistro, _instructions[distroExt][1]) + else: + if distro == 'developer': + devInstall = (actualDistroFile, actualDistro, _instructions[distroExt][1]) + else: + userInstall = (actualDistroFile, actualDistro, _instructions[distroExt][1]) + + if userInstall: + index += '<h3>End-User Installer</h3>\n' +\ + '<p>If you just want to use Chandler, then this is the file to download.<br/>\n' +\ + userInstall[2] + '</p>\n' + + index += '<p><a href="%s">%s</a> (%s)<br/>\n' % \ + (userInstall[0], userInstall[0], hardhatutil.fileSize(userInstall[1])) + index += 'MD5 checksum: %s<br/>\nSHA checksum: %s</p>\n' % \ + (hardhatutil.MD5sum(userInstall[1]), hardhatutil.SHAsum(userInstall[1])) + + if devInstall: + index += '<h3>Developer Installer</h3>\n' +\ + "<p>If you're a developer and want to run Chandler in debugging mode, " +\ + 'this distribution contains debug versions of the binaries. ' +\ + 'Assertions are active, the __debug__ global is set to True, ' +\ + 'and memory leaks are listed upon exit. You can also use this ' +\ + 'distribution to develop your own parcels (See ' +\ + '<a href="http://wiki.osafoundation.org/bin/view/Chandler/ParcelLoading">Parcel Loading</a> ' +\ + 'for details on loading your own parcels).<br/>\n' +\ + devInstall[2] + '</p>\n' + + index += '<p><a href="%s">%s</a> (%s)<br/>\n' % \ + (devInstall[0], devInstall[0], hardhatutil.fileSize(devInstall[1])) + index += 'MD5 checksum: %s<br/>\nSHA checksum: %s</p>\n' % \ + (hardhatutil.MD5sum(actualDistro), hardhatutil.SHAsum(devInstall[1])) + + index += '<h3>Compressed Install Images</h3>\n' +\ + '<p>The End-User and Developer compressed images contain a snapshot of Chandler.\n' +\ + 'Use these if you cannot or do not want to use the installers.</p>\n' + + if userTarball: + index += '<p>End-Users: <a href="%s">%s</a> (%s): %s<br/>\n' % \ + (userTarball[0], userTarball[0], hardhatutil.fileSize(userTarball[1]), userTarball[2]) + index += 'MD5 checksum: %s<br/>\nSHA checksum: %s</p>\n' % \ + (hardhatutil.MD5sum(userTarball[1]), hardhatutil.SHAsum(userTarball[1])) + + if devTarball: + index += '<p>Developers: <a href="%s">%s</a> (%s): %s<br/>\n' % \ + (devTarball[0], devTarball[0], hardhatutil.fileSize(devTarball[1]), devTarball[2]) + index += 'MD5 checksum: %s<br/>\nSHA checksum: %s</p>\n' % \ + (hardhatutil.MD5sum(devTarball[1]), hardhatutil.SHAsum(devTarball[1])) index += '</body></html>\n' _______________________________________________ Commits mailing list Commits@osafoundation.org http://lists.osafoundation.org/mailman/listinfo/commits