portage.git
15 years agoReplace dict.keys() usage with __iter__(), since it behaves identically in
Zac Medico [Tue, 22 Sep 2009 21:37:53 +0000 (21:37 -0000)]
Replace dict.keys() usage with __iter__(), since it behaves identically in
both python 2.x and 3.x.

svn path=/main/trunk/; revision=14385

15 years agoReplace dict.keys() usage with __iter__(), since it behaves identically in
Zac Medico [Tue, 22 Sep 2009 21:26:20 +0000 (21:26 -0000)]
Replace dict.keys() usage with __iter__(), since it behaves identically in
both python 2.x and 3.x.

svn path=/main/trunk/; revision=14384

15 years agoRemove code that's been commented out.
Zac Medico [Tue, 22 Sep 2009 20:47:11 +0000 (20:47 -0000)]
Remove code that's been commented out.

svn path=/main/trunk/; revision=14383

15 years agoReplace dict.keys() usage with __iter__(), since it behaves identically in
Zac Medico [Tue, 22 Sep 2009 20:43:34 +0000 (20:43 -0000)]
Replace dict.keys() usage with __iter__(), since it behaves identically in
both python 2.x and 3.x.

svn path=/main/trunk/; revision=14382

15 years agoFix for python 3.x compatibility.
Zac Medico [Tue, 22 Sep 2009 20:33:01 +0000 (20:33 -0000)]
Fix for python 3.x compatibility.

svn path=/main/trunk/; revision=14381

15 years agoReplace dict.keys() usage with __iter__(), since it behaves identically in
Zac Medico [Tue, 22 Sep 2009 20:18:45 +0000 (20:18 -0000)]
Replace dict.keys() usage with __iter__(), since it behaves identically in
both python 2.x and 3.x.

svn path=/main/trunk/; revision=14380

15 years agoReplace doct.keys() usage with __iter__(), since it behaves identically in
Zac Medico [Tue, 22 Sep 2009 20:03:10 +0000 (20:03 -0000)]
Replace doct.keys() usage with __iter__(), since it behaves identically in
both python 2.x and 3.x.

svn path=/main/trunk/; revision=14379

15 years agoDo manual unicode handling (instead of using the wrapped os module) in
Zac Medico [Tue, 22 Sep 2009 19:48:26 +0000 (19:48 -0000)]
Do manual unicode handling (instead of using the wrapped os module) in
portdbapi.findname2(), since it's a hotspot. Thanks to Marat Radchenko
<marat@slonopotamus.org> for the initial patch.

svn path=/main/trunk/; revision=14378

15 years agoFor python 3.x with boolean target, len() results in TypeError, so
Zac Medico [Tue, 22 Sep 2009 18:54:27 +0000 (18:54 -0000)]
For python 3.x with boolean target, len() results in TypeError, so
make __len__ return 0 or 1 in this case.

svn path=/main/trunk/; revision=14377

15 years agoOptimize unicode wrappers. Thanks to Marat Radchenko <marat@slonopotamus.org>
Zac Medico [Tue, 22 Sep 2009 18:37:31 +0000 (18:37 -0000)]
Optimize unicode wrappers. Thanks to Marat Radchenko <marat@slonopotamus.org>
for this patch from bug #276813.

svn path=/main/trunk/; revision=14376

15 years agoFix another potential 'RuntimeError: dictionary changed size during iteration'
Zac Medico [Tue, 22 Sep 2009 03:57:58 +0000 (03:57 -0000)]
Fix another potential 'RuntimeError: dictionary changed size during iteration'
exception in _owners_db._populate() for py3k.

svn path=/main/trunk/; revision=14375

15 years agoFix 'iteritems' attribute detection to look for 'items' instead.
Zac Medico [Tue, 22 Sep 2009 03:51:12 +0000 (03:51 -0000)]
Fix 'iteritems' attribute detection to look for 'items' instead.

svn path=/main/trunk/; revision=14374

