portage.git
15 years agoBug #261082 - Prefer remote package instances whenever --getbinpkg is enabled
Zac Medico [Wed, 4 Mar 2009 23:02:04 +0000 (23:02 -0000)]
Bug #261082 - Prefer remote package instances whenever --getbinpkg is enabled
(previously local instances were preferred unless --getbinpkgonly was enabled).

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

15 years agoMake glsa-check executable.
Zac Medico [Wed, 4 Mar 2009 21:16:33 +0000 (21:16 -0000)]
Make glsa-check executable.

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

15 years agoBug #261082 - Fix --getbinpkgonly code in binarytree._populate() to
Zac Medico [Wed, 4 Mar 2009 20:30:17 +0000 (20:30 -0000)]
Bug #261082 - Fix --getbinpkgonly code in binarytree._populate() to
update the aux_get cache when it's appropriate for a remote package
to override a local package.

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

15 years agoBug #256289 - When displaying an unsatisfied USE dep and all packages with
Zac Medico [Wed, 4 Mar 2009 04:14:18 +0000 (04:14 -0000)]
Bug #256289 - When displaying an unsatisfied USE dep and all packages with
the required IUSE are masked, show a normal "masked package" message for
the package(s) that have the required IUSE (instead of showing the unmasked
packages with missing IUSE).

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

15 years agoFix vdb entry writting code in dyn_install() to avoid generating empty entries
Zac Medico [Wed, 4 Mar 2009 02:26:24 +0000 (02:26 -0000)]
Fix vdb entry writting code in dyn_install() to avoid generating empty entries
in some cases. Thanks to Ned Ludd <solar@g.o> for reporting.

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

15 years agoMake KeyValuePairFileLoader store the values as a strings instead of a lists.
Zac Medico [Tue, 3 Mar 2009 03:39:57 +0000 (03:39 -0000)]
Make KeyValuePairFileLoader store the values as a strings instead of a lists.

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

15 years agoACCEPT_CHOSTS applies to unbuilt ebuild now (not just binary packages).
Zac Medico [Tue, 3 Mar 2009 00:11:33 +0000 (00:11 -0000)]
ACCEPT_CHOSTS applies to unbuilt ebuild now (not just binary packages).

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

15 years agoFix KeyValuePairFileLoader to only split on '=' once and strip whitespace
Zac Medico [Mon, 2 Mar 2009 23:51:12 +0000 (23:51 -0000)]
Fix KeyValuePairFileLoader to only split on '=' once and strip whitespace
for keys and values.

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

15 years agoWhen ACCEPT_CHOSTS is set, enable CHOST masking for unbuilt ebuilds. This
Zac Medico [Mon, 2 Mar 2009 22:59:59 +0000 (22:59 -0000)]
When ACCEPT_CHOSTS is set, enable CHOST masking for unbuilt ebuilds. This
behaves as a sanity check to protect people who are cross-compiling from
accidentally merging an ebuild with CHOST set incorrectly. Thanks to Ned
Ludd <solar@g.o> for reporting the problem.

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

15 years agoUse PORTAGE_USE when evaluating LICENSE inside portdbapi.gvisible().
Zac Medico [Mon, 2 Mar 2009 22:37:58 +0000 (22:37 -0000)]
Use PORTAGE_USE when evaluating LICENSE inside portdbapi.gvisible().

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

15 years agoWhen fetch() is called and there is an existing file with the wrong size that
Zac Medico [Mon, 2 Mar 2009 21:50:22 +0000 (21:50 -0000)]
When fetch() is called and there is an existing file with the wrong size that
is smaller than PORTAGE_FETCH_RESUME_MIN_SIZE, rename the file instead of
deleting it. This is more friendly for cases in which the user is attempting
to regenerate the digest but has not used `ebuild --force foo.ebuild manifest`
like they're supposed to. Thanks to Patrick Lauer <patrick@g.o> for reporting.

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

