Esempio n. 1
0
def createcompressedfile(srcdir, fname, target):
    # The following targets are supported:
    # unix - Unix lineendings, UTF-8 encoding and gzip compression
    # win  - Windows lineendings, 8859 enconding and zip compression
    # mac  - Unix lineendings, 8859 encoding and zip compression
    tmpworkdir = localconf.tmpdir + project
    fname = filesdir + fname
    srcdir = outputdir + srcdir + os.sep

    printdoc.safe_mkdir(tmpworkdir)
    printdoc.rmrf(tmpworkdir)

    # Create zip and tgz archives.  In order to get the right path in
    # the compressed files, copy the source to the temporary directory
    # with the project
    printdoc.rmrf(tmpworkdir)
    os.system('cp -R ' + srcdir + '* ' + tmpworkdir)

    if target == 'unix':
        os.system('cd ' + localconf.tmpdir + '; tar zcvf ' + fname + '.tgz ' +
                  project)

    if target == 'win':
        os.system('rm ' + fname + '.zip')
        printdoc.unix2dos(tmpworkdir)
        #printdoc.convertencoding(tmpworkdir,'ISO-8859-1')
        os.system('cd ' + localconf.tmpdir + '; zip -r ' + fname + '.zip ' +
                  project)

    if target == 'mac':
        os.system('rm ' + fname + '.zip')
        #printdoc.convertencoding(tmpworkdir,'ISO-8859-1')
        os.system('cd ' + localconf.tmpdir + '; zip -r ' + fname + '.zip ' +
                  project)
Esempio n. 2
0
def createcompressedfile(srcdir, fname, target):
    # The following targets are supported:
    # unix - Unix lineendings, UTF-8 encoding and gzip compression
    # win  - Windows lineendings, 8859 enconding and zip compression
    # mac  - Unix lineendings, 8859 encoding and zip compression
    tmpworkdir = localconf.tmpdir + project
    fname = filesdir + fname
    srcdir = outputdir + srcdir + os.sep

    printdoc.safe_mkdir(tmpworkdir)
    printdoc.rmrf(tmpworkdir)

    # Create zip and tgz archives.  In order to get the right path in
    # the compressed files, copy the source to the temporary directory
    # with the project
    printdoc.rmrf(tmpworkdir)
    os.system("cp -R " + srcdir + "* " + tmpworkdir)

    if target == "unix":
        os.system("cd " + localconf.tmpdir + "; tar zcvf " + fname + ".tgz " + project)

    if target == "win":
        os.system("rm " + fname + ".zip")
        printdoc.unix2dos(tmpworkdir)
        # printdoc.convertencoding(tmpworkdir,'ISO-8859-1')
        os.system("cd " + localconf.tmpdir + "; zip -r " + fname + ".zip " + project)

    if target == "mac":
        os.system("rm " + fname + ".zip")
        # printdoc.convertencoding(tmpworkdir,'ISO-8859-1')
        os.system("cd " + localconf.tmpdir + "; zip -r " + fname + ".zip " + project)
Esempio n. 3
0
def createbinaryfile(filename, ext, target):
    tmpworkdir = outputdir + project + "-mat"
    bdir = outputdir + project + "-" + ext

    printdoc.safe_mkdir(bdir)
    printdoc.rmrf(bdir)

    s = "cp -r " + tmpworkdir + "/* " + bdir
    os.system(s)

    s = "cp -r " + outputdir + project + "-" + ext + "-addon/* " + bdir
    os.system(s)

    createcompressedfile(project + "-" + ext, project + "-" + versionstring + "-" + ext, target)
Esempio n. 4
0
def createbinaryfile(filename, ext, target):
    tmpworkdir = outputdir + project + '-mat'
    bdir = outputdir + project + '-' + ext

    printdoc.safe_mkdir(bdir)
    printdoc.rmrf(bdir)

    s = 'cp -r ' + tmpworkdir + '/* ' + bdir
    os.system(s)

    s = 'cp -r ' + outputdir + project + '-' + ext + '-addon/* ' + bdir
    os.system(s)

    createcompressedfile(project + '-' + ext,
                         project + '-' + versionstring + '-' + ext, target)