From: Zac Medico Date: Fri, 23 Sep 2011 00:47:48 +0000 (-0700) Subject: Atom: add a with_repo method for adding a repo X-Git-Tag: v2.2.0_alpha60~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb6448785038e812b806e14d16497a1a3aacd201;p=portage.git Atom: add a with_repo method for adding a repo --- diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 89b6f1547..5bb6becdb 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -1216,6 +1216,18 @@ class Atom(_atom_base): return Atom(self.replace(_slot_separator + self.slot, '', 1), allow_repo=True, allow_wildcard=True) + def with_repo(self, repo): + if self.slot is None: + atom = self + else: + atom = remove_slot(self) + if self.slot is not None: + atom += _slot_separator + slot + atom += _repo_separator + repo + if self.use is not None: + atom += str(self.use) + return Atom(atom, allow_repo=True, allow_wildcard=True) + def with_slot(self, slot): atom = remove_slot(self) + _slot_separator + slot if self.repo is not None: