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)
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)
# Release for other developers to download if 'develmat' in todo: #printdoc.git_stageexport(project['dir'],project['mat']) os.system('rm -rf '+project['mat']+'*') os.system('cp -r '+project['dir']+' '+project['mat']) os.system('rm -r -f '+project['mat']+'.git') printdoc.printdoc(projectname,'mat') fname=filesdir+projectname+'-devel-'+versionstring # Create the Unix src package os.system('tar zcvf '+fname+'.tgz '+projectname+'/') # Create the Windows src package os.system('rm '+fname+'.zip') printdoc.unix2dos(filesdir+projectname) os.system('zip -r '+fname+'.zip '+projectname+'/') # Release for users to download if 'releasemat' in todo: os.system('mat2doc mat '+projectdir) # Remove unwanted files os.system('rm -rf '+project['mat']+'test_bench') #os.system('rm -rf '+project['mat']+'timing') printdoc.printdoc(projectname,'mat') fname=filesdir+projectname+'-'+versionstring print fname