15 years agoFix 'RuntimeError: dictionary changed size during iteration' in
Zac Medico [Tue, 22 Sep 2009 03:44:27 +0000 (03:44 -0000)]
Fix 'RuntimeError: dictionary changed size during iteration' in
bindbapi.aux_update() with py3k.

svn path=/main/trunk/; revision=14373

15 years agoRemove redundant list() since starred expressions work with iterators.
Zac Medico [Tue, 22 Sep 2009 02:46:02 +0000 (02:46 -0000)]
Remove redundant list() since starred expressions work with iterators.

svn path=/main/trunk/; revision=14372

15 years agoFix items to prevent infinite recursion.
Zac Medico [Tue, 22 Sep 2009 02:02:45 +0000 (02:02 -0000)]
Fix items to prevent infinite recursion.

svn path=/main/trunk/; revision=14371

15 years agoFix 'RuntimeError: dictionary changed size during iteration' in
Zac Medico [Mon, 21 Sep 2009 22:26:56 +0000 (22:26 -0000)]
Fix 'RuntimeError: dictionary changed size during iteration' in
_owners_db._populate() with py3k.

svn path=/main/trunk/; revision=14370

15 years agoDon't wrap os.statvfs since it requires unicode string args in py3k.
Zac Medico [Mon, 21 Sep 2009 22:20:28 +0000 (22:20 -0000)]
Don't wrap os.statvfs since it requires unicode string args in py3k.

svn path=/main/trunk/; revision=14369

15 years agoFix sorted() keyword arg for py3k.
Zac Medico [Mon, 21 Sep 2009 22:08:33 +0000 (22:08 -0000)]
Fix sorted() keyword arg for py3k.

svn path=/main/trunk/; revision=14368

15 years agoEncode/decode names from the xpak index where appropriate.
Zac Medico [Mon, 21 Sep 2009 22:02:09 +0000 (22:02 -0000)]
Encode/decode names from the xpak index where appropriate.

svn path=/main/trunk/; revision=14367

15 years agoIn _unicode_func_wrapper, only encode keyword argument values, and not the
Zac Medico [Mon, 21 Sep 2009 20:50:59 +0000 (20:50 -0000)]
In _unicode_func_wrapper, only encode keyword argument values, and not the
keys.

svn path=/main/trunk/; revision=14366

15 years agoFix PORTAGE_WORKDIR_MODE parsing code so it doesn't store python's octal
Zac Medico [Mon, 21 Sep 2009 20:44:30 +0000 (20:44 -0000)]
Fix PORTAGE_WORKDIR_MODE parsing code so it doesn't store python's octal
syntax in the environment variable.

svn path=/main/trunk/; revision=14365

15 years agoMake find_binary() use os.environ.get instead of os.getenv, since os.getenv
Zac Medico [Mon, 21 Sep 2009 20:29:30 +0000 (20:29 -0000)]
Make find_binary() use os.environ.get instead of os.getenv, since os.getenv
isn't behaving correctly in py3k (maybe a unicode wrapper issue?).

svn path=/main/trunk/; revision=14364

15 years agoDon't encode the env in py3k since it expects strings for the env that's
Zac Medico [Mon, 21 Sep 2009 20:12:40 +0000 (20:12 -0000)]
Don't encode the env in py3k since it expects strings for the env that's
passed into os.execve().

svn path=/main/trunk/; revision=14363

15 years agoTemporarily disable use of pty in py3k since it triggers an unresolved
Zac Medico [Mon, 21 Sep 2009 19:56:26 +0000 (19:56 -0000)]
Temporarily disable use of pty in py3k since it triggers an unresolved
issue, http://bugs.python.org/issue5380. With this workaround,
portage.tests.ebuild.test_spawn.SpawnTestCase.testLogfile() does
not raise IOError.

svn path=/main/trunk/; revision=14362

15 years agoFix decodeint() for py3k compat, since bytes are a sequence of integers
Zac Medico [Mon, 21 Sep 2009 19:51:02 +0000 (19:51 -0000)]
Fix decodeint() for py3k compat, since bytes are a sequence of integers
instead of characters.

svn path=/main/trunk/; revision=14361

