From a88bd381a783d0eff511753988af3af0aea85f83 Mon Sep 17 00:00:00 2001 From: lxnay Date: Sun, 4 Feb 2007 23:29:59 +0000 Subject: [PATCH] more bug fixes, additions, stabilizations and such git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@61 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- .../entropy-specifications-generator-test | 11 ++++++++ libraries/entropyConstants.py | 28 +++++++------------ libraries/entropyTools.py | 21 ++++++++++++-- 3 files changed, 40 insertions(+), 20 deletions(-) create mode 100755 handlers/tests/entropy-specifications-generator-test diff --git a/handlers/tests/entropy-specifications-generator-test b/handlers/tests/entropy-specifications-generator-test new file mode 100755 index 000000000..54d52090d --- /dev/null +++ b/handlers/tests/entropy-specifications-generator-test @@ -0,0 +1,11 @@ +#!/bin/sh +cd .. +for tbz2 in `find $1 -name "*.tbz2"`; do + python entropy-specifications-generator $tbz2 + if [ "$?" != "0" ]; then + echo + echo "test of "$tbz2" failed" + echo + sleep 10 + fi +done diff --git a/libraries/entropyConstants.py b/libraries/entropyConstants.py index 3c94ea38e..6bf97d02d 100644 --- a/libraries/entropyConstants.py +++ b/libraries/entropyConstants.py @@ -19,7 +19,7 @@ pData = { 'useflags': "", # USE flags used 'license': "", # License adpoted 'keywords': "", # supported ARCHs (by the SRC) - 'supportedBinaryARCHs': "", # supported ARCHs (by the BIN) + 'binkeywords': "", # supported ARCHs (by the BIN) 'download': "", # link to download the binary package 'sources': "", # link to the sources 'mirrorlinks': "", # =mirror://openoffice|link1|link2|link3 @@ -32,26 +32,18 @@ pData = { ETP_API = "1" ETP_API_SUBLEVEL = ".0" - +ETP_DIR = "/var/lib/entropy" # variables # should we import these into make.conf ? -pTree = "/var/lib/entropy/packages" +pTree = ETP_DIR+"/packages" pTmpDir = pTree+"/tmp" -# fetch PORTAGE_BINHOST -f = open("/etc/make.conf","r") -makeConf = f.readlines() -pBinHost = "" -for line in makeConf: - line = line.strip() - if line.startswith("PORTAGE_BINHOST"): - pBinHost = line.split('"')[1] - break -if (pBinHost == ""): - # force PORTAGE_BINHOST to our defaults - pBinHost = "http://www.sabayonlinux.org/binhost/All/" -if not pBinHost.endswith("/"): - pBinHost += "/" +pBinDir = pTree+"/repository/%%ARCH%%" +pDatabaseDir = ETP_DIR+"/database/" +# FIXME: workout the PORTAGE_BINHOST management +# use PORTAGE_BINHOST with multiple entries? +pBinHost = "ftp://192.168.1.254/binhost/%%ARCH%%/" +pDbHost = "ftp://192.168.1.254/database/%%ARCH%%/" import commands if (commands.getoutput("q -V").find("portage-utils") != -1): @@ -62,7 +54,7 @@ else: pFindLibraryXT = "equery belongs -en " # the ARCHs that we support -pArchs = ["x86", "amd64"] +pArchs = ["x86", "amd64"] # maybe ppc someday # Portage /var/db///* # you never know if gentoo devs change these things diff --git a/libraries/entropyTools.py b/libraries/entropyTools.py index 79f7ed10b..8c9b6b461 100644 --- a/libraries/entropyTools.py +++ b/libraries/entropyTools.py @@ -134,6 +134,7 @@ def extractPkgData(package): # Fill sources # FIXME: resolve mirror:// in something useful + # FIXME: resolve amd64? url x86? url # portage.thirdpartymirrors['openoffice'] for example # !! keep mirror:// but write at the beginning something like try: @@ -142,6 +143,22 @@ def extractPkgData(package): f.close() except IOError: pass + + # manage pData['sources'] to create pData['mirrorlinks'] + # =mirror://openoffice|link1|link2|link3 + tmpMirrorList = pData['sources'].split() + for i in tmpMirrorList: + if i.startswith("mirror://"): + # parse what mirror I need + x = i.split("/")[2] + mirrorlist = portage.thirdpartymirrors[x] + out = "="+i+"|" + for mirror in mirrorlist: + out += mirror+"|" + if out.endswith("|"): + out = out[:len(out)-1] + pData['mirrorlinks'] += out+" " + pData['mirrorlinks'] = removeSpaceAtTheEnd(pData['mirrorlinks']) # Fill USE f = open(tbz2TmpDir+dbUSE,"r") @@ -177,9 +194,9 @@ def extractPkgData(package): pkgArchs = pData['keywords'] for i in pArchs: if pkgArchs.find(i) != -1 and (pkgArchs.find("-"+i) == -1): # in case we find something like -amd64... - pData['supportedBinaryARCHs'] += i+" " + pData['binkeywords'] += i+" " - pData['supportedBinaryARCHs'] = removeSpaceAtTheEnd(pData['supportedBinaryARCHs']) + pData['binkeywords'] = removeSpaceAtTheEnd(pData['binkeywords']) # Fill dependencies # to fill dependencies we use *DEPEND files