Merged from trunk -r15770:15780
authorFabian Groffen <grobian@gentoo.org>
Tue, 9 Mar 2010 11:27:52 +0000 (11:27 -0000)
committerFabian Groffen <grobian@gentoo.org>
Tue, 9 Mar 2010 11:27:52 +0000 (11:27 -0000)
   | 15771   | Add copyright header.                                        |
   | zmedico |                                                              |

   | 15775   | Escape hyphens.                                              |
   | zmedico |                                                              |

   | 15776   | Clean up/sync docs for emerge --sync, and add a note about   |
   | zmedico | PORTAGE_SYNC_STALE.                                          |

   | 15777   | Move --update from the actions to the options section.       |
   | zmedico |                                                              |

   | 15778   | When portage upgrades or downgrades itself, preload lazily   |
   | zmedico | referenced portage submodules into memory so that imports    |
   |         | won't fail later.                                            |

svn path=/main/branches/prefix/; revision=15798

man/emerge.1
pym/_emerge/help.py
pym/_emerge/sync/__init__.py
pym/portage/dbapi/vartree.py
pym/portage/proxy/lazyimport.py

index c16bfac1c29e0174eab9f54dbd2810b1759d9a16..b93d0b08f5d12c7744a0f4be5f6673f2cc5a10e3 100644 (file)
@@ -202,7 +202,7 @@ For example, \fBemerge \-\-search "%^kde"\fR searches for any package whose
 name starts with "kde"; \fBemerge \-\-search "%gcc$"\fR searches for any 
 package that ends with "gcc"; \fBemerge \-\-search "office"\fR searches for 
 any package that contains the word "office".  If you want to include the 
-category into the search string, prepend an @: \fBemerge --search 
+category into the search string, prepend an @: \fBemerge \-\-search 
 "%@^dev-java.*jdk"\fR. If you want to search the package descriptions as well, 
 use the \fB\-\-searchdesc\fR action.
 .TP
@@ -212,11 +212,26 @@ the package name.  \fBTake caution\fR as the descriptions are also
 matched as regular expressions.
 .TP
 .BR \-\-sync
-Initiates a portage tree update with one of the rsync.gentoo.org
-mirrors.  \fBNote that any changes you have made to the portage
-tree will be erased\fR.  Except for special circumstances, 
-this uses \fBrsync\fR to do the update.  See \fBmake.conf\fR(5)'s 
-description of PORTDIR_OVERLAY for a method to avoid deletions.
+This updates the portage tree that is located in the
+directory that the PORTDIR variable refers to (default
+location is /usr/portage). The SYNC variable specifies
+the remote URI from which files will be synchronized.
+The \fBPORTAGE_SYNC_STALE\fR variable configures
+warnings that are shown when emerge \-\-sync has not
+been executed recently.
+
+\fBWARNING:\fR
+The emerge \-\-sync action will modify and/or delete
+files located inside the directory that the PORTDIR
+variable refers to (default location is /usr/portage).
+For more information, see the PORTDIR documentation in
+the make.conf(5) man page.
+
+\fBNOTE:\fR
+The \fBemerge\-webrsync\fR program will download the entire
+portage tree as a tarball, which is much faster than emerge
+\-\-sync for first time syncs.
+
 .TP
 .BR "\-\-unmerge " (\fB\-C\fR)
 \fBWARNING: This action can remove important packages!\fR Removes
@@ -226,13 +241,6 @@ system.  Its arguments can be \fIatoms\fR or
 \fIebuilds\fR. For a dependency aware version of \fB\-\-unmerge\fR,
 use \fB\-\-depclean\fR or \fB\-\-prune\fR.
 .TP
-.BR "\-\-update " (\fB\-u\fR)
-Updates packages to the best version available, which may not always be the 
-highest version number due to masking for testing and development.
-Package atoms
-specified on the command line are greedy, meaning that unspecific atoms may
-match multiple installed versions of slotted packages.
-.TP
 .BR "\-\-version " (\fB\-V\fR)
 Displays the version number of \fBemerge\fR.
 .SH "OPTIONS"
@@ -543,6 +551,13 @@ order in which the packages will be merged. When
 constraint is removed, hopefully leading to a more
 readable dependency tree.
 .TP
+.BR "\-\-update " (\fB\-u\fR)
+Updates packages to the best version available, which may
+not always be the  highest version number due to masking
+for testing and development. Package atoms specified on
+the command line are greedy, meaning that unspecific
+atoms may match multiple versions of slotted packages.
+.TP
 .BR "\-\-use\-ebuild\-visibility[=n]"
 Use unbuilt ebuild metadata for visibility
 checks on built packages.
index 1dfb63a47bd919a853ee8a1a70c32c04c93322f1..409bbe2909ff351bf9a4c6a689ae3a9950dd0970 100644 (file)
@@ -198,18 +198,31 @@ def help(myopts, havecolor=1):
                print("                emerge -S 'perl.*module'")
                print()
                print("       "+green("--sync"))
