enzyme now shows overlays information

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@245 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2007-03-31 09:13:16 +00:00
parent a8b63adb7f
commit afb5467098
3 changed files with 32 additions and 19 deletions
-5
View File
@@ -1,17 +1,12 @@
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)
- build(), on enzyme, if a package is not going to be installed anymore from an overlay, it must be notified
- build(), on enzyme, quickpkg a package before running emerge(), in this case, if the API has been broken, we can easily query the user and fix it
- system-wide: add free space check
- activator: for the tidy module I need that reagent includes the SLOT variable.
- activator: add support for stable/unstable branch
- activator tasks:
- add/remove packages from the database
- tidy tool: cleanup policy to prune old binaries
- database update and management between me and reagent
- reagent tasks:
- reagent should support a forced revision bumping
- Sabayon Linux USE flags: remove all server related use flags
+7 -12
View File
@@ -80,6 +80,12 @@ def md5sum(filepath):
block = readfile.read(1024)
return m.hexdigest()
def md5string(string):
import md5
m = md5.new()
m.update(string)
return m.hexdigest()
# Imported from Gentoo portage_dep.py
# Copyright 2003-2004 Gentoo Foundation
# done to avoid the import of portage_dep here
@@ -329,7 +335,7 @@ def uploadDatabase(uris):
print_warning(yellow(" * ")+red("Cannot properly upload to ")+bold(extractFTPHostFromUri(uri))+red(". Please check."))
# generate digest
hexdigest = digestFile(etpConst['etpdatabasefilepath'])
hexdigest = md5sum(etpConst['etpdatabasefilepath'])
f = open(etpConst['etpdatabasedir'] + "/" + etpConst['etpdatabasehashfile'],"w")
f.write(hexdigest+" "+etpConst['etpdatabasehashfile']+"\n")
f.flush()
@@ -431,17 +437,6 @@ def uncompressTarBz2(filepath, extractPath = None):
rc = os.system(cmd+" &> /dev/null")
return rc
# FIXME: improve support by reading a line at a time
def digestFile(filepath):
import md5
df = open(filepath,"r")
content = df.readlines()
df.close()
digest = md5.new()
for line in content:
digest.update(line)
return digest.hexdigest()
def bytesIntoHuman(bytes):
bytes = str(bytes)
kbytes = str(int(bytes)/1024)
+25 -2
View File
@@ -30,7 +30,6 @@ import os
import commands
import string
# EXIT STATUSES: 200-299
def getSyncTime():
@@ -313,6 +312,8 @@ def build(atoms):
PackagesDependencies = toBeBuilt
if (PackagesDependencies != []) or (PackagesQuickpkg != []):
ebuildOverlays = []
overlaysCounter = 1
print_info(yellow(" *")+" These are the actions that will be taken, in order:")
for i in PackagesDependencies:
useflags = ""
@@ -330,7 +331,21 @@ def build(atoms):
pkgstatus = blue("[U]")
elif (compareAtoms(i,getInstalledAtom(pkg)) < 0):
pkgstatus = darkblue("[D]")
print_info(red(" *")+bold(" [")+red("BUILD")+bold("] ")+pkgstatus+" "+i+useflags)
# from which place?
overlayinfo = ""
myEbuildPath = getEbuildTreePath(i)
for overlay in etpConst['overlays'].split():
if myEbuildPath.startswith(overlay):
overlayinfo = blue("[overlay: ")+bold(str(overlaysCounter))+blue(" ]")
# overlay found
# find an associable number
for x in ebuildOverlays:
if x.find(overlay) == -1:
overlaysCounter += 1
ebuildOverlays.append(str(overlaysCounter)+" "+overlay)
print_info(red(" *")+bold(" [")+red("BUILD")+bold("] ")+pkgstatus+" "+i+useflags+" "+overlayinfo)
for i in PackagesQuickpkg:
useflags = ""
@@ -342,6 +357,14 @@ def build(atoms):
else:
# I should never get here
print_info(green(" *")+bold(" [?????] ")+i+useflags)
ebuildOverlays = list(set(ebuildOverlays))
if (ebuildOverlays != []):
print_info("")
print_info(" Overlays legend:")
for ov in ebuildOverlays:
print_info(" ["+bold(ov.split()[0])+"] "+blue(ov.split()[1]))
else:
print_info(green(" *")+" Nothing to do...")