some more fixes
git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@247 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
TODO list (for developers only):
|
||||
- build() and world(), on enzyme, add the support for whitelist+cron
|
||||
- build(), on enzyme, add license blacklist (packages that cannot be shipped in a binary form)
|
||||
- activator: add support for stable/unstable branch
|
||||
- entropy: add support for stable/unstable branch
|
||||
- reagent: complete the database stabilize function
|
||||
- reagent: add the option to delete a package in the database
|
||||
- activator tasks:
|
||||
- COMPLETE sync !
|
||||
- add/remove packages from the database
|
||||
- tidy tool: cleanup policy to prune old binaries
|
||||
- database update and management between me and reagent
|
||||
- tidy tool will be a joint work between reagent and activator libraries: cleanup policy to prune old binaries
|
||||
|
||||
- Sabayon Linux USE flags: remove all server related use flags
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ def print_help():
|
||||
entropyTools.print_info(" \t\t"+entropyTools.green("inject-package-info")+"\t Inject an Entropy dump inside the database (file path is mandatory)")
|
||||
entropyTools.print_info(" \t\t"+entropyTools.green("restore-package-info")+"\t Reinitialize a package entry looking at the current install")
|
||||
entropyTools.print_info(" \t\t"+entropyTools.green("create-empty-database")+"\t Create an empty Entropy database file in the specified <path>")
|
||||
entropyTools.print_info(" \t\t"+entropyTools.green("stabilize")+"\t\t Mark as stable a package, a list of packages, world")
|
||||
entropyTools.print_info(" \t"+entropyTools.green(entropyTools.bold("cleanup"))+entropyTools.yellow("\t\t to clean temporary files"))
|
||||
|
||||
options = sys.argv[1:]
|
||||
|
||||
@@ -274,6 +274,27 @@ def database(options):
|
||||
connection.close()
|
||||
entropyTools.print_info(entropyTools.green(" * ")+entropyTools.red("Entropy database file ")+entropyTools.bold(mypath[0])+entropyTools.red(" successfully initialized."))
|
||||
|
||||
elif (options[0] == "stabilize"):
|
||||
myatoms = options[1:]
|
||||
if len(myatoms) == 0:
|
||||
entropyTools.print_error(entropyTools.yellow(" * ")+entropyTools.red("Not enough parameters"))
|
||||
sys.exit(303)
|
||||
# is world?
|
||||
if myatoms[0] == "world":
|
||||
# open db in read only
|
||||
dbconn = etpDatabase(readOnly = True)
|
||||
worldPackages = dbconn.listAllPackages()
|
||||
# This is the list of all the packages available in Entropy
|
||||
print worldPackages
|
||||
dbconn.closeDB()
|
||||
|
||||
# filter dups
|
||||
myatoms = list(set(myatoms))
|
||||
|
||||
print "DEBUG: Proposed atoms: "+str(myatoms)
|
||||
|
||||
|
||||
|
||||
############
|
||||
# Functions and Classes
|
||||
#####################################################################################
|
||||
@@ -468,6 +489,9 @@ class etpDatabase:
|
||||
return update, revision
|
||||
|
||||
def addPackage(self,etpData, revision = 0):
|
||||
print
|
||||
print etpData['content']
|
||||
print
|
||||
self.cursor.execute(
|
||||
'INSERT into etpData VALUES '
|
||||
'(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'
|
||||
@@ -588,6 +612,26 @@ class etpDatabase:
|
||||
result.append(row)
|
||||
return result
|
||||
|
||||
def listAllPackages(self):
|
||||
result = []
|
||||
self.cursor.execute('SELECT * FROM etpData')
|
||||
for row in self.cursor:
|
||||
result.append(row[0])
|
||||
return result
|
||||
|
||||
def listStablePackages(self):
|
||||
result = []
|
||||
self.cursor.execute('SELECT * FROM etpData WHERE branch = "stable"')
|
||||
for row in self.cursor:
|
||||
result.append(row[0])
|
||||
return result
|
||||
|
||||
def listUnstablePackages(self):
|
||||
result = []
|
||||
self.cursor.execute('SELECT * FROM etpData WHERE branch = "unstable"')
|
||||
for row in self.cursor:
|
||||
result.append(row[0])
|
||||
return result
|
||||
|
||||
# ------ BEGIN: activator tools ------
|
||||
|
||||
|
||||
@@ -147,7 +147,6 @@ def getEtpRemoteDatabaseStatus():
|
||||
else:
|
||||
revision = 0
|
||||
else:
|
||||
print "database file not avail"
|
||||
# then set mtime to 0 and quit
|
||||
revision = 0
|
||||
info = [uri+"/"+etpConst['etpurirelativepath']+etpConst['etpdatabasefilegzip'],revision]
|
||||
|
||||
Reference in New Issue
Block a user