Remove old binhost protocol for bug #438640.
authorZac Medico <zmedico@gentoo.org>
Thu, 18 Oct 2012 05:34:17 +0000 (22:34 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 18 Oct 2012 05:34:17 +0000 (22:34 -0700)
The old protocol has been deprecated since portage-2.1.6 (2009), so it
should be completely irrelevant now.

cnf/make.globals
man/make.conf.5
pym/portage/dbapi/bintree.py
pym/portage/getbinpkg.py
pym/portage/package/ebuild/_config/special_env_vars.py

index bc69abe1287d5676d074a36e15195523535d6ca8..e53f1867f1d13203853556656ee3686c11f4b80f 100644 (file)
@@ -66,9 +66,6 @@ FEATURES="assume-digests binpkg-logs
 COLLISION_IGNORE="/lib/modules/* *.py[co]"
 UNINSTALL_IGNORE="/lib/modules/*"
 
-# Default chunksize for binhost comms
-PORTAGE_BINHOST_CHUNKSIZE="3000"
-
 # By default wait 5 secs before cleaning a package
 CLEAN_DELAY="5"
 
index 0f5bd54de3795f311362b9d783f0423ca03ea7ef..4c86d38e66be72b160000f704b932acba37cc073 100644 (file)
@@ -663,14 +663,10 @@ unless \fBclean\-logs\fR is enabled in \fBFEATURES\fR.
 \fBPORTAGE_BINHOST\fR = \fI[space delimited URI list]\fR
 This is a list of hosts from which portage will grab prebuilt\-binary packages.
 Each entry in the list must specify the full address of a directory
-serving tbz2's for your system. This is only used when running with
+serving tbz2's for your system (this directory must contain a 'Packages' index
+file). This is only used when running with
 the get binary pkg options are given to \fBemerge\fR.  Review \fBemerge\fR(1) 
-for more information.  For versions of portage less that 2.1.6, this variable
-should point to the 'All' directory on the host that creates the binary
-packages and not to the root of the \fBPKGDIR\fR.  Starting with portage 2.1.6,
-it should point to a directory containing a 'Packages' index file.  If
-${PORTAGE_BINHOST}/Packages does not exist then portage will attempt to use
-the older protocol.
+for more information.
 .TP
 \fBPORTAGE_BINHOST_HEADER_URI\fR = \fI"ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon\-xp/"\fR
 This variable only makes sense on a system that will serve as a binhost and
index f90a4936f27ed4bfc9ba35e01f1c1a1947ac56dd..0cc46268c7521a091954f16a0773c52cfbc2be01 100644 (file)
@@ -1019,75 +1019,7 @@ class binarytree(object):
                                        # Local package instances override remote instances.
                                        for cpv in metadata:
                                                self._remotepkgs.pop(cpv, None)
-                               continue
-                       try:
-                               chunk_size = long(self.settings["PORTAGE_BINHOST_CHUNKSIZE"])
-                               if chunk_size < 8:
-                                       chunk_size = 8
-                       except (ValueError, KeyError):
-                               chunk_size = 3000
-                       writemsg_stdout("\n")
-                       writemsg_stdout(
-                               colorize("GOOD", _("Fetching bininfo from ")) + \
-                               _hide_url_passwd(base_url) + "\n")
-                       remotepkgs = portage.getbinpkg.dir_get_metadata(
-                               base_url, chunk_size=chunk_size)
-
-                       for mypkg, remote_metadata in remotepkgs.items():
-                               mycat = remote_metadata.get("CATEGORY")
-                               if mycat is None:
-                                       #old-style or corrupt package
-                                       writemsg(_("!!! Invalid remote binary package: %s\n") % mypkg,
-                                               noiselevel=-1)
-                                       continue
-                               mycat = mycat.strip()
-                               try:
-                                       fullpkg = _pkg_str(mycat+"/"+mypkg[:-5])
-                               except InvalidData:
-                                       writemsg(_("!!! Invalid remote binary package: %s\n") % mypkg,
-                                               noiselevel=-1)
-                                       continue
-
-                               if fullpkg in metadata:
-                                       # When using this old protocol, comparison with the remote
-                                       # package isn't supported, so the local package is always
-                                       # preferred even if getbinpkgsonly is enabled.
-                                       continue
-
-                               if not self.dbapi._category_re.match(mycat):
-                                       writemsg(_("!!! Remote binary package has an " \
-                                               "unrecognized category: '%s'\n") % fullpkg,
-                                               noiselevel=-1)
-                                       writemsg(_("!!! '%s' has a category that is not" \
-                                               " listed in %setc/portage/categories\n") % \
-                                               (fullpkg, self.settings["PORTAGE_CONFIGROOT"]),
-                                               noiselevel=-1)
-                                       continue
-                               mykey = portage.cpv_getkey(fullpkg)
-                               try:
-                                       # invalid tbz2's can hurt things.
-                                       self.dbapi.cpv_inject(fullpkg)
-                                       for k, v in remote_metadata.items():
-                                               remote_metadata[k] = v.strip()
-                                       remote_metadata["BASE_URI"] = base_url
-
-                                       # Eliminate metadata values with names that digestCheck
-                                       # uses, since they are not valid when using the old
-                                       # protocol. Typically this is needed for SIZE metadata
-                                       # which corresponds to the size of the unpacked files
-                                       # rather than the binpkg file size, triggering digest
-                                       # verification failures as reported in bug #303211.
-                                       remote_metadata.pop('SIZE', None)
-                                       for k in portage.checksum.hashfunc_map:
-                                               remote_metadata.pop(k, None)
-
-                                       self._remotepkgs[fullpkg] = remote_metadata
-                               except SystemExit as e:
-                                       raise
-                               except:
-                                       writemsg(_("!!! Failed to inject remote binary package: %s\n") % fullpkg,
-                                               noiselevel=-1)
-                                       continue
+
                self.populated=1
 
        def inject(self, cpv, filename=None):
