Ejemplo n.º 1
0
    def __init__(self, **kwargs):
        metadata = _PackageMetadataWrapperBase(kwargs.pop('metadata'))
        Task.__init__(self, **kwargs)
        # the SlotObject constructor assigns self.root_config from keyword args
        # and is an instance of a '_emerge.RootConfig.RootConfig class
        self.root = self.root_config.root
        self._raw_metadata = metadata
        self._metadata = _PackageMetadataWrapper(self, metadata)
        if not self.built:
            self._metadata['CHOST'] = self.root_config.settings.get(
                'CHOST', '')
        eapi_attrs = _get_eapi_attrs(self.eapi)
        self.cpv = _pkg_str(self.cpv,
                            metadata=self._metadata,
                            settings=self.root_config.settings)
        if hasattr(self.cpv, 'slot_invalid'):
            self._invalid_metadata(
                'SLOT.invalid',
                "SLOT: invalid value: '%s'" % self._metadata["SLOT"])
        self.cpv_split = self.cpv.cpv_split
        self.category, self.pf = portage.catsplit(self.cpv)
        self.cp = self.cpv.cp
        self.version = self.cpv.version
        self.slot = self.cpv.slot
        self.sub_slot = self.cpv.sub_slot
        self.slot_atom = Atom("%s%s%s" % (self.cp, _slot_separator, self.slot))
        # sync metadata with validated repo (may be UNKNOWN_REPO)
        self._metadata['repository'] = self.cpv.repo

        if eapi_attrs.iuse_effective:
            implicit_match = self.root_config.settings._iuse_effective_match
        else:
            implicit_match = self.root_config.settings._iuse_implicit_match
        usealiases = self.root_config.settings._use_manager.getUseAliases(self)
        self.iuse = self._iuse(self, self._metadata["IUSE"].split(),
                               implicit_match, usealiases, self.eapi)

        if (self.iuse.enabled or self.iuse.disabled) and \
         not eapi_attrs.iuse_defaults:
            if not self.installed:
                self._invalid_metadata(
                    'EAPI.incompatible',
                    "IUSE contains defaults, but EAPI doesn't allow them")
        if self.inherited is None:
            self.inherited = frozenset()

        if self.operation is None:
            if self.onlydeps or self.installed:
                self.operation = "nomerge"
            else:
                self.operation = "merge"

        self._hash_key = Package._gen_hash_key(cpv=self.cpv,
                                               installed=self.installed,
                                               onlydeps=self.onlydeps,
                                               operation=self.operation,
                                               repo_name=self.cpv.repo,
                                               root_config=self.root_config,
                                               type_name=self.type_name)
        self._hash_value = hash(self._hash_key)
Ejemplo n.º 2
0
	def __init__(self, **kwargs):
		Task.__init__(self, **kwargs)
		self.root = self.root_config.root
		self._raw_metadata = _PackageMetadataWrapperBase(self.metadata)
		self.metadata = _PackageMetadataWrapper(self, self._raw_metadata)
		if not self.built:
			self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
		self.cp = portage.cpv_getkey(self.cpv)
		slot = self.slot
		if _slot_re.match(slot) is None:
			self._invalid_metadata('SLOT.invalid',
				"SLOT: invalid value: '%s'" % slot)
			# Avoid an InvalidAtom exception when creating slot_atom.
			# This package instance will be masked due to empty SLOT.
			slot = '0'
		if (self.iuse.enabled or self.iuse.disabled) and \
			not eapi_has_iuse_defaults(self.metadata["EAPI"]):
			if not self.installed:
				self._invalid_metadata('EAPI.incompatible',
					"IUSE contains defaults, but EAPI doesn't allow them")
		self.slot_atom = portage.dep.Atom("%s:%s" % (self.cp, slot))
		self.category, self.pf = portage.catsplit(self.cpv)
		self.cpv_split = portage.catpkgsplit(self.cpv)
		self.pv_split = self.cpv_split[1:]
		self._validate_deps()
		self.masks = self._masks()
		self.visible = self._visible(self.masks)
