aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gentoo.org>2005-08-09 07:56:38 +0000
committerBrian Harring <ferringb@gentoo.org>2005-08-09 07:56:38 +0000
commit58a02331eab994a2d2ee2b5cded34aef02d056be (patch)
tree48ff845c6014d58ba3c38faa26829d33ba9c6127
parentdoc updates (diff)
downloadportage-cvs-58a02331eab994a2d2ee2b5cded34aef02d056be.tar.gz
portage-cvs-58a02331eab994a2d2ee2b5cded34aef02d056be.tar.bz2
portage-cvs-58a02331eab994a2d2ee2b5cded34aef02d056be.zip
updates for
1) renamed base repository tree to UnconfiguredEbuildTree (since it produces non-configured packages). 2) portage.util.dicts => portage.util.mappings changes documentation additions also. Threw out ConfiguredEbuild from ebuild_package, added start of a configured ebuild tree/wrapper to ebuild_repository.
-rw-r--r--portage/ebuild/__init__.py2
-rw-r--r--portage/ebuild/ebuild_package.py25
-rw-r--r--portage/ebuild/ebuild_repository.py25
-rw-r--r--portage/ebuild/processor.py13
-rw-r--r--portage/ebuild/profiles.py4
5 files changed, 36 insertions, 33 deletions
diff --git a/portage/ebuild/__init__.py b/portage/ebuild/__init__.py
index 82f86e7..c0fd623 100644
--- a/portage/ebuild/__init__.py
+++ b/portage/ebuild/__init__.py
@@ -1,2 +1,2 @@
import ebuild_repository
-repository = ebuild_repository.tree
+repository = ebuild_repository.UnconfiguredTree
diff --git a/portage/ebuild/ebuild_package.py b/portage/ebuild/ebuild_package.py
index d437e4a..e04c364 100644
--- a/portage/ebuild/ebuild_package.py
+++ b/portage/ebuild/ebuild_package.py
@@ -1,7 +1,7 @@
# Copyright: 2005 Gentoo Foundation
# Author(s): Brian Harring (ferringb@gentoo.org)
# License: GPL2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/ebuild_package.py,v 1.5 2005/08/03 00:27:14 ferringb Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/ebuild_package.py,v 1.6 2005/08/09 07:56:38 ferringb Exp $
import os
from portage import package
@@ -9,7 +9,7 @@ from conditionals import DepSet
from portage.package.atom import atom
#from portage.fetch import fetchable
#from digest import parse_digest
-from portage.util.dicts import LazyValDict
+from portage.util.mappings import LazyValDict
from portage.restrictions.restriction import PackageRestriction, StrExactMatch
from portage.restrictions.restrictionSet import AndRestrictionSet, OrRestrictionSet
@@ -32,7 +32,7 @@ class EbuildPackage(package.metadata.package):
elif key in ("depends", "rdepends", "bdepends"):
# drop the s, and upper it.
val = DepSet(self.data[key.upper()[:-1]], atom)
- elif key == "uri":
+ elif key == "fetchables":
val = DepSet(self.data["SRC_URI"], str, operators={})
elif key == "license":
val = DepSet(self.data["LICENSE"], str)
@@ -46,7 +46,6 @@ class EbuildPackage(package.metadata.package):
return val
def _fetch_metadata(self):
-# import pdb;pdb.set_trace()
data = self._parent._get_metadata(self)
doregen = False
if data == None:
@@ -63,10 +62,6 @@ class EbuildPackage(package.metadata.package):
# ah hell.
data = self._parent._update_metadata(self)
-# for k,v in data.items():
-# self.__dict__[k] = v
-
-# self.__dict__["_finalized"] = True
return data
@@ -107,17 +102,3 @@ class EbuildFactory(package.metadata.factory):
return mydata
-class ConfiguredEbuild(package.metadata.package):
-
- def __init__(self, pkg, use_flags):
- self.__dict__["use"] = dict(zip(use_flags, [True]*len(use_flags)))
- self.__dict__["pkg"] = pkg
-
-
- def __getattr__(self, attr):
- if attr in ("depends", "rdepends", "bdepends", "uri", "license", "restrict"):
- val = getattr(self.pkg, attr).evaluate_depset(self.use)
- else:
- return getattr(self.pkg, attr)
- self.__dict__[attr] = val
- return val
diff --git a/portage/ebuild/ebuild_repository.py b/portage/ebuild/ebuild_repository.py
index 3a4a096..656f27c 100644
--- a/portage/ebuild/ebuild_repository.py
+++ b/portage/ebuild/ebuild_repository.py
@@ -1,18 +1,22 @@
# Copyright: 2005 Gentoo Foundation
# Author(s): Brian Harring (ferringb@gentoo.org)
# License: GPL2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/ebuild_repository.py,v 1.3 2005/07/20 14:33:12 ferringb Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/ebuild_repository.py,v 1.4 2005/08/09 07:56:38 ferringb Exp $
import os, stat
from portage.repository import prototype, errors
#import ebuild_internal
import ebuild_package
-class tree(prototype.tree):
+def convert_depset(instance, conditionals):
+ return instance.evaluate_depset(conditionals)
+
+
+class UnconfiguredTree(prototype.tree):
false_categories = ("eclass","profiles","packages","distfiles","licenses","scripts")
def __init__(self, location, cache=None, eclass_cache=None):
- super(tree, self).__init__()
+ super(UnconfiguredTree, self).__init__()
self.base = self.location = location
try:
st = os.lstat(self.base)
@@ -66,3 +70,18 @@ class tree(prototype.tree):
raise KeyError("failed fetching versions for package %s: %s" % \
(os.path.join(self.base,catpkg.lstrip(os.path.sep)), str(e)))
+
+class ConfiguredTree(UnconfiguredTree):
+ configured = True
+ configurable = ("use",)
+ l=["license","depends","rdepends","bdepends", "fetchables", "keywords"]
+ wrappable = dict(zip(l, len(l)*[convert_depset]))
+ def configure_it(self, key):
+ return PackageWrapper("use", initial_settings=[self.default_use], unchangable_settings=[self.arch],
+ attributes_to_wrap=wrappable)
+
+ def __init__(self, tree, default_use, arch):
+ self.default_use = default_use
+ self.tree = tree
+
+UnconfiguredTree.configured = ConfiguredTree
diff --git a/portage/ebuild/processor.py b/portage/ebuild/processor.py
index 7c01e72..5c9894a 100644
--- a/portage/ebuild/processor.py
+++ b/portage/ebuild/processor.py
@@ -1,7 +1,7 @@
# Copyright: 2004-2005 Gentoo Foundation
# Author(s): Brian Harring (ferringb@gentoo.org)
# License: GPL2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/processor.py,v 1.4 2005/08/03 00:27:14 ferringb Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/processor.py,v 1.5 2005/08/09 07:56:38 ferringb Exp $
# this needs work. it's been pruned heavily from what ebd used originally, but it still isn't what
# I would define as 'right'
@@ -93,11 +93,14 @@ def release_ebuild_processor(ebp):
class ebuild_processor:
"""abstraction of a running ebuild.sh instance- the env, functions, etc that ebuilds expect."""
def __init__(self, userpriv, sandbox, fakeroot, save_file):
- """ebuild_daemon_path shouldn't be fooled with unless the caller knows what they're doing.
+ """
sandbox enables a sandboxed processor
userpriv enables a userpriv'd processor
fakeroot enables a fakeroot'd processor- this is a mutually exclusive option to sandbox, and
- requires userpriv to be enabled. Violating this will result in nastyness"""
+ requires userpriv to be enabled.
+
+ Violating this will result in nastyness
+ """
from portage.const import EBUILD_DAEMON_PATH, PORTAGE_BIN_PATH
@@ -398,8 +401,8 @@ class ebuild_processor:
additional_commands is a dict of command:callable. If you need to slip in extra args, look into portage.util.currying.
commands names cannot have spaces. the callable is called with the processor as first arg, and
- remaining string (None if no remaining fragment) as second arg
- (if you need to split the args to command, whitespace splitting falls to your func.)
+ remaining string (None if no remaining fragment) as second arg.
+ If you need to split the args to command, whitespace splitting falls to your func.
Chucks an UnhandledCommand exception when an unknown command is encountered.
"""
diff --git a/portage/ebuild/profiles.py b/portage/ebuild/profiles.py
index 84aa1c8..7404b6f 100644
--- a/portage/ebuild/profiles.py
+++ b/portage/ebuild/profiles.py
@@ -1,7 +1,7 @@
# Copyright: 2005 Gentoo Foundation
# Author(s): Brian Harring (ferringb@gentoo.org)
# License: GPL2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/profiles.py,v 1.4 2005/08/03 00:27:14 ferringb Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/profiles.py,v 1.5 2005/08/09 07:56:38 ferringb Exp $
from portage.config import profiles
import os, logging
@@ -10,7 +10,7 @@ from portage.util.file import iter_read_bash, read_dict, read_bash_dict
from portage.util.currying import pre_curry
from portage.package.atom import atom
from portage.config.central import list_parser
-from portage.util.dicts import ProtectedDict
+from portage.util.mappings import ProtectedDict
class OnDiskProfile(profiles.base):
positional = ("base_repo","profile")