15 years agoDon't give portage group write permissions on the mtimedb since it's not
Zac Medico [Sun, 1 Mar 2009 21:06:37 +0000 (21:06 -0000)]
Don't give portage group write permissions on the mtimedb since it's not
really needed.

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

15 years agoThanks to Petteri Räty <betelgeuse@gentoo.org> for this new cache module which
Zac Medico [Sun, 1 Mar 2009 20:39:41 +0000 (20:39 -0000)]
Thanks to Petteri Räty <betelgeuse@gentoo.org> for this new cache module which
uses extended attributes (via pyxattr) to attach metadata cache directly to
the ebuild files themselves.

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

15 years agoRemove redundant long(_mtime_) conversion since template handles it now.
Zac Medico [Sun, 1 Mar 2009 06:29:07 +0000 (06:29 -0000)]
Remove redundant long(_mtime_) conversion since template handles it now.

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

15 years ago* Fix portage.cache.template.database.__getitem__() to validate the _mtime_
Zac Medico [Sun, 1 Mar 2009 06:25:07 +0000 (06:25 -0000)]
* Fix portage.cache.template.database.__getitem__() to validate the _mtime_
  field and raise a CacheCorruption exception if necessary.
* Make _mtime_ and _eclasses_ validation code in portdbapi and mirror_cache()
  assume that these fields are the correct type (otherwise a CacheCorruption
  exeception should be raised earlier).
* Fix the sqlite module to implement _getitem() so that it properly inherits
  __getitem__() _mtime_ and _eclasses_ handling.

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

15 years agoSkip the code from bug #259954 when $ROOT != / since it shouldn't matter if
Zac Medico [Sun, 1 Mar 2009 00:05:41 +0000 (00:05 -0000)]
Skip the code from bug #259954 when $ROOT != / since it shouldn't matter if
there are unsatisfied system runtime deps in this case.

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

15 years agoWhen checking ebuild content, use codecs.open() to force utf_8 encoding for
Zac Medico [Sat, 28 Feb 2009 08:27:56 +0000 (08:27 -0000)]
When checking ebuild content, use codecs.open() to force utf_8 encoding for
py3k compatibility (all ebuilds should have utf_8 encoding).

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

15 years agoIn _ensure_default_encoding(), make sure the default encoding is normalized.
Zac Medico [Sat, 28 Feb 2009 05:43:29 +0000 (05:43 -0000)]
In _ensure_default_encoding(), make sure the default encoding is normalized.

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

15 years agoAdd support to _ensure_default_encoding() for the same ascii and utf_8
Zac Medico [Sat, 28 Feb 2009 05:20:35 +0000 (05:20 -0000)]
Add support to _ensure_default_encoding() for the same ascii and utf_8
aliases that encodings.aliases has.

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

15 years agoMake Atom instances consume less memory by implementing str methods at the
Zac Medico [Sat, 28 Feb 2009 01:06:30 +0000 (01:06 -0000)]
Make Atom instances consume less memory by implementing str methods at the
class level instead of referencing bound str methods.

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

15 years agoUse Popen.communicate() to avoid a potential deadlock.
Zac Medico [Fri, 27 Feb 2009 05:23:37 +0000 (05:23 -0000)]
Use Popen.communicate() to avoid a potential deadlock.

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

15 years agoOpen then temp file in text mode for py3k compatibility.
Zac Medico [Fri, 27 Feb 2009 04:17:14 +0000 (04:17 -0000)]
Open then temp file in text mode for py3k compatibility.

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

15 years agoOpen the temp file in text mode for py3k compatibility.
Zac Medico [Fri, 27 Feb 2009 04:14:22 +0000 (04:14 -0000)]
Open the temp file in text mode for py3k compatibility.

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

15 years agoOpen the temp file in text mode for py3k compatibility.
Zac Medico [Fri, 27 Feb 2009 04:11:03 +0000 (04:11 -0000)]
Open the temp file in text mode for py3k compatibility.

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

15 years agoUse os.fdopen() on file descriptors returned from mkstemp().
Zac Medico [Fri, 27 Feb 2009 04:03:00 +0000 (04:03 -0000)]
Use os.fdopen() on file descriptors returned from mkstemp().

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

15 years agoOpen the temp file in text mode for py3k compatibility.
Zac Medico [Fri, 27 Feb 2009 03:54:57 +0000 (03:54 -0000)]
Open the temp file in text mode for py3k compatibility.

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

15 years agoOpen the temp file in text mode for py3k compatibility.
Zac Medico [Fri, 27 Feb 2009 03:46:40 +0000 (03:46 -0000)]
Open the temp file in text mode for py3k compatibility.

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

15 years agoUse unicode() so that 2to3 handles py3k compatibility.
Zac Medico [Fri, 27 Feb 2009 03:24:13 +0000 (03:24 -0000)]
Use unicode() so that 2to3 handles py3k compatibility.

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

15 years agoFix CommandOutputSet to decode binary command output in py3k.
Zac Medico [Fri, 27 Feb 2009 03:08:03 +0000 (03:08 -0000)]
Fix CommandOutputSet to decode binary command output in py3k.

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

15 years agoFix PipeReader and PipeReaderTestCase to work with binary strings in py3k.
Zac Medico [Fri, 27 Feb 2009 02:43:45 +0000 (02:43 -0000)]
Fix PipeReader and PipeReaderTestCase to work with binary strings in py3k.

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

15 years agoLoosen EMakeParallelDisabled.re so it can match more variations.
Zac Medico [Fri, 27 Feb 2009 01:20:49 +0000 (01:20 -0000)]
Loosen EMakeParallelDisabled.re so it can match more variations.

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