15 years agoUse input() instead of raw_input() when Python 3 is used.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 18:34:38 +0000 (18:34 -0000)]
Use input() instead of raw_input() when Python 3 is used.

svn path=/main/trunk/; revision=14358

15 years agoDecode database name passed to portage.cache.sqlite.database._db_module.connect(...
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 18:19:39 +0000 (18:19 -0000)]
Decode database name passed to portage.cache.sqlite.database._db_module.connect() for compatibility with Python 3.

svn path=/main/trunk/; revision=14357

15 years agoUse next(iterator) instead of iterator.next() for compatibility with Python 3.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 18:14:01 +0000 (18:14 -0000)]
Use next(iterator) instead of iterator.next() for compatibility with Python 3.
(2to3-3.1 -f next -nw ${FILES})

svn path=/main/trunk/; revision=14355

15 years agoDecode all keys in dictionary containing environment passed to os.execve() in portage...
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 18:02:08 +0000 (18:02 -0000)]
Decode all keys in dictionary containing environment passed to os.execve() in portage.process._exec() for compatibility with Python 3.

svn path=/main/trunk/; revision=14352

15 years ago'filtered_auxdbkeys' should be a list to allow sorting.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 17:46:21 +0000 (17:46 -0000)]
'filtered_auxdbkeys' should be a list to allow sorting.

svn path=/main/trunk/; revision=14347

15 years agoDefine long as int when Python 3 is used.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 17:41:45 +0000 (17:41 -0000)]
Define long as int when Python 3 is used.

svn path=/main/trunk/; revision=14343

15 years agoSupport bytes in portage.util.normalize_path() with Python 3.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 17:03:17 +0000 (17:03 -0000)]
Support bytes in portage.util.normalize_path() with Python 3.

svn path=/main/trunk/; revision=14333

15 years agoFix portage._unicode_func_wrapper.__call__() to properly handle bytes with Python 3.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 17:00:59 +0000 (17:00 -0000)]
Fix portage._unicode_func_wrapper.__call__() to properly handle bytes with Python 3.

svn path=/main/trunk/; revision=14331

15 years agoFix dep_expand so that it doesn't use deprecated dep_getcpv() usage
Zac Medico [Mon, 21 Sep 2009 16:57:17 +0000 (16:57 -0000)]
Fix dep_expand so that it doesn't use deprecated dep_getcpv() usage
(with missing category).

svn path=/main/trunk/; revision=14330

15 years agoFix infinite recursion in items and values methods.
Zac Medico [Mon, 21 Sep 2009 16:25:27 +0000 (16:25 -0000)]
Fix infinite recursion in items and values methods.

svn path=/main/trunk/; revision=14329

15 years agoFix infinite recursion in items and values methods.
Zac Medico [Mon, 21 Sep 2009 16:23:20 +0000 (16:23 -0000)]
Fix infinite recursion in items and values methods.

svn path=/main/trunk/; revision=14328

15 years agoUse dict.(keys|values|items)() instead of dict.(iterkeys|itervalues|iteritems)()...
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 16:07:07 +0000 (16:07 -0000)]
Use dict.(keys|values|items)() instead of dict.(iterkeys|itervalues|iteritems)() for compatibility with Python 3.
(2to3-3.1 -f dict -nw ${FILES})

svn path=/main/trunk/; revision=14327

15 years agoFix case for 0 args in args unicode conversion.
Zac Medico [Mon, 21 Sep 2009 15:44:51 +0000 (15:44 -0000)]
Fix case for 0 args in args unicode conversion.

svn path=/main/trunk/; revision=14326

15 years agoSimplify match_to_list(). Thanks to Marat Radchenko <marat@slonopotamus.org>
Zac Medico [Mon, 21 Sep 2009 15:29:25 +0000 (15:29 -0000)]
Simplify match_to_list(). Thanks to Marat Radchenko <marat@slonopotamus.org>
for this patch from bug #276813.

svn path=/main/trunk/; revision=14325