index 538f8c23c08a6f2ef78a6d12c0f52e7c27b5a787..28b18a00f5b89b84de967e2b23db86aabf06ded5 100644 (file)
@@ -18,6 +18,7 @@ import socket
 import time
 import tempfile
 import base64
+import warnings
 
 _all_errors = [NotImplementedError, ValueError, socket.error]
 
@@ -65,6 +66,10 @@ if sys.hexversion >= 0x3000000:
        long = int
 
 def make_metadata_dict(data):
+
+       warnings.warn("portage.getbinpkg.make_metadata_dict() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        myid,myglob = data
        
        mydict = {}
@@ -84,6 +89,10 @@ class ParseLinks(html_parser_HTMLParser):
        """Parser class that overrides HTMLParser to grab all anchors from an html
        page and provide suffix and prefix limitors"""
        def __init__(self):
+
+               warnings.warn("portage.getbinpkg.ParseLinks is deprecated",
+                       DeprecationWarning, stacklevel=2)
+
                self.PL_anchors = []
                html_parser_HTMLParser.__init__(self)
 
@@ -122,6 +131,9 @@ def create_conn(baseurl,conn=None):
        optional connection. If connection is already active, it is passed on.
        baseurl is reduced to address and is returned in tuple (conn,address)"""
 
+       warnings.warn("portage.getbinpkg.create_conn() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        parts = baseurl.split("://",1)
        if len(parts) != 2:
                raise ValueError(_("Provided URI does not "
@@ -221,6 +233,10 @@ def create_conn(baseurl,conn=None):
 def make_ftp_request(conn, address, rest=None, dest=None):
        """(conn,address,rest) --- uses the conn object to request the data
        from address and issuing a rest if it is passed."""
+
+       warnings.warn("portage.getbinpkg.make_ftp_request() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        try:
        
                if dest:
@@ -270,6 +286,9 @@ def make_http_request(conn, address, params={}, headers={}, dest=None):
        the data from address, performing Location forwarding and using the
        optional params and headers."""
 
+       warnings.warn("portage.getbinpkg.make_http_request() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        rc = 0
        response = None
        while (rc == 0) or (rc == 301) or (rc == 302):
@@ -312,6 +331,10 @@ def make_http_request(conn, address, params={}, headers={}, dest=None):
 
 
 def match_in_array(array, prefix="", suffix="", match_both=1, allow_overlap=0):
+
+       warnings.warn("portage.getbinpkg.match_in_array() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        myarray = []
        
        if not (prefix and suffix):
@@ -352,6 +375,9 @@ def dir_get_list(baseurl,conn=None):
        URI should be in the form <proto>://<site>[:port]<path>
        Connection is used for persistent connection instances."""
 
+       warnings.warn("portage.getbinpkg.dir_get_list() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        if not conn:
                keepconnection = 0
        else:
@@ -400,6 +426,9 @@ def file_get_metadata(baseurl,conn=None, chunk_size=3000):
        URI should be in the form <proto>://<site>[:port]<path>
        Connection is used for persistent connection instances."""
 
+       warnings.warn("portage.getbinpkg.file_get_metadata() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        if not conn:
                keepconnection = 0
        else:
@@ -451,6 +480,10 @@ def file_get(baseurl,dest,conn=None,fcmd=None,filename=None):
        URI should be in the form <proto>://[user[:pass]@]<site>[:port]<path>"""
 
        if not fcmd:
+
+               warnings.warn("Use of portage.getbinpkg.file_get() without the fcmd "
+                       "parameter is deprecated", DeprecationWarning, stacklevel=2)
+
                return file_get_lib(baseurl,dest,conn)
        if not filename:
                filename = os.path.basename(baseurl)
@@ -483,6 +516,9 @@ def file_get_lib(baseurl,dest,conn=None):
        URI should be in the form <proto>://<site>[:port]<path>
        Connection is used for persistent connection instances."""
 
+       warnings.warn("portage.getbinpkg.file_get_lib() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        if not conn:
                keepconnection = 0
        else:
@@ -526,6 +562,10 @@ def file_get_lib(baseurl,dest,conn=None):
 def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache=1, makepickle=None):
        """(baseurl,conn,chunk_size,verbose) -- 
        """
+
+       warnings.warn("portage.getbinpkg.dir_get_metadata() is deprecated",
+               DeprecationWarning, stacklevel=2)
+
        if not conn:
                keepconnection = 0
        else:
index a3a95404b35370f36d72a0d23cff3fcff16cbed9..3ca9687ece4db39ed80b04b81d77d3f77f4e3366 100644 (file)
@@ -151,7 +151,7 @@ environ_filter += [
        "GENTOO_MIRRORS", "NOCONFMEM", "O",
        "PORTAGE_BACKGROUND", "PORTAGE_BACKGROUND_UNMERGE",
        "PORTAGE_BINHOST",
-       "PORTAGE_BINHOST_CHUNKSIZE", "PORTAGE_BUILDIR_LOCKED",
+       "PORTAGE_BUILDIR_LOCKED",
        "PORTAGE_CHECKSUM_FILTER",
        "PORTAGE_ELOG_CLASSES",
        "PORTAGE_ELOG_MAILFROM", "PORTAGE_ELOG_MAILSUBJECT",