15 years agoAdd a new upstream.workaround check for hardcoded MAKEOPTS=-j1 (previously
Zac Medico [Fri, 27 Feb 2009 01:08:01 +0000 (01:08 -0000)]
Add a new upstream.workaround check for hardcoded MAKEOPTS=-j1 (previously
only emake -j1 was recognized). Thanks to Maciej Mrozowski <reavertm@poczta.fm>
for this patch.

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

15 years agoFix test breakage due to change in calling order of AsynchronousTask start
Zac Medico [Fri, 27 Feb 2009 00:48:30 +0000 (00:48 -0000)]
Fix test breakage due to change in calling order of AsynchronousTask start
listeners from r12713.

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

15 years agoFix a case in which a SRC_URI is incorrectly idendified as invalid, and add
Zac Medico [Fri, 27 Feb 2009 00:03:26 +0000 (00:03 -0000)]
Fix a case in which a SRC_URI is incorrectly idendified as invalid, and add
a corresponding test case. Thanks to Jacob Floyd for reporting.

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

15 years agoRemove recursion code from Scheduler._system_merge_started() since indirect
Zac Medico [Thu, 26 Feb 2009 08:40:41 +0000 (08:40 -0000)]
Remove recursion code from Scheduler._system_merge_started() since indirect
deps are checked when the corresponding parent is merged.

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

15 years agoIn traversing deps to add to Scheduler._unsatisfied_system_deps, only traverse
Zac Medico [Thu, 26 Feb 2009 07:50:49 +0000 (07:50 -0000)]
In traversing deps to add to Scheduler._unsatisfied_system_deps, only traverse
completed 'merge' nodes since those are the only ones that need to be checked
for unsatisfied runtime deps, and it's normal for nodes that aren't yet
complete to have unsatisfied runtime deps.

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

15 years agoBug #259954 - Do not spawn parallel build when the system is in a fragile
Zac Medico [Thu, 26 Feb 2009 04:26:07 +0000 (04:26 -0000)]
Bug #259954 - Do not spawn parallel build when the system is in a fragile
state due to a system package having an unsatisfied runtime dependency
(such as sys-libs/pam having an unsatisfied PDEPEND on sys-auth/pambase).

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

15 years agoreject all set*id binaries that have DT_RPATH:$ORIGIN #260331
Mike Frysinger [Thu, 26 Feb 2009 04:03:10 +0000 (04:03 -0000)]
reject all set*id binaries that have DT_RPATH:$ORIGIN #260331

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

15 years agoRemove stray parenthesis.
Zac Medico [Thu, 26 Feb 2009 01:15:02 +0000 (01:15 -0000)]
Remove stray parenthesis.

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

15 years agoInside depgraph._merge_order_bias(), promote deep system runtime deps toward
Zac Medico [Thu, 26 Feb 2009 00:59:06 +0000 (00:59 -0000)]
Inside depgraph._merge_order_bias(), promote deep system runtime deps toward
the front of the merge list. This should help optimize merge order to account
for implicit system dependencies.

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

15 years agoImplement BlockerDepPriority.__str__().
Zac Medico [Thu, 26 Feb 2009 00:00:59 +0000 (00:00 -0000)]
Implement BlockerDepPriority.__str__().

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

15 years agoFix typo in DepPriority.__str__().
Zac Medico [Wed, 25 Feb 2009 23:50:34 +0000 (23:50 -0000)]
Fix typo in DepPriority.__str__().

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

15 years agoImplement lazy evaluation of USE_EXPAND variables in config.setcpv(), since
Zac Medico [Wed, 25 Feb 2009 20:21:12 +0000 (20:21 -0000)]
Implement lazy evaluation of USE_EXPAND variables in config.setcpv(), since
those variables are only needed when an ebuild shell is spawned. Thanks to
Marat Radchenko <slonopotamusorama@gmail.com> for testing this patch. He
reports a 14% reduction in the time consumed for `emerge -vpe world` on an
ARM device (from 3m12.008s to 2m45.055s).

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

15 years agoIn mirror_cache(), normalize EAPI by mapping EAPI=0 to empty.
Zac Medico [Wed, 25 Feb 2009 07:50:34 +0000 (07:50 -0000)]
In mirror_cache(), normalize EAPI by mapping EAPI=0 to empty.

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

15 years agoBug #259882 - Disable the ignore-previously-merged option by default since
Zac Medico [Tue, 24 Feb 2009 23:16:42 +0000 (23:16 -0000)]
Bug #259882 - Disable the ignore-previously-merged option by default since
emerge's confmem already provides similar functionality which is a little
safer.

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

15 years agoIf deepcopy() raises a TypeError for a lazy item that has been added via a
Zac Medico [Tue, 24 Feb 2009 05:14:37 +0000 (05:14 -0000)]
If deepcopy() raises a TypeError for a lazy item that has been added via a
call to LazyItemsDict.addLazySingleton(), automatically evaluate the
the singleton and instead call deepcopy() on the result.

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

15 years agoMake USE_EXPAND wildcard expansion more efficient, and prevent possible
Zac Medico [Mon, 23 Feb 2009 23:22:08 +0000 (23:22 -0000)]
Make USE_EXPAND wildcard expansion more efficient, and prevent possible
duplicates.

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

15 years agoFix breakage in USE_EXPAND wildcard handling, from r12697.
Zac Medico [Mon, 23 Feb 2009 23:16:16 +0000 (23:16 -0000)]
Fix breakage in USE_EXPAND wildcard handling, from r12697.

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

15 years agoFix headers that contain $Header instead of $Id.
Zac Medico [Mon, 23 Feb 2009 21:05:22 +0000 (21:05 -0000)]
Fix headers that contain $Header instead of $Id.

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

15 years agoIn LazyItemsDict, avoid storing empty lists and dicts when no positional or
Zac Medico [Mon, 23 Feb 2009 20:52:10 +0000 (20:52 -0000)]
In LazyItemsDict, avoid storing empty lists and dicts when no positional or
keyword arguments are given.

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

15 years agoIn config.setcpv(), increase efficiency by filtering USE with IUSE before
Zac Medico [Mon, 23 Feb 2009 18:12:19 +0000 (18:12 -0000)]
In config.setcpv(), increase efficiency by filtering USE with IUSE before
calculating USE_EXPAND variables. Also use a generator expression instead
of a list comprehension in the USE_EXPAND generation code.

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

15 years agoFix getmaskingstatus() so that it doesn't inappropriately return a
Zac Medico [Mon, 23 Feb 2009 17:31:40 +0000 (17:31 -0000)]
Fix getmaskingstatus() so that it doesn't inappropriately return a
'missing keyword' mask is some cases when the user has ** in package.keywords.
Thanks to Raúl Porcel <armin76@g.o> for reporting.

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

15 years agoFix default_encoding logic in _ensure_default_encoding().
Zac Medico [Mon, 23 Feb 2009 16:41:49 +0000 (16:41 -0000)]
Fix default_encoding logic in _ensure_default_encoding().

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

15 years agoReorganize _ensure_default_encoding().
Zac Medico [Mon, 23 Feb 2009 16:31:57 +0000 (16:31 -0000)]
Reorganize _ensure_default_encoding().

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

15 years agoRevert vardbapi._owners_cache_version and unicode handling since it needs
Zac Medico [Mon, 23 Feb 2009 08:35:57 +0000 (08:35 -0000)]
Revert vardbapi._owners_cache_version and unicode handling since it needs
some more work.

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

15 years agoDon't try to call setdefaultencoding() since it's not intended to be called.
Zac Medico [Mon, 23 Feb 2009 08:32:37 +0000 (08:32 -0000)]
Don't try to call setdefaultencoding() since it's not intended to be called.

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

15 years agoWhen displaying reverse dependencies in verbose --depclean/--prune output,
Zac Medico [Mon, 23 Feb 2009 06:51:10 +0000 (06:51 -0000)]
When displaying reverse dependencies in verbose --depclean/--prune output,
sort the parent packages by cpv.

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

15 years agoBump vardbapi._owners_cache_version from 1 to 2 since hash value encoding
Zac Medico [Mon, 23 Feb 2009 03:16:05 +0000 (03:16 -0000)]
Bump vardbapi._owners_cache_version from 1 to 2 since hash value encoding
is now hardcoded as utf_8.

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

15 years agoWhen encoding strings inside vardbapi._counter_hash() and
Zac Medico [Mon, 23 Feb 2009 03:12:49 +0000 (03:12 -0000)]
When encoding strings inside  vardbapi._counter_hash() and
vardbapi._owners_cache._hash_str(), use 'backslashreplace' in order to avoid
potential UnicodeError exceptions. Use constant ascii and utf_8 codecs,
respectively, since these codecs are guaranteed to be available by
_ensure_default_encoding().

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

15 years agoAdd support in _ensure_default_encoding(), add support for utf_8 and fall
Zac Medico [Mon, 23 Feb 2009 03:03:46 +0000 (03:03 -0000)]
Add support in _ensure_default_encoding(), add support for utf_8 and fall
back to utf_8 if the encoding returned by sys.getdefaultencoding() is
unavailable.

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

15 years agoWhen decoding term codes inside the JobStatusDisplay constructor, use the
Zac Medico [Sun, 22 Feb 2009 23:39:03 +0000 (23:39 -0000)]
When decoding term codes inside the JobStatusDisplay constructor, use the
'replace' error handling scheme in order to avoid triggering a potential
UnicodeError.

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

15 years agoIn EbuildFetchonly.execute(), skip builddir creation when the ebuild does
Zac Medico [Sun, 22 Feb 2009 22:24:08 +0000 (22:24 -0000)]
In EbuildFetchonly.execute(), skip builddir creation when the ebuild does
not set RESTRICT=fetch (since it's not possible for pkg_nofetch to be executed
in this case).

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

15 years agoAvoid spurious CCACHE_DIR permissions adjustments when fetching with
Zac Medico [Sun, 22 Feb 2009 21:12:03 +0000 (21:12 -0000)]
Avoid spurious CCACHE_DIR permissions adjustments when fetching with
a temporary PORTAGE_TMPDIR setting (for fetchonly). Thanks to
Marat Radchenko <slonopotamusorama@gmail.com> for reporting.

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

15 years agoThe python that's inside stage 1 or 2 is built with a minimal
Zac Medico [Sun, 22 Feb 2009 09:56:27 +0000 (09:56 -0000)]
The python that's inside stage 1 or 2 is built with a minimal
configuration which does not include the /usr/lib/pythonX.Y/encodings
directory. This results in error like the following:

  LookupError: no codec search functions registered: can't find encoding

In order to solve this problem, detect it early and manually register
a search function for the ascii codec. Starting with python-3.0 this
problem is more noticeable because of stricter handling of encoding
and decoding between strings of characters and bytes.

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

15 years agoUse a lock to ensure that threaded code doesn't cause problems with proxy
Zac Medico [Sun, 22 Feb 2009 06:00:34 +0000 (06:00 -0000)]
Use a lock to ensure that threaded code doesn't cause problems with proxy
registration and unregistration.

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

15 years agoUse lazyimport to avoid importing the portage.elog module when portage is
Zac Medico [Sun, 22 Feb 2009 05:29:46 +0000 (05:29 -0000)]
Use lazyimport to avoid importing the portage.elog module when portage is
initially imported.

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

15 years agoUse lazyimport to avoid importing the dep, output, update, and versions
Zac Medico [Sun, 22 Feb 2009 05:23:34 +0000 (05:23 -0000)]
Use lazyimport to avoid importing the dep, output, update, and versions
modules when portage is initially imported.

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

15 years agoUse lazyimport to avoid importing the checksum, locks, and util modules
Zac Medico [Sun, 22 Feb 2009 04:47:25 +0000 (04:47 -0000)]
Use lazyimport to avoid importing the checksum, locks, and util modules
when portage is initially imported.

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

15 years agoFix _LazyImportFrom to use the correct module name when registering and
Zac Medico [Sun, 22 Feb 2009 03:42:37 +0000 (03:42 -0000)]
Fix _LazyImportFrom to use the correct module name when registering and
unregistering.

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

15 years agoMake lazyimport proxies trigger automatic destruction of other proxies for
Zac Medico [Sun, 22 Feb 2009 03:19:50 +0000 (03:19 -0000)]
Make lazyimport proxies trigger automatic destruction of other proxies for
modules that have been imported. This way, destruction of a single proxy
can trigger destruction of all the rest.

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

15 years agoFix typo in __all__.
Zac Medico [Sun, 22 Feb 2009 02:48:43 +0000 (02:48 -0000)]
Fix typo in __all__.

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

15 years agoReduce bloat in portage.util by splitting ObjectProxy and lazyimport into a
Zac Medico [Sun, 22 Feb 2009 02:46:26 +0000 (02:46 -0000)]
Reduce bloat in portage.util by splitting ObjectProxy and lazyimport into a
new portage.proxy package.

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

15 years agoMake lazy_import() skip proxy creation for modules that already exist
Zac Medico [Sun, 22 Feb 2009 00:33:41 +0000 (00:33 -0000)]
Make lazy_import() skip proxy creation for modules that already exist
in sys.modules.

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

15 years agoMake the UserDict and LazyItemsDict constructors use an optional positional
Zac Medico [Sat, 21 Feb 2009 22:07:51 +0000 (22:07 -0000)]
Make the UserDict and LazyItemsDict constructors use an optional positional
argument instead of a keyword argument.

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

15 years agoIn config.setcpv(), use LazyItemsDict to implement lazy evaluation of
Zac Medico [Sat, 21 Feb 2009 21:51:13 +0000 (21:51 -0000)]
In config.setcpv(), use LazyItemsDict to implement lazy evaluation of
PORTAGE_IUSE. The PORTAGE_IUSE value is lazily evaluated since re.escape()
is slow and the value is only used when an ebuild phase needs to be executed
(it's used only to generate QA notices). Thanks to Marat Radchenko
<slonopotamusorama@gmail.com> for identifying this performance issue and
submitting the initial patch which used a memoization approach instead of
lazy evaluation.

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

15 years agoIn LazyItemsDict, when a singleton is instantiated, replace the wrapper with
Zac Medico [Sat, 21 Feb 2009 19:09:05 +0000 (19:09 -0000)]
In LazyItemsDict, when a singleton is instantiated, replace the wrapper with
the singleton since the wrapper is no longer needed at this point.

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

15 years agoRevert r12639 and use string.ascii_letters for python-3.0 compatibility.
Zac Medico [Sat, 21 Feb 2009 02:50:07 +0000 (02:50 -0000)]
Revert r12639 and use string.ascii_letters for python-3.0 compatibility.

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

15 years agoInside portage.spawn(), open files for logfile handling in binary mode, for
Zac Medico [Sat, 21 Feb 2009 02:44:24 +0000 (02:44 -0000)]
Inside portage.spawn(), open files for logfile handling in binary mode, for
compatibility with python-3.0.

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

15 years agoInside summarylist(), it's possible for myglsa.packages.keys() to contain
Zac Medico [Sat, 21 Feb 2009 01:55:27 +0000 (01:55 -0000)]
Inside summarylist(), it's possible for myglsa.packages.keys() to contain
unicode objects, which trigger and exception like this:

   File "//usr/lib64/portage/pym/portage/dep.py", line 535, in __init__
    obj_setattr(self, x, getattr(s, x))
   AttributeError: 'unicode' object has no attribute '__eq__'

To solve this problem, convert unicode objects to plain str before passing
them to the portage api.

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

15 years agoFor python-3.0 compatibility, open files in binary mode inside
Zac Medico [Sat, 21 Feb 2009 00:18:45 +0000 (00:18 -0000)]
For python-3.0 compatibility, open files in binary mode inside
SpawnProcess._start().

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

15 years agoWhen loading vdb_metadata.pickle inside vardbapi._aux_cache_init(), in
Zac Medico [Fri, 20 Feb 2009 23:37:13 +0000 (23:37 -0000)]
When loading vdb_metadata.pickle inside vardbapi._aux_cache_init(), in
order to avoid an extreme performance issue, disable buffering when opening
the file under python-3.0. Unfortunately, performance is still poor relative
to python-2.x, but buffering makes it much worse.

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

15 years agoAdd a cross reference from FEATURES=lmirror docs to the "local" mirror docs
Zac Medico [Fri, 20 Feb 2009 21:19:40 +0000 (21:19 -0000)]
Add a cross reference from FEATURES=lmirror docs to the "local" mirror docs
in portage(5).

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

15 years agoIn python-3.0, integer division results in a float, so convert back to int.
Zac Medico [Fri, 20 Feb 2009 08:10:38 +0000 (08:10 -0000)]
In python-3.0, integer division results in a float, so convert back to int.

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

15 years agoFix StringIO imports so that 2to3 can handle them. Also, replace shlex +
Zac Medico [Fri, 20 Feb 2009 07:16:16 +0000 (07:16 -0000)]
Fix StringIO imports so that 2to3 can handle them. Also, replace shlex +
StringIO usage with shlex.split() where appropriate.

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

15 years agoAdd a new portage.utils.lazy_import() function which behaves similar to the
Zac Medico [Fri, 20 Feb 2009 06:15:34 +0000 (06:15 -0000)]
Add a new portage.utils.lazy_import() function which behaves similar to the
snakeoil.demandload.demandload() function.

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

15 years agoTry to fix svn:keywords again.
Zac Medico [Fri, 20 Feb 2009 03:00:19 +0000 (03:00 -0000)]
Try to fix svn:keywords again.

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

15 years agoTry to fix svn:keywords again.
Zac Medico [Fri, 20 Feb 2009 02:56:07 +0000 (02:56 -0000)]
Try to fix svn:keywords again.

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

15 years agoAdd back Rev to svn:keywords (accidentally removed when setting Id). Thanks
Zac Medico [Thu, 19 Feb 2009 22:51:40 +0000 (22:51 -0000)]
Add back Rev to svn:keywords (accidentally removed when setting Id). Thanks
to ABCD for reporting.

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

15 years agoWhen displaying the list of failed packages, tell the number that failed.
Zac Medico [Thu, 19 Feb 2009 21:45:01 +0000 (21:45 -0000)]
When displaying the list of failed packages, tell the number that failed.
Thanks to Jeremy Olexa <darkside@g.o> for the suggestion.

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

15 years agoMake isvalidatom() identify empty slot as invalid (missing slot is valid) and
Zac Medico [Thu, 19 Feb 2009 19:19:18 +0000 (19:19 -0000)]
Make isvalidatom() identify empty slot as invalid (missing slot is valid) and
add a corresponding test case.

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

15 years agoOptimize depgraph._dep_expand() to avoid calling pordbapi.cp_all(),
Zac Medico [Thu, 19 Feb 2009 19:01:26 +0000 (19:01 -0000)]
Optimize depgraph._dep_expand() to avoid calling pordbapi.cp_all(),
since it can be more efficient to call cp_list() on each category.
Thanks to Marat Radchenko <slonopotamusorama@gmail.com> for the
suggestion.

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

15 years agoDecode terminal codes from binary when necessary, for python-3.0 compatibility
Zac Medico [Thu, 19 Feb 2009 12:42:42 +0000 (12:42 -0000)]
Decode terminal codes from binary when necessary, for python-3.0 compatibility
since sys.stdout is a text stream.

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

15 years agoHandle ValueError when unpickling, since this can be triggered by an
Zac Medico [Thu, 19 Feb 2009 12:36:51 +0000 (12:36 -0000)]
Handle ValueError when unpickling, since this can be triggered by an
unsupported pickle protocol.

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

15 years agoFix update() methods to work with python-3.0.
Zac Medico [Thu, 19 Feb 2009 12:27:28 +0000 (12:27 -0000)]
Fix update() methods to work with python-3.0.

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

15 years agoTweak exception handling indentation to avoid a bug in 2to3.
Zac Medico [Thu, 19 Feb 2009 11:48:09 +0000 (11:48 -0000)]
Tweak exception handling indentation to avoid a bug in 2to3.

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

15 years agoFor python-3.0 compatibility, encode strings as binary before trying to pass
Zac Medico [Thu, 19 Feb 2009 11:41:48 +0000 (11:41 -0000)]
For python-3.0 compatibility, encode strings as binary before trying to pass
them to hashlib.

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

15 years agoTweak code to avoid python-3.0 errors like this one:
Zac Medico [Thu, 19 Feb 2009 11:36:57 +0000 (11:36 -0000)]
Tweak code to avoid python-3.0 errors like this one:
SyntaxError: can not delete variable 'e' referenced in nested scope

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

15 years agoRevert accidental python-3.0 syntax.
Zac Medico [Thu, 19 Feb 2009 10:28:58 +0000 (10:28 -0000)]
Revert accidental python-3.0 syntax.

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

15 years agoFor compatibility with python-3.0, open files in text mode where appropriate.
Zac Medico [Thu, 19 Feb 2009 10:24:06 +0000 (10:24 -0000)]
For compatibility with python-3.0, open files in text mode where appropriate.

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

15 years agoFor compatibility with python-3.0, always open streams for pickles in binary
Zac Medico [Thu, 19 Feb 2009 10:14:13 +0000 (10:14 -0000)]
For compatibility with python-3.0, always open streams for pickles in binary
mode.

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