Exemple #1
0
  Create tarballs for a given DIRAC release
"""
__RCSID__ = "$Id$"

from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.Core.Base import Script
from DIRAC.Core.Utilities import List, File, Distribution, Platform, Subprocess, CFG

import sys, os, re, urllib2, tempfile, getpass, imp

try:
    import hashlib as md5
except ImportError:
    import md5

globalDistribution = Distribution.Distribution()

g_uploadCmd = {
    'DIRAC':
    "( cd %OUTLOCATION% ; tar -cf - *.tar.gz *.md5 *.cfg *.pdf *.html ) | ssh [email protected] 'cd /afs/cern.ch/lhcb/distribution/DIRAC3/installSource &&  tar -xvf - && ls *.tar.gz > tars.list'",
    'LHCb':
    "( cd %OUTLOCATION% ; tar -cf - *.tar.gz *.md5 *.cfg *.pdf *.html ) | ssh [email protected] 'cd  /afs/cern.ch/lhcb/distribution/LHCbDirac_project &&  tar -xvf - && ls *.tar.gz > tars.list'",
    'ILC':
    "( cd %OUTLOCATION% ; tar -cf - *.tar.gz *.md5 *.cfg *.pdf *.html ) | ssh [email protected] 'cd  /afs/cern.ch/lhcb/distribution/DIRAC3/tars &&  tar -xvf - && ls *.tar.gz > tars.list'",
}

###
# Load release manager from dirac-install
##
diracInstallLocation = os.path.join(os.path.dirname(__file__), "dirac-install")
if not os.path.isfile(diracInstallLocation):
    if not vTuple:
        gLogger.error("%s is not a valid version" % svnVersion)
        sys.exit(1)
    branchName = "v%d" % vTuple[0]
    if vTuple[1]:
        branchName += "r%d" % vTuple[1]

#Get username
if not svnUsername:
    svnUsername = getpass.getuser()
gLogger.notice("Using %s as username" % svnUsername)

#Start the magic!
for svnPackage in List.fromChar(svnPackages):

    packageDistribution = Distribution.Distribution(svnPackage)
    packageDistribution.setSVNUser(svnUsername)
    buildCFG = packageDistribution.getVersionsCFG()

    if 'Versions' not in buildCFG.listSections():
        gLogger.error(
            "versions.cfg file in package %s does not contain a Versions top section"
            % svnPackage)
        continue

    branchBasePath = '%s/branches/%s/%s' % (svnPackage, svnPackage,
                                            branchPrefix)
    branchPath = '%s/%s' % (branchBasePath, branchName)
    gLogger.notice("Branch path will be %s" % (branchPath))

    if packageDistribution.getDevPath().find("https") == 0: