示例#1
0
def packageAndSend(server):
    pkgutil.debug("sending to %s, script=%s..." % (server.host, server.task))

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")
    os.makedirs("tmptree")

    print " - setting up lgpl subdir..."
    shutil.copytree("qt", "tmptree/lgpl")
    pkgutil.expandMacroes("tmptree/lgpl", lgpl_header)

    print " - setting up commercial subdir..."
    shutil.copytree("qt", "tmptree/commercial")
    pkgutil.expandMacroes("tmptree/commercial", commercial_header)

    if server.platform == pkgutil.PLATFORM_WINDOWS:
        shutil.copy(server.task, "tmptree/task.bat")
    else:
        shutil.copy(server.task, "tmptree/task.sh")

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending to host: %s.." % (server.host))
    pkgutil.sendDataFileToHost(server.host, pkgutil.PORT_SERVER, zipFile)
示例#2
0
def packageAndSend(server):
    pkgutil.debug("sending to %s, script=%s..." % (server.host, server.task))

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")
    os.makedirs("tmptree")

    print " - setting up lgpl subdir..."
    shutil.copytree("qt", "tmptree/lgpl");
    pkgutil.expandMacroes("tmptree/lgpl", lgpl_header)
    

    print " - setting up commercial subdir..."
    shutil.copytree("qt", "tmptree/commercial");
    pkgutil.expandMacroes("tmptree/commercial", commercial_header)


    if server.platform == pkgutil.PLATFORM_WINDOWS:
        shutil.copy(server.task, "tmptree/task.bat")
    else:
        shutil.copy(server.task, "tmptree/task.sh")

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending to host: %s.." % (server.host))
    pkgutil.sendDataFileToHost(server.host, pkgutil.PORT_SERVER, zipFile)
示例#3
0
def runTask(taskDef):
    (task, path, host) = taskDef

    print "runTask:\n - command='%s'\n - directory='%s'\n - host='%s'" % taskDef

    os.chdir(path)

    exitCode = os.system(task)

    if exitCode:
        fh = open(os.path.join(path, "FATAL.ERROR"), "w")
        fh.write("Exit code: %d\n" % exitCode)
        fh.close()

    resultZipFile = path + ".zip"

    print "runTask: - completed, compressing..."
    callbackFail = False
    try:
        pkgutil.compress(resultZipFile, path)
        pkgutil.sendDataFileToHost(host, pkgutil.PORT_CREATOR, resultZipFile)
    except socket.error, (error, message):
        print "socket error, %s" % (message)
        callbackFail = True
def runTask(taskDef):
    (task, path, host) = taskDef

    print "runTask:\n - command='%s'\n - directory='%s'\n - host='%s'" % taskDef

    os.chdir(path)

    exitCode = os.system(task)

    if exitCode:
        fh = open(os.path.join(path, "FATAL.ERROR"), "w")
        fh.write("Exit code: %d\n" % exitCode)
        fh.close()

    resultZipFile = path + ".zip"

    print "runTask: - completed, compressing..."
    callbackFail = False
    try:
        pkgutil.compress(resultZipFile, path)
        pkgutil.sendDataFileToHost(host, pkgutil.PORT_CREATOR, resultZipFile)
    except socket.error, (error, message):
        print "socket error, %s" % (message)
        callbackFail = True
示例#5
0
def packageAndSend(package):
    pkgutil.debug("packaging and sending: %s..." % package.name())

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")

    shutil.copytree("qtjambi", "tmptree");

    qtEdition = "qt-" + package.license;
    if package.license == pkgutil.LICENSE_PREVIEW:
        qtEdition = "qt-commercial"

    pkgutil.debug(" - creating task script")
    arch = "x86";
    if arch == pkgutil.ARCH_64:
        arch = "x86_64"
    if package.platform == pkgutil.PLATFORM_WINDOWS:
        buildFile = open("tmptree/task.bat", "w")
        buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\" + qtEdition))

        # build eclipse on 32-bit windows...
        if package.hasEclipse():
