revert last changes

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@382 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2007-08-04 11:03:55 +00:00
parent 613fd19b01
commit 54be0422f2
6 changed files with 39 additions and 35 deletions
-31
View File
@@ -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
+1 -1
View File
@@ -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)
+2 -1
View File
@@ -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
+4
View File
@@ -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)
+1 -2
View File
@@ -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
###################################################
+31
View File
@@ -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/<pkgcat>/<pkgname-pkgver>/*
# you never know if gentoo devs change these things
dbDESCRIPTION = "DESCRIPTION"