15 years agoShow deprecation warnings when dep_* legacy code is triggered.
Zac Medico [Mon, 21 Sep 2009 15:24:12 +0000 (15:24 -0000)]
Show deprecation warnings when dep_* legacy code is triggered.

svn path=/main/trunk/; revision=14324

15 years agoFix breakage in _unicode_encode() for non-string types.
Zac Medico [Mon, 21 Sep 2009 14:47:40 +0000 (14:47 -0000)]
Fix breakage in _unicode_encode() for non-string types.

svn path=/main/trunk/; revision=14323

15 years agoDeprecate key_expand and portage.dbapi.porttree.portagetree.resolve_specific
Zac Medico [Mon, 21 Sep 2009 14:34:13 +0000 (14:34 -0000)]
Deprecate key_expand and portage.dbapi.porttree.portagetree.resolve_specific
which calls it.

svn path=/main/trunk/; revision=14322

15 years agoSupport both Python 2 and 3 in portage._unicode_encode() and portage._unicode_decode().
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 14:15:49 +0000 (14:15 -0000)]
Support both Python 2 and 3 in portage._unicode_encode() and portage._unicode_decode().
Update decoding in some files.

svn path=/main/trunk/; revision=14321

15 years agoUse dep_expand instead of key_expand in the blocker display, since it seems
Zac Medico [Mon, 21 Sep 2009 13:48:15 +0000 (13:48 -0000)]
Use dep_expand instead of key_expand in the blocker display, since it seems
like a better fit. Also, use str(atom) since we don't want to assume that
Atoms are string type (though they happen to be now). This assumption is
what caused the traceback in bug 285637, comment #5.

svn path=/main/trunk/; revision=14320

15 years agoMake key_expand() always return Atom type.
Zac Medico [Mon, 21 Sep 2009 13:16:12 +0000 (13:16 -0000)]
Make key_expand() always return Atom type.

svn path=/main/trunk/; revision=14319

15 years agoAdd deprecation warnings to vartree.exists_specific_cat(), getnode(), and
Zac Medico [Mon, 21 Sep 2009 13:06:29 +0000 (13:06 -0000)]
Add deprecation warnings to vartree.exists_specific_cat(), getnode(), and
hasnode(). Use dbapi methods instead.

svn path=/main/trunk/; revision=14318

15 years agoUse range() instead of xrange() for compatibility with Python 3.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 12:49:33 +0000 (12:49 -0000)]
Use range() instead of xrange() for compatibility with Python 3.
(2to3-3.1 -f xrange -nw ${FILES})

svn path=/main/trunk/; revision=14317

15 years agoDefine basestring as str when Python 3 is used.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 12:44:37 +0000 (12:44 -0000)]
Define basestring as str when Python 3 is used.

svn path=/main/trunk/; revision=14316

15 years agoFix all remaining SyntaxErrors with Python 3.
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 12:16:07 +0000 (12:16 -0000)]
Fix all remaining SyntaxErrors with Python 3.

svn path=/main/trunk/; revision=14315

15 years agoUse filter() and zip() instead of itertools.ifilter() and itertools.izip() for compat...
Arfrever Frehtes Taifersar Arahesis [Mon, 21 Sep 2009 11:49:13 +0000 (11:49 -0000)]
Use filter() and zip() instead of itertools.ifilter() and itertools.izip() for compatibility with Python 3.
(2to3-3.1 -f itertools -f itertools_imports -nw ${FILES})

svn path=/main/trunk/; revision=14314

15 years agoMake Atom.__init__ call the base class constructor, though it doesn't seem
Zac Medico [Mon, 21 Sep 2009 02:06:49 +0000 (02:06 -0000)]
Make Atom.__init__ call the base class constructor, though it doesn't seem
to matter.

svn path=/main/trunk/; revision=14313

15 years agoWhen generating config.prevmaskdict, only call the Atom constructor when
Zac Medico [Mon, 21 Sep 2009 02:04:47 +0000 (02:04 -0000)]
When generating config.prevmaskdict, only call the Atom constructor when
necessary.

svn path=/main/trunk/; revision=14312

15 years agoFix AtomArg constructor calls to pass in Atom instances, so the constructor
Zac Medico [Mon, 21 Sep 2009 01:54:01 +0000 (01:54 -0000)]
Fix AtomArg constructor calls to pass in Atom instances, so the constructor
never has to construct one.

svn path=/main/trunk/; revision=14311

15 years agoTread blockers as invalid.
Zac Medico [Mon, 21 Sep 2009 01:43:35 +0000 (01:43 -0000)]
Tread blockers as invalid.

svn path=/main/trunk/; revision=14310

15 years agoFix redundant Atom construtor call in _show_unsatisfied_dep().
Zac Medico [Mon, 21 Sep 2009 01:20:49 +0000 (01:20 -0000)]
Fix redundant Atom construtor call in _show_unsatisfied_dep().

svn path=/main/trunk/; revision=14309

15 years agoRemove virtuals from the cache because they're unused since portage-2.1.6
Zac Medico [Sun, 20 Sep 2009 23:31:28 +0000 (23:31 -0000)]
Remove virtuals from the cache because they're unused since portage-2.1.6
and it won't hurt older portage.

svn path=/main/trunk/; revision=14308

15 years agoFix typos in http.client imports.
Zac Medico [Sun, 20 Sep 2009 23:14:08 +0000 (23:14 -0000)]
Fix typos in http.client imports.

svn path=/main/trunk/; revision=14307

15 years agoFix typo from previous commit.
Zac Medico [Sun, 20 Sep 2009 23:01:21 +0000 (23:01 -0000)]
Fix typo from previous commit.

svn path=/main/trunk/; revision=14306

15 years agoFix depgraph._validate_blockers() so that it doesn't do prohibited Atom(Atom)
Zac Medico [Sun, 20 Sep 2009 22:59:04 +0000 (22:59 -0000)]
Fix depgraph._validate_blockers() so that it doesn't do prohibited Atom(Atom)
constructor calls.

svn path=/main/trunk/; revision=14305

15 years agoAdd fallback in ImportError for io.StringIO. This is needed for python-2.6
Zac Medico [Sun, 20 Sep 2009 22:45:32 +0000 (22:45 -0000)]
Add fallback in ImportError for io.StringIO. This is needed for python-2.6
with USE=build since io imports threading which imports thread which is
unavailable.

svn path=/main/trunk/; revision=14304

15 years agoAdd support in ConsoleStyleFile.write() for unicode encoding when writing to
Zac Medico [Sun, 20 Sep 2009 22:23:58 +0000 (22:23 -0000)]
Add support in ConsoleStyleFile.write() for unicode encoding when writing to
stdout/stderr in python-2.x.

svn path=/main/trunk/; revision=14303

15 years agoMisc unicode fixes for repoman.
Zac Medico [Sun, 20 Sep 2009 22:08:22 +0000 (22:08 -0000)]
Misc unicode fixes for repoman.

svn path=/main/trunk/; revision=14302

15 years agoUse _unicode_encode() to ensure that only unicode strings are passed into
Zac Medico [Sun, 20 Sep 2009 20:00:57 +0000 (20:00 -0000)]
Use _unicode_encode() to ensure that only unicode strings are passed into
io.StringIO text streams.

svn path=/main/trunk/; revision=14301

15 years agoMake Atom inherit from str. Thanks to Marat Radchenko
Zac Medico [Sun, 20 Sep 2009 19:34:34 +0000 (19:34 -0000)]
Make Atom inherit from str. Thanks to Marat Radchenko
<marat@slonopotamus.org> for this patch from bug #276813.

svn path=/main/trunk/; revision=14300

15 years agoMake _unicode_module_wrapper cache wrappers and reuse them. Thanks to
Zac Medico [Sun, 20 Sep 2009 18:54:57 +0000 (18:54 -0000)]
Make _unicode_module_wrapper cache wrappers and reuse them. Thanks to
Marat Radchenko <marat@slonopotamus.org> for this patch from bug #276813.

svn path=/main/trunk/; revision=14299