Ejemplo n.º 3
0
	def __init__(self, **kwargs):
		metadata = _PackageMetadataWrapperBase(kwargs.pop('metadata'))
		Task.__init__(self, **kwargs)
		# the SlotObject constructor assigns self.root_config from keyword args
		# and is an instance of a '_emerge.RootConfig.RootConfig class
		self.root = self.root_config.root
		self._raw_metadata = metadata
		self._metadata = _PackageMetadataWrapper(self, metadata)
		if not self.built:
			self._metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
		eapi_attrs = _get_eapi_attrs(self.eapi)
		self.cpv = _pkg_str(self.cpv, metadata=self._metadata,
			settings=self.root_config.settings)
		if hasattr(self.cpv, 'slot_invalid'):
			self._invalid_metadata('SLOT.invalid',
				"SLOT: invalid value: '%s'" % self._metadata["SLOT"])
		self.cpv_split = self.cpv.cpv_split
		self.category, self.pf = portage.catsplit(self.cpv)
		self.cp = self.cpv.cp
		self.version = self.cpv.version
		self.slot = self.cpv.slot
		self.sub_slot = self.cpv.sub_slot
		self.slot_atom = Atom("%s%s%s" % (self.cp, _slot_separator, self.slot))
		# sync metadata with validated repo (may be UNKNOWN_REPO)
		self._metadata['repository'] = self.cpv.repo

		if eapi_attrs.iuse_effective:
			implicit_match = self.root_config.settings._iuse_effective_match
			if self.built:
				implicit_match = functools.partial(
					self._built_iuse_effective_match,
					implicit_match, frozenset(self._metadata['USE'].split()))
		else:
			implicit_match = self.root_config.settings._iuse_implicit_match
		usealiases = self.root_config.settings._use_manager.getUseAliases(self)
		self.iuse = self._iuse(self, self._metadata["IUSE"].split(), implicit_match,
			usealiases, self.eapi)

		if (self.iuse.enabled or self.iuse.disabled) and \
			not eapi_attrs.iuse_defaults:
			if not self.installed:
				self._invalid_metadata('EAPI.incompatible',
					"IUSE contains defaults, but EAPI doesn't allow them")
		if self.inherited is None:
			self.inherited = frozenset()

		if self.operation is None:
			if self.onlydeps or self.installed:
				self.operation = "nomerge"
			else:
				self.operation = "merge"

		self._hash_key = Package._gen_hash_key(cpv=self.cpv,
			installed=self.installed, onlydeps=self.onlydeps,
			operation=self.operation, repo_name=self.cpv.repo,
			root_config=self.root_config,
			type_name=self.type_name)
		self._hash_value = hash(self._hash_key)
Ejemplo n.º 4
0
    def __init__(self, **kwargs):
        Task.__init__(self, **kwargs)
        # the SlotObject constructor assigns self.root_config from keyword args
        # and is an instance of a '_emerge.RootConfig.RootConfig class
        self.root = self.root_config.root
        self._raw_metadata = _PackageMetadataWrapperBase(self.metadata)
        self.metadata = _PackageMetadataWrapper(self, self._raw_metadata)
        if not self.built:
            self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
        self.cp = portage.cpv_getkey(self.cpv)
        slot = self.slot
        if _slot_re.match(slot) is None:
            self._invalid_metadata('SLOT.invalid',
                                   "SLOT: invalid value: '%s'" % slot)
            # Avoid an InvalidAtom exception when creating slot_atom.
            # This package instance will be masked due to empty SLOT.
            slot = '0'
        if (self.iuse.enabled or self.iuse.disabled) and \
         not eapi_has_iuse_defaults(self.metadata["EAPI"]):
            if not self.installed:
                self._invalid_metadata(
                    'EAPI.incompatible',
                    "IUSE contains defaults, but EAPI doesn't allow them")
        self.slot_atom = portage.dep.Atom("%s%s%s" %
                                          (self.cp, _slot_separator, slot))
        self.category, self.pf = portage.catsplit(self.cpv)
        self.cpv_split = portage.catpkgsplit(self.cpv)
        self.pv_split = self.cpv_split[1:]
        if self.inherited is None:
            self.inherited = frozenset()
        repo = _gen_valid_repo(self.metadata.get('repository', ''))
        if not repo:
            repo = self.UNKNOWN_REPO
        self.metadata['repository'] = repo

        self._validate_deps()
        self.masks = self._masks()
        self.visible = self._visible(self.masks)
        if self.operation is None:
            if self.onlydeps or self.installed:
                self.operation = "nomerge"
            else:
                self.operation = "merge"

        self._hash_key = Package._gen_hash_key(cpv=self.cpv,
                                               installed=self.installed,
                                               onlydeps=self.onlydeps,
                                               operation=self.operation,
                                               repo_name=repo,
                                               root_config=self.root_config,
                                               type_name=self.type_name)
        self._hash_value = hash(self._hash_key)
Ejemplo n.º 5
0
	def __init__(self, **kwargs):
		Task.__init__(self, **kwargs)
		# the SlotObject constructor assigns self.root_config from keyword args
		# and is an instance of a '_emerge.RootConfig.RootConfig class
		self.root = self.root_config.root
		self._raw_metadata = _PackageMetadataWrapperBase(self.metadata)
		self.metadata = _PackageMetadataWrapper(self, self._raw_metadata)
		if not self.built:
			self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
		self.cp = portage.cpv_getkey(self.cpv)
		slot = self.slot
		if _slot_re.match(slot) is None:
			self._invalid_metadata('SLOT.invalid',
				"SLOT: invalid value: '%s'" % slot)
			# Avoid an InvalidAtom exception when creating slot_atom.
			# This package instance will be masked due to empty SLOT.
			slot = '0'
		if (self.iuse.enabled or self.iuse.disabled) and \
			not eapi_has_iuse_defaults(self.metadata["EAPI"]):
			if not self.installed:
				self._invalid_metadata('EAPI.incompatible',
					"IUSE contains defaults, but EAPI doesn't allow them")
		self.slot_atom = portage.dep.Atom("%s%s%s" % (self.cp, _slot_separator, slot))
		self.category, self.pf = portage.catsplit(self.cpv)
		self.cpv_split = portage.catpkgsplit(self.cpv)
		self.pv_split = self.cpv_split[1:]
		if self.inherited is None:
			self.inherited = frozenset()
		repo = _gen_valid_repo(self.metadata.get('repository', ''))
		if not repo:
			repo = self.UNKNOWN_REPO
		self.metadata['repository'] = repo

		self._validate_deps()
		self.masks = self._masks()
		self.visible = self._visible(self.masks)
		if self.operation is None:
			if self.onlydeps or self.installed:
				self.operation = "nomerge"
			else:
				self.operation = "merge"

		self._hash_key = Package._gen_hash_key(cpv=self.cpv,
			installed=self.installed, onlydeps=self.onlydeps,
			operation=self.operation, repo_name=repo,
			root_config=self.root_config,
			type_name=self.type_name)
		self._hash_value = hash(self._hash_key)
Ejemplo n.º 6
0
 def __init__(self, **kwargs):
     Task.__init__(self, **kwargs)
     self.root = self.root_config.root
     self.metadata = _PackageMetadataWrapper(self, self.metadata)
     if not self.built:
         self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
     self.cp = portage.cpv_getkey(self.cpv)
     slot = self.slot
     if _slot_re.match(slot) is None:
         self._invalid_metadata('SLOT.invalid',
                                "SLOT: invalid value: '%s'" % slot)
         # Avoid an InvalidAtom exception when creating slot_atom.
         # This package instance will be masked due to empty SLOT.
         slot = '0'
     self.slot_atom = portage.dep.Atom("%s:%s" % (self.cp, slot))
     self.category, self.pf = portage.catsplit(self.cpv)
     self.cpv_split = portage.catpkgsplit(self.cpv)
     self.pv_split = self.cpv_split[1:]
     self.masks = self._masks()
     self.visible = self._visible(self.masks)
Ejemplo n.º 7
0
	def __init__(self, **kwargs):
		Task.__init__(self, **kwargs)
		self.root = self.root_config.root
		self.metadata = _PackageMetadataWrapper(self, self.metadata)
		if not self.built:
			self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
		self.cp = portage.cpv_getkey(self.cpv)
		slot = self.slot
		if _slot_re.match(slot) is None:
			self._invalid_metadata('SLOT.invalid',
				"SLOT: invalid value: '%s'" % slot)
			# Avoid an InvalidAtom exception when creating slot_atom.
			# This package instance will be masked due to empty SLOT.
			slot = '0'
		self.slot_atom = portage.dep.Atom("%s:%s" % (self.cp, slot))
		self.category, self.pf = portage.catsplit(self.cpv)
		self.cpv_split = portage.catpkgsplit(self.cpv)
		self.pv_split = self.cpv_split[1:]
		self.masks = self._masks()
		self.visible = self._visible(self.masks)
Ejemplo n.º 8
0
    def __init__(self, **kwargs):
        metadata = _PackageMetadataWrapperBase(kwargs.pop("metadata"))
        Task.__init__(self, **kwargs)
        # the SlotObject constructor assigns self.root_config from keyword args
        # and is an instance of a '_emerge.RootConfig.RootConfig class
        self.root = self.root_config.root
        self._raw_metadata = metadata
        self._metadata = _PackageMetadataWrapper(self, metadata)
        if not self.built:
            self._metadata["CHOST"] = self.root_config.settings.get("CHOST", "")
        eapi_attrs = _get_eapi_attrs(self.eapi)

        try:
            db = self.cpv._db
        except AttributeError:
            if self.built:
                # For independence from the source ebuild repository and
                # profile implicit IUSE state, require the _db attribute
                # for built packages.
                raise
            db = self.root_config.trees["porttree"].dbapi

        self.cpv = _pkg_str(
            self.cpv, metadata=self._metadata, settings=self.root_config.settings, db=db
        )
        if hasattr(self.cpv, "slot_invalid"):
            self._invalid_metadata(
                "SLOT.invalid", "SLOT: invalid value: '%s'" % self._metadata["SLOT"]
            )
        self.cpv_split = self.cpv.cpv_split
        self.category, self.pf = portage.catsplit(self.cpv)
        self.cp = self.cpv.cp
        self.version = self.cpv.version
        self.slot = self.cpv.slot
        self.sub_slot = self.cpv.sub_slot
        self.slot_atom = Atom("%s%s%s" % (self.cp, _slot_separator, self.slot))
        # sync metadata with validated repo (may be UNKNOWN_REPO)
        self._metadata["repository"] = self.cpv.repo

        implicit_match = db._iuse_implicit_cnstr(self.cpv, self._metadata)
        self.iuse = self._iuse(
            self, self._metadata["IUSE"].split(), implicit_match, self.eapi
        )

        if (self.iuse.enabled or self.iuse.disabled) and not eapi_attrs.iuse_defaults:
            if not self.installed:
                self._invalid_metadata(
                    "EAPI.incompatible",
                    "IUSE contains defaults, but EAPI doesn't allow them",
                )
        if self.inherited is None:
            self.inherited = frozenset()

        if self.operation is None:
            if self.onlydeps or self.installed:
                self.operation = "nomerge"
            else:
                self.operation = "merge"

        self._hash_key = Package._gen_hash_key(
            cpv=self.cpv,
            installed=self.installed,
            onlydeps=self.onlydeps,
            operation=self.operation,
            repo_name=self.cpv.repo,
            root_config=self.root_config,
            type_name=self.type_name,
        )
        self._hash_value = hash(self._hash_key)
Ejemplo n.º 9
0
 def __init__(self, **kwargs):
     Task.__init__(self, **kwargs)
     self.cp = self.atom.cp
Ejemplo n.º 10
0
	def __init__(self, **kwargs):
		Task.__init__(self, **kwargs)
		self.cp = self.atom.cp
		self._hash_key = ("blocks", self.root, self.atom, self.eapi)
		self._hash_value = hash(self._hash_key)
Ejemplo n.º 11
0
	def __init__(self, **kwargs):
		Task.__init__(self, **kwargs)
		self.cp = self.atom.cp
Ejemplo n.º 12
0
	def __init__(self, **kwargs):
		metadata = _PackageMetadataWrapperBase(kwargs.pop('metadata'))
		Task.__init__(self, **kwargs)
		# the SlotObject constructor assigns self.root_config from keyword args
		# and is an instance of a '_emerge.RootConfig.RootConfig class
		self.root = self.root_config.root
		self._raw_metadata = metadata
		self._metadata = _PackageMetadataWrapper(self, metadata)
		if not self.built:
			self._metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
		eapi_attrs = _get_eapi_attrs(self.eapi)

		try:
			db = self.cpv._db
		except AttributeError:
			if self.built:
				# For independence from the source ebuild repository and
				# profile implicit IUSE state, require the _db attribute
				# for built packages.
				raise
			db = self.root_config.trees['porttree'].dbapi

		self.cpv = _pkg_str(self.cpv, metadata=self._metadata,
			settings=self.root_config.settings, db=db)
		if hasattr(self.cpv, 'slot_invalid'):
			self._invalid_metadata('SLOT.invalid',
				"SLOT: invalid value: '%s'" % self._metadata["SLOT"])
		self.cpv_split = self.cpv.cpv_split
		self.category, self.pf = portage.catsplit(self.cpv)
		self.cp = self.cpv.cp
		self.version = self.cpv.version
		self.slot = self.cpv.slot
		self.sub_slot = self.cpv.sub_slot
		self.slot_atom = Atom("%s%s%s" % (self.cp, _slot_separator, self.slot))
		# sync metadata with validated repo (may be UNKNOWN_REPO)
		self._metadata['repository'] = self.cpv.repo

		if self.root_config.settings.local_config:
			implicit_match = db._iuse_implicit_cnstr(self.cpv, self._metadata)
		else:
			implicit_match = db._repoman_iuse_implicit_cnstr(self.cpv, self._metadata)
		usealiases = self.root_config.settings._use_manager.getUseAliases(self)
		self.iuse = self._iuse(self, self._metadata["IUSE"].split(),
			implicit_match, usealiases, self.eapi)

		if (self.iuse.enabled or self.iuse.disabled) and \
			not eapi_attrs.iuse_defaults:
			if not self.installed:
				self._invalid_metadata('EAPI.incompatible',
					"IUSE contains defaults, but EAPI doesn't allow them")
		if self.inherited is None:
			self.inherited = frozenset()

		if self.operation is None:
			if self.onlydeps or self.installed:
				self.operation = "nomerge"
			else:
				self.operation = "merge"

		self._hash_key = Package._gen_hash_key(cpv=self.cpv,
			installed=self.installed, onlydeps=self.onlydeps,
			operation=self.operation, repo_name=self.cpv.repo,
			root_config=self.root_config,
			type_name=self.type_name)
		self._hash_value = hash(self._hash_key)