diff --git a/handlers/entropy-specifications-generator b/handlers/entropy-specifications-generator index 8949fcc3f..454734be7 100644 --- a/handlers/entropy-specifications-generator +++ b/handlers/entropy-specifications-generator @@ -59,14 +59,24 @@ if (not validFile): entropyTools.print_info("extracting data and calculating info for: "+tbz2File.split("/")[len(tbz2File.split("/"))-1]+" please wait...") # fill all the info etpData = entropyTools.extractPkgData(tbz2File) -#os.mkdir(etpConst['packagestmpdir']+"/") -# ugly, ugly way to print data without caring about type + +# look where I can store the file and return its path +#etpOutfile = entropyTools.allocateFile(etpData) +etpOutfile = "test.etp" + +etpOutput = [] +# append header +etpOutput.append(ETP_HEADER_TEXT) for i in etpData: if (etpData[i]): - entropyTools.print_generic(i+": "+etpData[i]+"\n") + etpOutput.append(i+": "+etpData[i]+"\n") +f = open(etpOutfile,"w") +f.writelines(etpOutput) +f.flush() +f.close() # clean garbage os.system("rm -rf "+etpConst['packagestmpdir']+"/"+etpData['name']+"-"+etpData['version']) -entropyTools.print_info("extracted: "+tbz2File+" to "+etpConst['packagessuploaddir']+" IT'S A FAKE FOR NOW") \ No newline at end of file +entropyTools.print_info("extracted: "+tbz2File+" to "+etpConst['packagessuploaddir']) \ No newline at end of file diff --git a/libraries/entropyConstants.py b/libraries/entropyConstants.py index 3ffbe3058..e0cad94e1 100644 --- a/libraries/entropyConstants.py +++ b/libraries/entropyConstants.py @@ -44,6 +44,7 @@ ETP_REPODIR = "/repository"+ETP_ARCH_VAR ETP_DBDIR = "/database"+ETP_ARCH_VAR ETP_UPDIR = "/upload"+ETP_ARCH_VAR ETP_STOREDIR = "/store"+ETP_ARCH_VAR +ETP_HEADER_TEXT = "~entropy~API"+ETP_API+ETP_API_SUBLEVEL+"~(C)~Sabayon Linux~released under the GPLv2~\n" etpConst = { 'packagestmpdir': ETP_DIR+ETP_TMPDIR, # etpConst['packagestmpdir'] --> temp directory