-               print("              Tells emerge to update the Portage tree as specified in")
-               print("              The SYNC variable found in /etc/make.conf.  By default, SYNC instructs")
-               print("              emerge to perform an rsync-style update with rsync.gentoo.org.")
+               desc = "This updates the portage tree that is located in the " + \
+                       "directory that the PORTDIR variable refers to (default " + \
+                       "location is /usr/portage). The SYNC variable specifies " + \
+                       "the remote URI from which files will be synchronized. " + \
+                       "The PORTAGE_SYNC_STALE variable configures " + \
+                       "warnings that are shown when emerge --sync has not " + \
+                       "been executed recently."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
                print()
-               print("              'emerge-webrsync' exists as a helper app to emerge --sync, providing a")
-               print("              method to receive the entire portage tree as a tarball that can be")
-               print("              extracted and used. First time syncs would benefit greatly from this.")
+               print(desc_indent + turquoise("WARNING:"))
+               desc = "The emerge --sync action will modify and/or delete " + \
+                       "files located inside the directory that the PORTDIR " + \
+                       "variable refers to (default location is /usr/portage). " + \
+                       "For more information, see the PORTDIR documentation in " + \
+                       "the make.conf(5) man page."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
                print()
-               print("              "+turquoise("WARNING:"))
-               print("              If using our rsync server, emerge will clean out all files that do not")
-               print("              exist on it, including ones that you may have created. The exceptions")
-               print("              to this are the distfiles, local and packages directories.")
+               print(desc_indent + green("NOTE:"))
+               desc = "The emerge-webrsync program will download the entire " + \
+                       "portage tree as a tarball, which is much faster than emerge " + \
+                       "--sync for first time syncs."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
                print()
                print("       "+green("--unmerge")+" ("+green("-C")+" short option)")
                print("              "+turquoise("WARNING: This action can remove important packages!"))
@@ -219,13 +232,6 @@ def help(myopts, havecolor=1):
                print("              ebuilds. For a dependency aware version of --unmerge, use")
                print("              --depclean or --prune.")
                print()
-               print("       "+green("--update")+" ("+green("-u")+" short option)")
-               print("              Updates packages to the best version available, which may not")
-               print("              always be the highest version number due to masking for testing")
-               print("              and development. Package atoms specified on the command")
-               print("              line are greedy, meaning that unspecific atoms may match multiple")
-               print("              installed versions of slotted packages.")
-               print()
                print("       "+green("--version")+" ("+green("-V")+" short option)")
                print("              Displays the currently installed version of portage along with")
                print("              other information useful for quick reference on a system. See")
@@ -594,6 +600,15 @@ def help(myopts, havecolor=1):
                for line in wrap(desc, desc_width):
                        print(desc_indent + line)
                print()
+               print("       "+green("--update")+" ("+green("-u")+" short option)")
+               desc = "Updates packages to the best version available, which may " + \
+                       "not always be the  highest version number due to masking " + \
+                       "for testing and development. Package atoms specified on " + \
+                       "the command line are greedy, meaning that unspecific " + \
+                       "atoms may match multiple versions of slotted packages."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
+               print()
                print("       " + green("--use-ebuild-visibility") + "[=%s]" % turquoise("n"))
                desc = "Use unbuilt ebuild metadata for visibility " + \
                        "checks on built packages."
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c802d70cc69b64b803962a02b3286ce5a8292de6 100644 (file)
@@ -0,0 +1,3 @@
+# Copyright 2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
index f250f174aec8df17b70c9f31c6f2d21afe1231bc..bf7ccd807f3f09c481069e8a9503bc872bfe07d8 100644 (file)
@@ -5345,6 +5345,9 @@ class dblink(object):
                if self.myroot == "/" and \
                        match_from_list(PORTAGE_PACKAGE_ATOM, [self.mycpv]) and \
                        not self.vartree.dbapi.cpv_exists(self.mycpv):
+                       # Load lazily referenced portage submodules into memory,
+                       # so imports won't fail during portage upgrade/downgrade.
+                       portage.proxy.lazyimport._preload_portage_submodules()
                        settings = self.settings
                        base_path_orig = os.path.dirname(settings["PORTAGE_BIN_PATH"])
                        from tempfile import mkdtemp
index c62f9078895e24c599e8f851ae828436f877ea85..84b2c730b0f25831c9232bfb0a6156302c68d0a2 100644 (file)
@@ -20,6 +20,24 @@ if sys.hexversion >= 0x3000000:
 _module_proxies = {}
 _module_proxies_lock = threading.RLock()
 
+def _preload_portage_submodules():
+       """
+       Load lazily referenced portage submodules into memory,
+       so imports won't fail during portage upgrade/downgrade.
+       Note that this recursively loads only the modules that
+       are lazily referenced by currently imported modules,
+       so some portage submodules may still remain unimported
+       after this function is called.
+       """
+       while True:
+               remaining = False
+               for name in list(_module_proxies):
+                       if name.startswith('portage.'):
+                               remaining = True
+                               _unregister_module_proxy(name)
+               if not remaining:
+                       break
+
 def _register_module_proxy(name, proxy):
        _module_proxies_lock.acquire()
        try: