Author: gnichols Date: 2009-12-22 18:01:07 +0000 (Tue, 22 Dec 2009) New Revision: 276
Modified: trunk/tools/v7-release.py Log: 484657 - hts uses code deprecated in python 2.6
Modified: trunk/tools/v7-release.py =================================================================== --- trunk/tools/v7-release.py 2009-12-22 18:00:19 UTC (rev 275) +++ trunk/tools/v7-release.py 2009-12-22 18:01:07 UTC (rev 276) @@ -1,7 +1,7 @@ #!/usr/bin/python
""" -This script automates submission of HTS to the brew build system +This script automates submission of v7 to the brew build system by checking in a new tarball and updated rpm spec file.
To use in a specific development environment, two directories must @@ -24,51 +24,29 @@ buildDir = "/home/gnichols/build/v7" distDir = "/home/gnichols/dist/v7"
-sourceTar = "%s/v7-%s-%s.tar.bz2" % (buildDir, v7.version.version, v7.version.release) -for rhelVersion in [4, 5]: - print "building for RHEL %u" % rhelVersion +sourceTar = "%s/v7-%s-%s.el%s.tar.bz2" % (buildDir, v7.version.version, v7.version.release, v7.version.rhel_version)
- distSubdir = "RHEL-%u-HWCert" % rhelVersion - distVersionDir = "%s/%s" % (distDir, distSubdir) - os.chdir(distVersionDir) +print "building for RHEL %u" % v7.version.rhel_version
- # copy tarball - destTar = "v7-%s-%s.el%u.tar.bz2" % (v7.version.version, v7.version.release, rhelVersion) - shutil.copy(sourceTar, destTar) - print "copied %s to %s" % (sourceTar, destTar) +distSubdir = "RHEL-%u-HWCert" % v7.version.rhel_version +distVersionDir = "%s/%s" % (distDir, distSubdir) +os.chdir(distVersionDir)
- # upload the tarball - command = "make upload FILES=%s" % destTar - print command - os.system(command) - - # update the v7.spec - print - print "editing the v7.spec" - buildSpec = open("%s/v7.spec" % buildDir) - distSpec = open("v7.spec", "w") - while 1: - line = buildSpec.readline() - if not line: - break - else: - if "%define release" in line: - distSpec.write("%%define release %s.el%u" % (v7.version.release, rhelVersion)) - else: - distSpec.write(line) - buildSpec.close() - distSpec.close() +# upload the tarball +command = "make upload FILES=%s" % sourceTar +print command +os.system(command)
- # commit the new source and spec - command = "cvs commit -m "R%s" . " % v7.version.release - print command - os.system(command) - command = "make tag" - print command - os.system(command) +# commit the new source and spec +command = "cvs commit -m "R%s" . " % v7.version.release +print command +os.system(command) +command = "make tag" +print command +os.system(command)
- # build it - command = "make build COLLECTION=hwcert-%uE" % rhelVersion - print command - os.system(command) +# build it +command = "make build COLLECTION=hwcert-%uE" % v7.version.rhel_version +print command +os.system(command)
v7-commits@lists.stg.fedorahosted.org