some more fixes

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@173 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2007-03-20 08:59:13 +00:00
parent dc7d878982
commit c1eadd3402
3 changed files with 17 additions and 7 deletions
-1
View File
@@ -1,7 +1,6 @@
TODO list (for developers only):
- add a wrapper for qfile and qlist portage-utils tools because our internal repository is at /var/lib/entropy/portage
- add proper SLOTS, FETCH_RESTRICTION support to enzyme, getBestAtom and so on... (maybe directly using emerge output?)
- try to workout the mtime issue of repackaged .tbz2
Project Status:
- entropy: not yet started, nothing to say then
+2 -1
View File
@@ -75,7 +75,8 @@ ETP_UPLOADDIR = "/upload"+"/"+ETP_ARCH_CONST
ETP_STOREDIR = "/store"+"/"+ETP_ARCH_CONST
ETP_CONF_DIR = "/etc/entropy"
ETP_ROOT_DIR = "/"
ETP_HEADER_TEXT = "# Sabayon Linux (C - 2007)\n# Entropy Package Specifications (GPLv2)\n"
# NEVER APPEND another \n to this file because it will break the md5 check of reagent
ETP_HEADER_TEXT = "# Sabayon Linux (C - 2007) - Entropy Package Specifications (GPLv2)\n"
MAX_ETP_REVISION_COUNT = 99999
etpConst = {
+15 -5
View File
@@ -60,6 +60,9 @@ def createDigest(path):
f.flush()
f.close()
# Returns:
# True = if it has generated a new .etp file
# False = if not
def generator(package):
# check if the package provided is valid
@@ -78,6 +81,8 @@ def generator(package):
# look where I can store the file and return its path
etpOutput, etpOutfilePath = allocateFile(etpData)
rc = False
if etpOutfilePath is not None:
print_info(green(" * ")+red("Writing Entropy Specifications file: ")+etpOutfilePath)
f = open(etpOutfilePath,"w")
@@ -86,11 +91,13 @@ def generator(package):
f.close()
# digesting directory
createDigest(etpOutfilePath)
rc = True
else:
print_info(green(" * ")+red("Not generating a new Entropy Specifications file, not needed for ")+bold(packagename))
# clean garbage
os.system("rm -rf "+etpConst['packagestmpdir']+"/"+etpData['name']+"-"+etpData['version'])
return rc
# Enzyme tool called, we need to parse the Store directory and call generator()
def enzyme():
@@ -116,9 +123,11 @@ def enzyme():
tbz2name = tbz2.split("/")[len(tbz2.split("/"))-1]
print_info(" ("+str(counter)+"/"+str(totalCounter)+") Processing "+tbz2name)
tbz2path = etpConst['packagesstoredir']+"/"+tbz2
generator(tbz2path)
# FIXME: do not use os.system()
os.system("mv "+tbz2path+" "+etpConst['packagessuploaddir']+"/ -f")
rc = generator(tbz2path)
if (rc):
os.system("mv "+tbz2path+" "+etpConst['packagessuploaddir']+"/ -f")
else:
os.system("rm -rf "+tbz2path)
# This function extracts all the info from a .tbz2 file and returns them
def extractPkgData(package):
@@ -415,7 +424,8 @@ def allocateFile(etpData):
md5B = md5.new()
md5A.update(cntA)
md5B.update(cntB)
if md5A.digest() == md5B.digest():
if (md5A.digest() == md5B.digest()):
etpOutfilePath = None
else:
# add 1 to: packagename-1.2.3-r1-etpX.etp