15 years agoIn doebuild_environment(), detect if setcpv() hasn't been called properly,
Zac Medico [Sun, 20 Sep 2009 18:38:00 +0000 (18:38 -0000)]
In doebuild_environment(), detect if setcpv() hasn't been called properly,
and call it if necessary (mainly for api consumers).

svn path=/main/trunk/; revision=14298

15 years agoAdd back a line which I erroneously removed when committing the patch for
Zac Medico [Sun, 20 Sep 2009 18:13:06 +0000 (18:13 -0000)]
Add back a line which I erroneously removed when committing the patch for
bug 203733. Thanks to Alexis Ballier <aballier@g.o> for reporting the related
KeyError.

svn path=/main/trunk/; revision=14297

15 years agoFix position of imports from __future__.
Arfrever Frehtes Taifersar Arahesis [Sun, 20 Sep 2009 16:48:13 +0000 (16:48 -0000)]
Fix position of imports from __future__.

svn path=/main/trunk/; revision=14296

15 years agoSupport print() function with Python 2 in more files.
Arfrever Frehtes Taifersar Arahesis [Sun, 20 Sep 2009 16:41:30 +0000 (16:41 -0000)]
Support print() function with Python 2 in more files.

svn path=/main/trunk/; revision=14295

15 years agoUpdate system imports for compatibility with Python 3.
Arfrever Frehtes Taifersar Arahesis [Sun, 20 Sep 2009 16:22:08 +0000 (16:22 -0000)]
Update system imports for compatibility with Python 3.

svn path=/main/trunk/; revision=14294

15 years agoUpdate syntax of numbers in some files which were missing in previous commit.
Arfrever Frehtes Taifersar Arahesis [Sun, 20 Sep 2009 12:39:22 +0000 (12:39 -0000)]
Update syntax of numbers in some files which were missing in previous commit.

svn path=/main/trunk/; revision=14293

15 years agoUpdate syntax of numbers for compatibility with Python 3.
Arfrever Frehtes Taifersar Arahesis [Sun, 20 Sep 2009 11:47:45 +0000 (11:47 -0000)]
Update syntax of numbers for compatibility with Python 3.
(2to3-3.1 -f numliterals -nw ${FILES})

svn path=/main/trunk/; revision=14292

15 years agoSupport print() function with Python 2 in some files.
Arfrever Frehtes Taifersar Arahesis [Sun, 20 Sep 2009 11:28:14 +0000 (11:28 -0000)]
Support print() function with Python 2 in some files.

svn path=/main/trunk/; revision=14291

15 years agoUpdate syntax of calls to print() for compatibility with Python 3.
Arfrever Frehtes Taifersar Arahesis [Sun, 20 Sep 2009 11:08:30 +0000 (11:08 -0000)]
Update syntax of calls to print() for compatibility with Python 3.
(2to3-3.1 -f print -nw ${FILES})

svn path=/main/trunk/; revision=14290

15 years agoUpdate syntax of 'except' statements for compatibility with Python 3.
Arfrever Frehtes Taifersar Arahesis [Sun, 20 Sep 2009 10:57:44 +0000 (10:57 -0000)]
Update syntax of 'except' statements for compatibility with Python 3.
(2to3-3.1 -f except -nw ${FILES})

svn path=/main/trunk/; revision=14289

15 years agoBug #285637 - Fix NameError exception triggered by InvalidAtom in
Zac Medico [Sun, 20 Sep 2009 06:56:46 +0000 (06:56 -0000)]
Bug #285637 - Fix NameError exception triggered by InvalidAtom in
grabfile_package().

svn path=/main/trunk/; revision=14288

15 years agoAdd isinstance(mydep, Atom) checks to the dep_* functions since we don't use a v2.2_rc41
Zac Medico [Sat, 19 Sep 2009 23:05:24 +0000 (23:05 -0000)]
Add isinstance(mydep, Atom) checks to the dep_* functions since we don't use a
metaclass to do that anymore (due to performance).

svn path=/main/trunk/; revision=14286

