say goodbye to enzyme, say hello to reagent update function

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@494 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2007-09-09 18:00:43 +00:00
parent b7f1beb335
commit 88a112f60e
11 changed files with 202 additions and 323 deletions
+5 -7
View File
@@ -22,10 +22,7 @@ STRUCTURE:
| ENTROPY // master CLI interface to own them all
| |||
| |||
| enzyme // creates .tbz2 packages (automatically on some specified packages)
| |
| |
\ / reagent // transform metadata info of .tbz2 packages in entropy specification files
\ / reagent // transform metadata info of .tbz2 packages in entropy database entries
' |
| |
| activator // does some QA tests on .etp and .tbz2 files upload data in a consistent way
@@ -42,7 +39,8 @@ STRUCTURE:
|
GUI CLIENTs
Binary Packages path: creation (enzyme) --> Packages store directory --> reagent --> packages upload directory --> activator --> upload --> packages directory
Fabio's note: Project Entropy is dedicated to my father (dead on 2007, January the 9th). Tu come me, non hai mai smesso di credere nei sogni, è questo che ci rende invincibili dentro, ma a volte fragili fuori. Non ti deluderò, ciao papà, ti voglio bene. Non dimenticarti più dei tuoi figli.
Project Entropy is dedicated to my father (dead on 2007, January the 9th).
"""
Tu come me, non hai mai smesso di credere nei sogni, è questo che ci rende invincibili dentro, ma a volte fragili fuori. Non ti deluderò, ciao papà, ti voglio bene. Non dimenticarti più dei tuoi figli.
"""
-4
View File
@@ -1,8 +1,5 @@
TODO list:
- reagent: complete smartapps section
- enzyme, reagent: test kernel dependent packages
- enzyme, build(): add an option to force the continuation of the emerge queue even if a package fails
- enzyme, add a module that integrates revdep-rebuild
- test stabilization code
CLIENT:
- add conflicts dependencies support
@@ -18,7 +15,6 @@ TODO list:
Project Status:
- entropy: will handle all the three tools below
- enzyme: complete. Bug fixing mode.
- reagent: complete. Bug fixing mode.
- activator: complete. Bug fixing mode.
============
-30
View File
@@ -1,30 +0,0 @@
# Project Entropy 1.0 enzyme configuration file
# Packages blacklist
# this list contains the package names that won't never be
# automatically compiled by default
#
# example:
# blacklist|<valid Gentoo package atom 1> <valid Gentoo package atom 2> <valid Gentoo package atom n>
#
# note: you can use ">","<",">=","<=", it's not mandatory by the way
#
blacklist|nmap kde-misc/accel-manager-0.9.2 sys-power/powersave
# DistCC setup
# This section contains the configuration of the distcc servers configured to work with Enzyme
# You should use enzyme to configure this file properly.
# DistCC status (option: enabled/disabled)
distcc-status|disabled
# DistCC enabled hosts
distcc-hosts|localhost 192.168.1.254
# Log level
# 0: No Logging
# 1: Normal Logging
# 2: Verbose Logging
loglevel|1
+63
View File
@@ -991,6 +991,16 @@ class etpDatabase:
)
)
# counter, if != -1
if etpData['counter'] != -1:
self.cursor.execute(
'INSERT into counters VALUES '
'(?,?)'
, ( etpData['counter'],
idpackage,
)
)
# on disk size
try:
self.cursor.execute(
@@ -1265,6 +1275,11 @@ class etpDatabase:
self.cursor.execute('DELETE FROM binkeywords WHERE idpackage = '+idpackage)
# systempackage
self.cursor.execute('DELETE FROM systempackages WHERE idpackage = '+idpackage)
try:
# cpunter
self.cursor.execute('DELETE FROM counters WHERE idpackage = '+idpackage)
except:
pass
try:
# on disk sizes
self.cursor.execute('DELETE FROM sizes WHERE idpackage = '+idpackage)
@@ -1548,6 +1563,7 @@ class etpDatabase:
data['download'] = self.retrieveDownloadURL(idpackage)
data['digest'] = self.retrieveDigest(idpackage)
data['sources'] = self.retrieveSources(idpackage)
data['counter'] = self.retrieveCounter(idpackage)
if (self.isSystemPackage(idpackage)):
data['systempackage'] = 'xxx'
@@ -1700,6 +1716,33 @@ class etpDatabase:
self.databaseCache[int(idpackage)]['retrieveHomepage'] = home
return home
def retrieveCounter(self, idpackage):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"retrieveCounter: retrieving Counter for package ID "+str(idpackage))
''' caching '''
if (self.xcache):
cached = self.databaseCache.get(int(idpackage), None)
if cached:
rslt = self.databaseCache[int(idpackage)].get('retrieveCounter',None)
if rslt:
return rslt
else:
self.databaseCache[int(idpackage)] = {}
counter = -1
try:
self.cursor.execute('SELECT "counter" FROM counters WHERE idpackage = "'+str(idpackage)+'"')
for row in self.cursor:
counter = row[0]
break
except:
pass
''' caching '''
if (self.xcache):
self.databaseCache[int(idpackage)]['retrieveCounter'] = counter
return counter
# in bytes
def retrieveSize(self, idpackage):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"retrieveSize: retrieving Size for package ID "+str(idpackage))
@@ -2487,6 +2530,18 @@ class etpDatabase:
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"isUseflagAvailable: "+useflag+" available.")
return result
def isCounterAvailable(self,counter):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"isCounterAvailable: called.")
result = False
self.cursor.execute('SELECT counter FROM counters WHERE counter = "'+str(counter)+'"')
for row in self.cursor:
result = True
if (result):
dbLog.log(ETP_LOGPRI_WARNING,ETP_LOGLEVEL_NORMAL,"isCounterAvailable: "+str(counter)+" not available.")
else:
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"isCounterAvailable: "+str(counter)+" available.")
return result
def isLicenseAvailable(self,license):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"isLicenseAvailable: called.")
result = -1
@@ -2726,6 +2781,14 @@ class etpDatabase:
result.append(row)
return result
def listAllCounters(self):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"listAllCounters: called.")
self.cursor.execute('SELECT counter,idpackage FROM counters')
result = []
for row in self.cursor:
result.append(row)
return result
def listAllIdpackages(self):
dbLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"listAllIdpackages: called.")
self.cursor.execute('SELECT idpackage FROM baseinfo')
+9 -5
View File
@@ -61,6 +61,7 @@ etpData = {
'config_protect': u"", # list of directories that contain files that should not be overwritten
'config_protect_mask': u"", # list of directories that contain files that should be overwritten
'disksize': u"", # size on the hard disk in bytes (integer)
'counter': u"", # aka. COUNTER file
}
# Entropy database SQL initialization Schema and data structure
@@ -96,6 +97,7 @@ DROP TABLE IF EXISTS installedtable;
DROP TABLE IF EXISTS dependstable;
DROP TABLE IF EXISTS sizes;
DROP TABLE IF EXISTS messages;
DROP TABLE IF EXISTS counters;
"""
etpSQLInit = """
@@ -241,6 +243,11 @@ CREATE TABLE messages (
message VARCHAR
);
CREATE TABLE counters (
counter INTEGER PRIMARY KEY,
idpackage INTEGER
);
"""
# ^^ add dependstable?
@@ -303,13 +310,12 @@ etpConst = {
'confdir': ETP_CONF_DIR, # directory where entropy stores its configuration
'entropyconf': ETP_CONF_DIR+"/entropy.conf", # entropy.conf file
'repositoriesconf': ETP_CONF_DIR+"/repositories.conf", # repositories.conf file
'enzymeconf': ETP_CONF_DIR+"/enzyme.conf", # enzyme.conf file
'activatorconf': ETP_CONF_DIR+"/activator.conf", # activator.conf file
'reagentconf': ETP_CONF_DIR+"/reagent.conf", # reagent.conf file
'databaseconf': ETP_CONF_DIR+"/database.conf", # database.conf file
'spmbackendconf': ETP_CONF_DIR+"/spmbackend.conf", # Source Package Manager backend configuration (Portage now)
'mirrorsconf': ETP_CONF_DIR+"/mirrors.conf", # mirrors.conf file
'remoteconf': ETP_CONF_DIR+"/remote.conf", # remote.conf file
'spmbackendconf': ETP_CONF_DIR+"/spmbackend.conf", # spmbackend.conf file
'equoconf': ETP_CONF_DIR+"/equo.conf", # equo.conf file
'activatoruploaduris': [], # list of URIs that activator can use to upload files (parsed from activator.conf)
'activatordownloaduris': [], # list of URIs that activator can use to fetch data
@@ -332,7 +338,6 @@ etpConst = {
'databaseloglevel': 1, # Database log level (default: 1 - see database.conf for more info)
'mirrorsloglevel': 1, # Mirrors log level (default: 1 - see mirrors.conf for more info)
'remoteloglevel': 1, # Remote handlers (/handlers) log level (default: 1 - see remote.conf for more info)
'enzymeloglevel': 1 , # Enzyme log level (default: 1 - see enzyme.conf for more info)
'reagentloglevel': 1 , # Reagent log level (default: 1 - see reagent.conf for more info)
'activatorloglevel': 1, # # Activator log level (default: 1 - see activator.conf for more info)
'entropyloglevel': 1, # # Entropy log level (default: 1 - see entropy.conf for more info)
@@ -345,14 +350,12 @@ etpConst = {
'remotelogfile': ETP_SYSLOG_DIR+"/remote.log", # Mirrors operations log file
'spmbackendlogfile': ETP_SYSLOG_DIR+"/spmbackend.log", # Source Package Manager backend configuration log file
'databaselogfile': ETP_SYSLOG_DIR+"/database.log", # Database operations log file
'enzymelogfile': ETP_SYSLOG_DIR+"/enzyme.log", # Enzyme operations log file
'reagentlogfile': ETP_SYSLOG_DIR+"/reagent.log", # Reagent operations log file
'activatorlogfile': ETP_SYSLOG_DIR+"/activator.log", # Activator operations log file
'entropylogfile': ETP_SYSLOG_DIR+"/entropy.log", # Activator operations log file
'equologfile': ETP_SYSLOG_DIR+"/equo.log", # Activator operations log file
'distcc-status': False, # used by Enzyme, if True distcc is enabled
'distccconf': "/etc/distcc/hosts", # distcc hosts configuration file
'etpdatabasedir': ETP_DIR+ETP_DBDIR,
'etpdatabasefilepath': ETP_DIR+ETP_DBDIR+"/"+ETP_DBFILE,
@@ -568,6 +571,7 @@ dbNEEDED = "NEEDED"
dbOR = "|or|"
dbKEYWORDS = "KEYWORDS"
dbCONTENTS = "CONTENTS"
dbCOUNTER = "COUNTER"
dbPORTAGE_ELOG_OPTS = 'PORTAGE_ELOG_CLASSES="warn info log" PORTAGE_ELOG_SYSTEM="save" PORT_LOGDIR="'+etpConst['logdir']+'"'
# Portage variables reference
+19
View File
@@ -923,6 +923,25 @@ def getInstalledPackages():
installedAtoms.append(pkgatom)
return installedAtoms, len(installedAtoms)
def getInstalledPackagesCounters():
portageLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"getInstalledPackages: called. ")
import os
appDbDir = getPortageAppDbPath()
dbDirs = os.listdir(appDbDir)
installedAtoms = []
for pkgsdir in dbDirs:
pkgdir = os.listdir(appDbDir+pkgsdir)
for pdir in pkgdir:
pkgcat = pkgsdir.split("/")[len(pkgsdir.split("/"))-1]
pkgatom = pkgcat+"/"+pdir
if pkgatom.find("-MERGING-") == -1:
# get counter
f = open(appDbDir+pkgsdir+"/"+pdir+"/"+dbCOUNTER,"r")
counter = f.readline().strip()
f.close()
installedAtoms.append([pkgatom,int(counter)])
return installedAtoms, len(installedAtoms)
def packageSearch(keyword):
portageLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"packageSearch: called. ")
+84 -7
View File
@@ -40,7 +40,7 @@ reagentLog = logTools.LogFile(level=etpConst['reagentloglevel'],filename = etpCo
# reagentLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"testFunction: example. ")
def generator(package, dbconnection = None, enzymeRequestBranch = "unstable"):
def generator(package, dbconnection = None, enzymeRequestBranch = etpConst['branch']):
reagentLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"generator: called -> Package: "+str(package)+" | dbconnection: "+str(dbconnection))
@@ -54,7 +54,7 @@ def generator(package, dbconnection = None, enzymeRequestBranch = "unstable"):
packagename = os.path.basename(package)
print_info(yellow(" * ")+red("Processing: ")+bold(packagename)+red(", please wait..."))
etpData = extractPkgData(package,enzymeRequestBranch)
etpData = extractPkgData(package, enzymeRequestBranch)
if dbconnection is None:
@@ -91,11 +91,82 @@ def generator(package, dbconnection = None, enzymeRequestBranch = "unstable"):
# This tool is used by Entropy after enzyme, it simply parses the content of etpConst['packagesstoredir']
def enzyme(options):
def update(options):
reagentLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"enzyme: called -> options: "+str(options))
reagentLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"update: called -> options: "+str(options))
enzymeRequestBranch = "unstable"
# differential checking
# collect differences between the packages in the database and the ones on the system
print_info(yellow(" * ")+red("Scanning the database for differences..."))
dbconn = databaseTools.etpDatabase(readOnly = True, noUpload = True)
from portageTools import getInstalledPackagesCounters, quickpkg
installedPackages = getInstalledPackagesCounters()
installedCounters = {}
databasePackages = dbconn.listAllPackages()
toBeAdded = []
toBeRemoved = []
# fill lists
# packages to be added
for x in installedPackages[0]:
installedCounters[x[1]] = 1
counter = dbconn.isCounterAvailable(x[1])
if (not counter):
toBeAdded.append(x)
# packages to be removed from the database
databaseCounters = dbconn.listAllCounters()
for x in databaseCounters:
match = installedCounters.get(x[0], None)
#print match
if (not match):
toBeRemoved.append(x[1])
if (not toBeRemoved) and (not toBeAdded):
print_info(yellow(" * ")+red("Nothing to do, check later."))
# then exit gracefully
sys.exit(0)
if (toBeRemoved):
print_info(yellow(" @@ ")+blue("These are the packages that would be removed from the database:"))
for x in toBeRemoved:
atom = dbconn.retrieveAtom(x)
print_info(yellow(" # ")+red(atom))
rc = askquestion(">> Would you like to remove them now ?")
if rc == "Yes":
rwdbconn = databaseTools.etpDatabase(readOnly = False, noUpload = True)
for x in toBeRemoved:
atom = rwdbconn.retrieveAtom(x)
print_info(yellow(" @@ ")+blue("Removing from database: ")+red(atom), back = True)
rwdbconn.removePackage(x)
rwdbconn.closeDB()
print_info(yellow(" @@ ")+blue("Database removal complete.")+red(atom))
if (toBeAdded):
print_info(yellow(" @@ ")+blue("These are the packages that would be added to the add list:"))
for x in toBeAdded:
print_info(yellow(" # ")+red(x[0]))
rc = askquestion(">> Would you like to packetize them now ?")
if rc == "No":
sys.exit(0)
# package them
print_info(yellow(" @@ ")+blue("Compressing packages..."))
for x in toBeAdded:
print_info(yellow(" # ")+red(x[0]+"..."))
rc = quickpkg(x[0],etpConst['packagesstoredir'])
if (rc is None):
reagentLog.log(ETP_LOGPRI_ERROR,ETP_LOGLEVEL_NORMAL,"update: "+str(dep)+" -> quickpkg error. Cannot continue.")
print_error(red(" *")+" quickpkg error for "+red(dep))
print_error(red(" ***")+" Fatal error, cannot continue")
sys.exit(251)
dbconn.closeDB()
enzymeRequestBranch = etpConst['branch']
#_atoms = []
for i in options:
if ( i == "--branch=" and len(i.split("=")) == 2 ):
@@ -175,7 +246,7 @@ def enzyme(options):
print_info(green(" * ")+red("Statistics: ")+blue("Entries created/updated: ")+bold(str(etpCreated))+yellow(" - ")+darkblue("Entries discarded: ")+bold(str(etpNotCreated)))
# This function extracts all the info from a .tbz2 file and returns them
def extractPkgData(package, etpBranch = "unstable", structuredLayout = False):
def extractPkgData(package, etpBranch = etpConst['branch'], structuredLayout = False):
reagentLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"extractPkgData: called -> package: "+str(package))
@@ -375,6 +446,12 @@ def extractPkgData(package, etpBranch = "unstable", structuredLayout = False):
versiontag = ""
etpData['download'] = etpConst['binaryurirelativepath']+etpData['name']+"-"+etpData['version']+versiontag+".tbz2"
print_info(yellow(" * ")+red("Getting package counter..."),back = True)
# Fill category
f = open(tbz2TmpDir+dbCOUNTER,"r")
etpData['counter'] = f.readline().strip()
f.close()
print_info(yellow(" * ")+red("Getting package category..."),back = True)
# Fill category
f = open(tbz2TmpDir+dbCATEGORY,"r")
@@ -636,7 +713,7 @@ def dependsTableInitialize(dbconn = None, runActivator = True):
if dbconn == None:
dbconn = databaseTools.etpDatabase(readOnly = False, noUpload = True)
closedb = True
sys.path.append('../client')
sys.path.append('../client') # FIXME
import equoTools
equoTools.regenerateDependsTable(dbconn)
# now taint
+2 -89
View File
@@ -27,69 +27,6 @@ import random
import sys
from entropyConstants import *
# configure layman.cfg properly
if (not os.path.isfile(etpConst['overlaysconffile'])):
laymanConf = """
[MAIN]
#-----------------------------------------------------------
# Path to the config directory
config_dir: /etc/layman
#-----------------------------------------------------------
# Defines the directory where overlays should be installed
storage : """+etpConst['overlaysdir']+"""
#-----------------------------------------------------------
# Remote overlay lists will be stored here
# layman will append _md5(url).xml to each filename
cache : %(storage)s/cache
#-----------------------------------------------------------
# The list of locally installed overlays
local_list: %(storage)s/overlays.xml
#-----------------------------------------------------------
# Path to the make.conf file that should be modified by
# layman
make_conf : %(storage)s/make.conf
#-----------------------------------------------------------
# URLs of the remote lists of overlays (one per line) or
# local overlay definitions
#
#overlays : http://www.gentoo.org/proj/en/overlays/layman-global.txt
# http://dev.gentoo.org/~wrobel/layman/global-overlays.xml
# http://mydomain.org/my-layman-list.xml
# file:///usr/portage/local/layman/my-list.xml
overlays : http://www.gentoo.org/proj/en/overlays/layman-global.txt
#-----------------------------------------------------------
# Proxy support
#
#proxy : http://www.my-proxy.org:3128
#-----------------------------------------------------------
# Strict checking of overlay definitions
#
# Set either to "yes" or "no". If "no" layman will issue
# warnings if an overlay definition is missing either
# description or contact information.
#
nocheck : yes
"""
f = open(etpConst['overlaysconffile'],"w")
f.writelines(laymanConf)
f.flush()
f.close()
# activator section
if (not os.path.isfile(etpConst['activatorconf'])):
print "CRITICAL WARNING!!! "+etpConst['activatorconf']+" does not exist"
@@ -130,31 +67,6 @@ else:
import time
time.sleep(5)
# enzyme section
if (not os.path.isfile(etpConst['enzymeconf'])):
print "CRITICAL WARNING!!! "+etpConst['enzymeconf']+" does not exist"
else:
f = open(etpConst['enzymeconf'],"r")
enzymeconf = f.readlines()
f.close()
for line in enzymeconf:
if line.startswith("distcc-status|") and (len(line.split("|")) == 2) and (line.strip().split("|")[1] == "enabled"):
etpConst['distcc-status'] = True
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['enzymeconf']
sys.exit(51)
if (loglevel > -1) and (loglevel < 3):
etpConst['enzymeloglevel'] = loglevel
else:
print "WARNING: invalid loglevel in: "+etpConst['enzymeconf']
import time
time.sleep(5)
# reagent section
if (not os.path.isfile(etpConst['reagentconf'])):
print "CRITICAL WARNING!!! "+etpConst['reagentconf']+" does not exist"
@@ -199,6 +111,7 @@ else:
import time
time.sleep(5)
# spmbackend section
if (not os.path.isfile(etpConst['spmbackendconf'])):
print "CRITICAL WARNING!!! "+etpConst['spmbackendconf']+" does not exist"
@@ -219,4 +132,4 @@ else:
else:
print "WARNING: invalid loglevel in: "+etpConst['spmbackendconf']
import time
time.sleep(5)
time.sleep(5)
-161
View File
@@ -1,161 +0,0 @@
#!/usr/bin/python
'''
# DESCRIPTION:
# Portage tree manager and package builder following specified schemas
Copyright (C) 2007 Fabio Erculiani
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
# Never do "import portage" here, please use entropyTools binding
import os
import sys
import string
sys.path.append('../libraries')
from outputTools import *
# CONSTANTS
APPNAME = "enzyme"
APPVERSION = "1.0"
def print_help():
print_info("Sabayon Linux "+APPNAME+" (C - 2007)")
print_info("General Options:")
print_info(" --help\t\tthis output")
print_info(" --version\t\tprint version")
print_info(" --verbose\t\tbe more verbose")
print_info(" --nocolor\t\tdisable colorized output")
print_info(blue("Tools available: "))
print_info(" \t"+green(bold("world"))+yellow("\t\t to build all the possible new packages"))
print_info(" \t\t"+red("--empty-tree")+"\t\t rebuild all, including updates")
print_info(" \t\t"+red("--deep")+"\t\t\t analyzes world dependencies deeply")
print_info(" \t\t"+red("--pretend")+"\t\t just show what should be done")
print_info(" \t\t"+red("--ask")+"\t\t\t just ask before doing what should be done")
print_info(" \t\t"+red("--repackage-installed")+"\t creates binaries of all the installed packages")
print_info(" \t\t"+red("--skipfirst")+"\t\t skip the first package in the packages list")
print_info(" \t\t"+red("--skip=n")+"\t\t skip N packages")
print_info(" \t\t"+red("--nosync")+"\t\t disable activator packages sync")
print_info(" \t"+green(bold("build"))+yellow("\t\t to build all the packages specified in <atom(s)>"))
print_info(" \t\t"+red("--force-rebuild")+"\t\t force the building of the package, nevertheless")
print_info(" \t\t"+red("--force-repackage")+"\t force the repackaging of all the possible package")
print_info(" \t\t"+red("--deep")+"\t\t\t analyze the dependencies deeply")
print_info(" \t\t"+red("--nodeps")+"\t\t do not include dependencies and force compilation")
print_info(" \t\t"+red("--use")+"\t\t\t show packages USE flags")
print_info(" \t\t"+red("--pretend")+"\t\t just show what should be done")
print_info(" \t\t"+red("--ask")+"\t\t\t just ask before doing what should be done")
print_info(" \t\t"+red("--ignore-conflicts")+"\t ignore conflicts between packages")
print_info(" \t\t"+red("--no-interaction")+"\t disable user interaction, automatic driving")
print_info(" \t\t"+red("--simulate-building")+"\t compilations are simulated only")
print_info(" \t\t"+red("--skipfirst")+"\t\t skip the first package in the packages list")
print_info(" \t\t"+red("--skip=n")+"\t\t skip N packages")
print_info(" \t\t"+red("--nosync")+"\t\t disable activator packages sync")
print_info(" \t"+green(bold("uninstall"))+yellow("\t to uninstall one or a list of packages"))
print_info(" \t\t"+red("--pretend")+"\t\t just show what would be done")
print_info(" \t\t"+red("--just-prune")+"\t\t with slotted packages, keep only the latest, remove the rest")
print_info(" \t"+green(bold("overlay"))+yellow("\t\t to manage overlays"))
print_info(" \t\t "+red("add")+"\t\t\t to add overlays")
print_info(" \t\t "+red("remove")+"\t\t\t to remove overlays")
print_info(" \t\t "+red("sync")+"\t\t\t to sync overlays (after this you can specify which overlay)")
print_info(" \t\t "+red("list")+"\t\t\t to list overlays")
print_info(" \t"+green(bold("sync"))+yellow("\t\t to just sync portage tree"))
print_info(" \t\t "+red("--sync-back")+"\t\t sync between Entropy Portage Tree and the official one")
print_info(" \t\t "+red("--only-sync-back")+"\t only sync between Entropy Portage Tree and the official one")
print_info(" \t\t "+red("--no-overlay-sync")+"\t disable automatic overlays sync")
print_info(" \t"+green(bold("search"))+yellow("\t\t to search a package inside the Entropy Portage repository"))
print_info(" \t"+green(bold("distcc"))+yellow("\t\t distcc manager"))
print_info(" \t\t "+red("--add-host")+"\t\t add a hostname/ip")
print_info(" \t\t "+red("--remove-host")+"\t\t remove a hostname/ip")
print_info(" \t\t "+red("--enable")+"\t\t enable the DistCC funcionality")
print_info(" \t\t "+red("--disable")+"\t\t disable the DistCC funcionality")
print_info(" \t\t "+red("--show-hosts")+"\t\t show the currently enabled hosts")
print_info(" \t"+green(bold("cleanup"))+yellow("\t\t to clean temporary files"))
options = sys.argv[1:]
# print version
if (string.join(options).find("--version") != -1) or (string.join(options).find(" -V") != -1):
print_generic(APPNAME+": "+APPVERSION)
sys.exit(0)
# print help
if len(options) < 1 or string.join(options).find("--help") != -1 or string.join(options).find(" -h") != -1:
print_help()
if len(options) < 1:
print_error("not enough parameters")
sys.exit(1)
import entropyTools
import enzymeTools
from entropyConstants import *
from serverConstants import *
# preliminary options parsing
_options = []
for opt in options:
if (opt == "--nocolor"):
entropyTools.nocolor()
elif (opt == "--debug"):
entropyTools.enableDebug()
else:
_options.append(opt)
options = _options
if (not entropyTools.isRoot()):
print_error("you must be root in order to run "+APPNAME)
sys.exit(2)
# world tool
if (options[0] == "world"):
enzymeTools.world(options)
sys.exit(0)
# sync tool
if (options[0] == "sync"):
enzymeTools.sync(options)
sys.exit(0)
# overlay tool
if (options[0] == "overlay"):
rc = enzymeTools.overlay(options)
if (rc):
sys.exit(0)
else:
# an error occoured
print_help()
sys.exit(3)
# build tool
if (options[0] == "build"):
enzymeTools.build(options[1:])
sys.exit(0)
# uninstall tool
if (options[0] == "uninstall"):
enzymeTools.uninstall(options[1:])
sys.exit(0)
# search tool
if (options[0] == "search"):
enzymeTools.search(options[1:])
sys.exit(0)
# distcc tool
if (options[0] == "distcc"):
enzymeTools.distcc(options[1:])
sys.exit(0)
# orphans tool
if (options[0] == "orphans"):
enzymeTools.orphans()
sys.exit(0)
# cleanup tool
if (options[0] == "cleanup"):
entropyTools.cleanup()
sys.exit(0)
+20 -20
View File
@@ -41,25 +41,25 @@ def print_help():
print_info(" --version\t\tprint version")
print_info(" --nocolor\t\tdisable colorized output")
print_info(blue("Tools available: "))
print_info(" \t"+green("enzyme")+yellow("\t\t to analyze enzyme store directory"))
print_info(" \t\t"+red("--branch=[stable,unstable]")+"\t\t to force a specific branch")
print_info(" \t"+green(bold("database"))+yellow("\t Entropy database tool manager"))
print_info(" \t\t"+red("--initialize")+"\t\t\t\t (Re)Initialize the Entropy packages database [DO NOT USE THIS]")
print_info(" \t\t"+red("statistics")+"\t\t\t\t Show Entropy database statistics.")
print_info(" \t\t"+green("search")+"\t\t\t\t\t Search a package inside the Entropy packages database")
print_info(" \t\t"+green(bold("remove"))+"\t\t\t\t\t Remove a package or a list of packages")
print_info(" \t\t\t"+red("--branch=[stable,unstable]")+"\t Choose which branch of the package to remove")
print_info(" \t\t"+green("create-empty-database")+"\t\t\t Create an empty Entropy database file in the specified <path>")
print_info(" \t\t"+green("stabilize")+"\t\t\t\t Mark as stable a package, a list of packages, world")
print_info(" \t\t"+green("unstabilize")+"\t\t\t\t Mark as unstable a package, a list of packages, world")
print_info(" \t\t"+green("md5check")+"\t\t\t\t Check digest of a package, a list of packages, world")
print_info(" \t"+green("update")+yellow("\t\t Update Entropy Database analyzing the system for new installed packages."))
print_info(" \t\t"+red("--branch=<branch name>")+"\t\t Choose which branch to assign to the packages")
print_info(" \t"+green("database")+yellow("\t Entropy database tool manager"))
print_info(" \t\t"+red("--initialize")+"\t\t\t (Re)Initialize the Entropy packages database [DO NOT USE THIS]")
print_info(" \t\t"+red("statistics")+"\t\t\t Show Entropy database statistics.")
print_info(" \t\t"+green("search")+"\t\t\t\t Search a package inside the Entropy packages database")
print_info(" \t\t"+green("remove")+"\t\t\t\t Remove a package or a list of packages")
print_info(" \t\t\t"+red("--branch=<branch name>")+"\t Choose which branch of the package to remove")
print_info(" \t\t"+green("create-empty-database")+"\t\t Create an empty Entropy database file in the specified <path>")
print_info(" \t\t"+green("stabilize")+"\t\t\t Mark as stable a package, a list of packages, world")
print_info(" \t\t"+green("unstabilize")+"\t\t\t Mark as unstable a package, a list of packages, world")
print_info(" \t\t"+green("md5check")+"\t\t\t Check digest of a package, a list of packages, world")
#print_info(" \t\t"+green(bold("orphans"))+"\t\t\t Dump the list of files that don't belong on any installed package") FIXME can be done using sets
print_info(" \t"+green(bold("deptest"))+yellow("\t\t Look for unsatisfied dependencies inside database"))
print_info(" \t"+green(bold("depends"))+yellow("\t\t Regenerate depends table (plus database lock and bump)"))
print_info(" \t\t"+red("--quiet")+"\t\t\t\t\t just print the dependencies list")
print_info(" \t"+green(bold("smartapps"))+yellow("\t Entropy application tool to create self-dependant applications [EXPERIMENTAL]"))
print_info(" \t\t"+green(bold("create"))+"\t\t\t\t\t Create a smartapp package using the package names provided")
print_info(" \t"+green(bold("cleanup"))+yellow("\t\t to clean temporary files"))
print_info(" \t"+green("deptest")+yellow("\t\t Look for unsatisfied dependencies inside database"))
print_info(" \t"+green("depends")+yellow("\t\t Regenerate depends table (plus database lock and bump)"))
print_info(" \t\t"+red("--quiet")+"\t\t\t\t just print the dependencies list")
print_info(" \t"+green("smartapps")+yellow("\t Entropy application tool to create self-dependant applications [EXPERIMENTAL]"))
print_info(" \t\t"+green("create")+"\t\t\t\t Create a smartapp package using the package names provided")
print_info(" \t"+green("cleanup")+yellow("\t\t to clean temporary files"))
options = sys.argv[1:]
@@ -102,8 +102,8 @@ elif (options[0] == "generator"):
reagentTools.generator(options[1:])
sys.exit(0)
elif (options[0] == "enzyme"):
reagentTools.enzyme(options[1:])
elif (options[0] == "update"):
reagentTools.update(options[1:])
sys.exit(0)
# database tool