def __init__(self, parent_repository, pkg, data, cpvstr): """ :param cpvstr: cpv for the new pkg :param parent_repository: actual repository that this pkg should claim it belongs to :param pkg: parent pkg that is generating this pkg :param data: mapping of data to push to use in __getattr__ access """ c = CPV.unversioned(cpvstr) if c.fullver is None: cpvstr = cpvstr + "-" + pkg.fullver metadata.package.__init__(self, parent_repository, cpvstr) sfunc = object.__setattr__ sfunc(self, "data", IndeterminantDict(lambda *a: str(), data)) sfunc(self, "_orig_data", data) sfunc(self, "provider", pkg.versioned_atom)
def __init__(self, parent_repository, pkg, data, cpvstr): """ :param cpvstr: cpv for the new pkg :param parent_repository: actual repository that this pkg should claim it belongs to :param pkg: parent pkg that is generating this pkg :param data: mapping of data to push to use in __getattr__ access """ c = CPV.unversioned(cpvstr) if c.fullver is None: cpvstr = cpvstr + "-" + pkg.fullver metadata.package.__init__(self, parent_repository, cpvstr) sfunc = object.__setattr__ sfunc(self, "data", IndeterminantDict(lambda *a: str(), data)) sfunc(self, "_orig_data", data) sfunc(self, "provider", pkg.versioned_atom) sfunc(self, "eapi_obj", get_eapi("0"))
def test_nonversioned(self): a = self.kls("kde-base/kde") self.assertMatch(a, CPV.unversioned("kde-base/kde")) self.assertNotMatch(a, CPV.unversioned("kde-base/kde2")) self.assertMatch(a, CPV.versioned("kde-base/kde-3"))
def test_nonversioned(self): a = self.kls("kde-base/kde") self.assertTrue(a.match(CPV.unversioned("kde-base/kde"))) self.assertFalse(a.match(CPV.unversioned("kde-base/kde2"))) self.assertTrue(a.match(CPV.versioned("kde-base/kde-3")))