From 54be0422f20eebab70b4458c4889026cecd7cff4 Mon Sep 17 00:00:00 2001 From: lxnay Date: Sat, 4 Aug 2007 11:03:55 +0000 Subject: [PATCH] revert last changes git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@382 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/clientConstants.py | 31 ------------------------------- libraries/databaseTools.py | 2 +- libraries/entropyConstants.py | 3 ++- libraries/mirrorTools.py | 4 ++++ libraries/remoteTools.py | 3 +-- libraries/serverConstants.py | 31 +++++++++++++++++++++++++++++++ 6 files changed, 39 insertions(+), 35 deletions(-) diff --git a/libraries/clientConstants.py b/libraries/clientConstants.py index 03a028025..db53764c1 100644 --- a/libraries/clientConstants.py +++ b/libraries/clientConstants.py @@ -84,34 +84,3 @@ else: etpConst['gentoo-compat'] = False else: etpConst['gentoo-compat'] = True - -# remote section -etpRemoteSupport = {} -if (not os.path.isfile(etpConst['remoteconf'])): - print "ERROR: "+etpConst['remoteconf']+" does not exist" - sys.exit(50) -else: - f = open(etpConst['remoteconf'],"r") - databaseconf = f.readlines() - f.close() - for line in databaseconf: - if line.startswith("loglevel|") and (len(line.split("loglevel|")) == 2): - loglevel = line.split("loglevel|")[1] - try: - loglevel = int(loglevel) - except: - print "ERROR: invalid loglevel in: "+etpConst['remoteconf'] - sys.exit(51) - if (loglevel > -1) and (loglevel < 3): - etpConst['remoteloglevel'] = loglevel - else: - print "WARNING: invalid loglevel in: "+etpConst['remoteconf'] - import time - time.sleep(5) - - if line.startswith("httphandler|") and (len(line.split("|")) > 2): - servername = line.split("|")[1].strip() - url = line.split("|")[2].strip() - if not url.endswith("/"): - url = url+"/" - etpRemoteSupport[servername] = url \ No newline at end of file diff --git a/libraries/databaseTools.py b/libraries/databaseTools.py index aa63aac80..6f53f55d3 100644 --- a/libraries/databaseTools.py +++ b/libraries/databaseTools.py @@ -89,7 +89,7 @@ def database(options): print_info(green(" (")+ blue(str(currCounter))+"/"+red(str(atomsnumber))+green(") ")+red("Analyzing ")+bold(pkg)+red(" ...")) etpData = reagentTools.extractPkgData(package = etpConst['packagesbindir']+"/"+pkg, structuredLayout = True) # remove shait - entropyTools.spawnCommand("rm -rf "+etpConst['packagestmpdir']+"/"+pkg) + entropyTools.spawnCommand("rm -rf "+etpConst['packagestmpdir']+"/"+pkg+"*") # fill the db entry idpk, revision, etpDataUpdated, accepted = dbconn.addPackage(etpData) diff --git a/libraries/entropyConstants.py b/libraries/entropyConstants.py index 0229b4a51..79be19da2 100644 --- a/libraries/entropyConstants.py +++ b/libraries/entropyConstants.py @@ -347,7 +347,8 @@ etpConst = { 'officialrepositoryname': "sabayonlinux.org", # our official repository name 'packagedbdir': "/db", # directory of the database file in the .tbz2 package 'packagedbfile': "/data.db", # database file in the directory above - 'packagecontentdir': "/package" # directory of the package file in the .tbz2 package + 'packagecontentdir': "/package", # directory of the package file in the .tbz2 package + } # Handlers used by entropy to run and retrieve data remotely, using php helpers diff --git a/libraries/mirrorTools.py b/libraries/mirrorTools.py index 442985ac3..2edcacadb 100644 --- a/libraries/mirrorTools.py +++ b/libraries/mirrorTools.py @@ -144,6 +144,10 @@ class handlerFTP: mirrorLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"handlerFTP.setPASV: called -> "+str(bool)) self.ftpconn.set_pasv(bool) + def setChmod(self,chmodvalue,file): + mirrorLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"handlerFTP.setChmod: called -> "+str(chmodvalue)+" for file -> "+str(file)) + return self.ftpconn.voidcmd("SITE CHMOD "+str(chmodvalue)+" "+str(file)) + def getFileMtime(self,path): mirrorLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"handlerFTP.getFileMtime: called for -> "+path) rc = self.ftpconn.sendcmd("mdtm "+path) diff --git a/libraries/remoteTools.py b/libraries/remoteTools.py index ff5910696..a06b5f49a 100644 --- a/libraries/remoteTools.py +++ b/libraries/remoteTools.py @@ -35,7 +35,7 @@ remoteLog = logTools.LogFile(level=etpConst['remoteloglevel'],filename = etpCons import timeoutsocket import urllib2 -timeoutsocket.setDefaultSocketTimeout(60) +timeoutsocket.setDefaultSocketTimeout(300) # Get checksum of a package by running md5sum remotely (using php helpers) # @returns hex: if the file exists @@ -62,7 +62,6 @@ def getRemotePackageChecksum(serverName,filename): except: # no HTTP support? return None - ################################################### # HTTP/FTP equo/download functions ################################################### diff --git a/libraries/serverConstants.py b/libraries/serverConstants.py index 89dcf6019..8f8736433 100644 --- a/libraries/serverConstants.py +++ b/libraries/serverConstants.py @@ -237,6 +237,37 @@ else: import time time.sleep(5) +# remote section +etpRemoteSupport = {} +if (not os.path.isfile(etpConst['remoteconf'])): + print "ERROR: "+etpConst['remoteconf']+" does not exist" + sys.exit(50) +else: + f = open(etpConst['remoteconf'],"r") + databaseconf = f.readlines() + f.close() + for line in databaseconf: + if line.startswith("loglevel|") and (len(line.split("loglevel|")) == 2): + loglevel = line.split("loglevel|")[1] + try: + loglevel = int(loglevel) + except: + print "ERROR: invalid loglevel in: "+etpConst['remoteconf'] + sys.exit(51) + if (loglevel > -1) and (loglevel < 3): + etpConst['remoteloglevel'] = loglevel + else: + print "WARNING: invalid loglevel in: "+etpConst['remoteconf'] + import time + time.sleep(5) + + if line.startswith("httphandler|") and (len(line.split("|")) > 2): + servername = line.split("|")[1].strip() + url = line.split("|")[2].strip() + if not url.endswith("/"): + url = url+"/" + etpRemoteSupport[servername] = url + # Portage /var/db///* # you never know if gentoo devs change these things dbDESCRIPTION = "DESCRIPTION"