15 years agoFix config.setinst() to add Atom instances to the provider lists instead of
Zac Medico [Sat, 19 Sep 2009 21:30:08 +0000 (21:30 -0000)]
Fix config.setinst() to add Atom instances to the provider lists instead of
plain str.

svn path=/main/trunk/; revision=14285

15 years agoRevert accidental changes _unicode_module_wrapper.__getattribute__ from
Zac Medico [Sat, 19 Sep 2009 20:14:25 +0000 (20:14 -0000)]
Revert accidental changes _unicode_module_wrapper.__getattribute__ from
previous commit.

svn path=/main/trunk/; revision=14284

15 years agoRemove obsolete InvalidAtom handler in _add_pkg_dep_string().
Zac Medico [Sat, 19 Sep 2009 20:10:56 +0000 (20:10 -0000)]
Remove obsolete InvalidAtom handler in _add_pkg_dep_string().

svn path=/main/trunk/; revision=14283

15 years agoAvoid lots of redundant Atom constructor calls. Thanks to Marat Radchenko
Zac Medico [Sat, 19 Sep 2009 17:05:52 +0000 (17:05 -0000)]
Avoid lots of redundant Atom constructor calls. Thanks to Marat Radchenko
<marat@slonopotamus.org> for the initial patch from bug #276813.

svn path=/main/trunk/; revision=14282

15 years agoFix _expand_new_virtuals() to preserve USE deps in atoms for new-style
Zac Medico [Sat, 19 Sep 2009 14:57:18 +0000 (14:57 -0000)]
Fix _expand_new_virtuals() to preserve USE deps in atoms for new-style
virtuals, and update the corresponding depgraph code.

svn path=/main/trunk/; revision=14281

15 years agoUse a dict for Package.metadata, because it's faster. Thanks to Marat
Zac Medico [Sat, 19 Sep 2009 12:58:52 +0000 (12:58 -0000)]
Use a dict for Package.metadata, because it's faster. Thanks to Marat
Radchenko <marat@slonopotamus.org> for this patch from bug #276813.

svn path=/main/trunk/; revision=14280

15 years agoAtom optimizations. Remove the metaclass and cache since it just slows it
Zac Medico [Fri, 18 Sep 2009 15:18:34 +0000 (15:18 -0000)]
Atom optimizations. Remove the metaclass and cache since it just slows it
down. Thanks to Marat Radchenko <marat@slonopotamus.org> for this patch.

svn path=/main/trunk/; revision=14279

15 years agoUpdate documentation of inherit. Reported by Jeremy Olexa.
Arfrever Frehtes Taifersar Arahesis [Tue, 15 Sep 2009 21:39:57 +0000 (21:39 -0000)]
Update documentation of inherit. Reported by Jeremy Olexa.

svn path=/main/trunk/; revision=14274

15 years agoFix broken virtual depth code from previous commit.
Zac Medico [Mon, 14 Sep 2009 13:44:53 +0000 (13:44 -0000)]
Fix broken virtual depth code from previous commit.

svn path=/main/trunk/; revision=14273

15 years agoAdd support in depgraph._add_pkg_dep_string() for adding indirect virtual
Zac Medico [Mon, 14 Sep 2009 13:35:01 +0000 (13:35 -0000)]
Add support in depgraph._add_pkg_dep_string() for adding indirect virtual
deps to the graph. This takes advantage of circular dependency avoidance
that's done by dep_zapdeps, while avoiding the dependency graph distortion
reported in bug #283795.

svn path=/main/trunk/; revision=14272

15 years agoMake depgraph._select_atoms() return a dict, in order to separate selected
Zac Medico [Mon, 14 Sep 2009 12:51:31 +0000 (12:51 -0000)]
Make depgraph._select_atoms() return a dict, in order to separate selected
direct deps from indirect virtual deps.

svn path=/main/trunk/; revision=14271

15 years agoWhen _expand_new_virtuals() is called by repoman, skip expansion of new-style
Zac Medico [Mon, 14 Sep 2009 11:18:21 +0000 (11:18 -0000)]
When _expand_new_virtuals() is called by repoman, skip expansion of new-style
virtuals.

svn path=/main/trunk/; revision=14270

15 years agoReimplement the code from bug #283795 so that indirect deps are preserved
Zac Medico [Mon, 14 Sep 2009 11:05:16 +0000 (11:05 -0000)]
Reimplement the code from bug #283795 so that indirect deps are preserved
for later use. TODO: Write code to add selected indirect virtual deps to
the graph. This will take advantage of circular dependency avoidance that's
done by dep_zapdeps.

svn path=/main/trunk/; revision=14269

15 years agoSimplify cpv_getkey() by just calling dep_getkey('=' + mycpv).
Zac Medico [Mon, 14 Sep 2009 08:24:30 +0000 (08:24 -0000)]
Simplify cpv_getkey() by just calling dep_getkey('=' + mycpv).

svn path=/main/trunk/; revision=14264

15 years agoMake dep_getcpv() use Atom, and fall back to legacy code for backward compat.
Zac Medico [Mon, 14 Sep 2009 08:11:22 +0000 (08:11 -0000)]
Make dep_getcpv() use Atom, and fall back to legacy code for backward compat.

svn path=/main/trunk/; revision=14262

15 years agoInsice match_from_list(), use remove_slot() instead of dep_getcpv() where
Zac Medico [Mon, 14 Sep 2009 07:59:47 +0000 (07:59 -0000)]
Insice match_from_list(), use remove_slot() instead of dep_getcpv() where
appropriate.

svn path=/main/trunk/; revision=14261

15 years agoUse a regular expression for cpv_getkey(), and fall back to legacy code if
Zac Medico [Mon, 14 Sep 2009 07:52:45 +0000 (07:52 -0000)]
Use a regular expression for cpv_getkey(), and fall back to legacy code if
no match is found.

svn path=/main/trunk/; revision=14259

15 years agoMake get_operator() use Atom, and remove unnecessary reflection code from
Zac Medico [Mon, 14 Sep 2009 07:02:18 +0000 (07:02 -0000)]
Make get_operator() use Atom, and remove unnecessary reflection code from
dep_getkey(). Thanks to Marat Radchenko <marat@slonopotamus.org> for
suggestions.

svn path=/main/trunk/; revision=14256

15 years agoMake isspecific() use the Atom class and fall back to legacy code if the
Zac Medico [Mon, 14 Sep 2009 06:49:01 +0000 (06:49 -0000)]
Make isspecific() use the Atom class and fall back to legacy code if the
atom is invalid. Also, optimize called isjustname() legacy code to only
check the last 2 components.

svn path=/main/trunk/; revision=14255

15 years agoUse the Atom class to implement dep_getkey(), and fall back to legacy code
Zac Medico [Mon, 14 Sep 2009 06:02:36 +0000 (06:02 -0000)]
Use the Atom class to implement dep_getkey(), and fall back to legacy code
when necessary for backward compatibility.

svn path=/main/trunk/; revision=14254

15 years agoAdd more test cases.
Zac Medico [Mon, 14 Sep 2009 05:54:39 +0000 (05:54 -0000)]
Add more test cases.

svn path=/main/trunk/; revision=14253

15 years agoSimplify isvalidatom() to simply use the Atom class. Thanks to Marat
Zac Medico [Mon, 14 Sep 2009 05:51:28 +0000 (05:51 -0000)]
Simplify isvalidatom() to simply use the Atom class. Thanks to Marat
Radchenko <marat@slonopotamus.org> for the suggestion.

svn path=/main/trunk/; revision=14252

15 years agoSimplify the _pkg regex and fix validation for some cases by using the
Zac Medico [Mon, 14 Sep 2009 05:46:21 +0000 (05:46 -0000)]
Simplify the _pkg regex and fix validation for some cases by using the
_version regex to match unwanted version-like components which can not
be at the end of a _pkg match. For example
isvalidatom('app-doc/php-docs-20071125-r2') now correctly returns False.

svn path=/main/trunk/; revision=14251