#            if package.license == pkgutil.LICENSE_EVAL:
#                buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\qt-commercial"))
            buildFile.write("cd scripts\n")
            buildFile.write("call build_eclipse.bat %%cd%%\\..\\eclipse\\qtjambi-4.5 %s %s\n" % (options.eclipseVersion, arch))
            buildFile.write("cd ..\n")
#            if package.license == pkgutil.LICENSE_EVAL:
#                buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\" + qtEdition))
            
        buildFile.write("call ant\n")
        buildFile.write('if "%ERRORLEVEL%" == "0" ' + package.make + ' clean\n')
        buildFile.write("copy %QTDIR%\\bin\\designer.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\lrelease.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\lupdate.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\linguist.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtDesigner4.dll bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtDesignerComponents4.dll bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtScript4.dll bin\n")

    else:
        buildFile = open("tmptree/task.sh", "w")

        qtLocation = "/tmp/qtjambi-package-builder/" + qtEdition
        
        buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, qtLocation))
        buildFile.write("ant\n")
        buildFile.write(package.make + " clean \n")
        
        if package.hasEclipse():
            # a little trick needed to bypass that eclipse tools use
            # gui which will pop up eval dialogs on the build
            # servers...
#            if package.license == pkgutil.LICENSE_EVAL: 
#                buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, "/tmp/qtjambi-package-builder/qt-commercial"))            
            buildFile.write("cd scripts\n")
            buildFile.write("bash ./build_eclipse.sh $PWD/../eclipse/qtjambi-4.5 %s %s\n" % (options.eclipseVersion, arch))
            buildFile.write("cd ..\n")
            buildFile.write("cp -v lib/libqtdesigner.so lib/libqtdesignerplugin.so\n")
            buildFile.write("rm -v lib/libqtdesigner.*\n")
#            if package.license == pkgutil.LICENSE_EVAL: 
#                buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, qtLocation))

        if package.platform == pkgutil.PLATFORM_LINUX:
            buildFile.write("cp -v $QTDIR/bin/designer bin\n")
            buildFile.write("cp -v $QTDIR/bin/lrelease bin\n")
            buildFile.write("cp -v $QTDIR/bin/lupdate bin\n")
            buildFile.write("cp -v $QTDIR/bin/linguist bin\n")
            buildFile.write("jar -xf qtjambi-linux*.jar\n")
            buildFile.write("rm -rf META-INF\n");
            buildFile.write("cp -v $QTDIR/lib/libQtDesigner.so.4 lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtDesignerComponents.so.4 lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtScript.so.4 lib\n")
            buildFile.write("chmod 755 scripts/update_rpath.sh\n");
            buildFile.write("./scripts/update_rpath.sh\n");
        else:
            buildFile.write("cp -vR $QTDIR/bin/Designer.app bin\n")
            buildFile.write("cp -v $QTDIR/bin/lrelease bin\n")
            buildFile.write("cp -v $QTDIR/bin/lupdate bin\n")
            buildFile.write("cp -vR $QTDIR/bin/Linguist.app bin\n")
            buildFile.write("jar -xf qtjambi-mac*.jar\n");
            buildFile.write("rm -rf META-INF\n");
            buildFile.write("cp -v $QTDIR/lib/libQtDesigner.4.dylib lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtDesignerComponents.4.dylib lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtScript.4.dylib lib\n")
            buildFile.write("chmod 755 scripts/update_installname.sh\n");
            buildFile.write("./scripts/update_installname.sh\n");

    buildFile.close()

    pkgutil.debug(" - expanding macroes prior to sending...");
    pkgutil.expandMacroes("tmptree", package.licenseHeader)

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending %s to host: %s.." % (package.name(), package.buildServer))
    pkgutil.sendDataFileToHost(package.buildServer, pkgutil.PORT_SERVER, zipFile)