Merged from trunk 4812:4815
authorFabian Groffen <grobian@gentoo.org>
Wed, 25 Oct 2006 17:40:43 +0000 (17:40 -0000)
committerFabian Groffen <grobian@gentoo.org>
Wed, 25 Oct 2006 17:40:43 +0000 (17:40 -0000)
Remove ACCEPT_LICENSE docs until they're really implemented.

Improve reconstruct_eclasses error handling.

For the time being, write a variation of the old _eclass_ format so that
cache written only forces a regen for older versions of portage rather
than a ValueError due to failed long() conversion.

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

man/make.conf.5
man/portage.5
pym/cache/template.py

index dc382fd64a942bd80b7b94598a4cc732236f5438..eb04a85332a6a95a6f937bc26aaa411b9b83a336 100644 (file)
@@ -29,12 +29,6 @@ set this to '~ppc'.  This is an incremental variable.  Only define a
 .br
 Defaults to the value of $ARCH.
 .TP
-\fBACCEPT_LICENSE\fR = \fI[space delimited list of licenses]\fR
-Specify acceptable licenses for installed packages.  Any packages with
-unaccepted licenses will be masked.  The default value is "*", which means to
-accept all licenses.  Licenses can be accepted for individual packages via the
-package.license file.  See \fBportage\fR(5) for more information.
-.TP
 \fBBUILD_PREFIX\fR = \fI[path]\fR
 Defines the location of the package working directory. 
 .br
index 74ae5335d5522bb7c977f58b5bce9f6201158884..cfe71a67289bc84bc6de614d79fdef20bb5fd1a6 100644 (file)
@@ -43,7 +43,6 @@ virtuals
 bashrc
 modules
 package.keywords
-package.license
 package.mask
 package.unmask
 package.use
@@ -411,25 +410,6 @@ package.keywords like this:
 
 games-fps/quake3-demo -*
 .TP
-.BR package.license
-Per\-package acceptance of licenses.  This is useful if a license needs to be
-accepted for a single package but should not be accepted for any package.  See
-\fIACCEPT_LICENSE\fR in \fBmake.conf\fR(5) for global license acceptance.
-
-.I Format:
-.nf
-\- comments begin with #
-\- one DEPEND atom per line followed by additional licenses
-.fi
-
-.I Example:
-.nf
-# accept the zlib license just for the zlib package
-sys-libs/zlib ZLIB
-# accept any license for mplayer
-media\-video/mplayer *
-.fi
-.TP
 .BR package.mask
 A list of package atoms to mask.  Useful if specific versions of packages do
 not work well for you.  For example, you swear by the Nvidia drivers, but only
index 0e2a5f36829d9bb2dd5b385ca3c32e0596712783..d68138f89b7f206e76383b1346761d8783a9a068 100644 (file)
@@ -151,8 +151,18 @@ class database(object):
 
 def serialize_eclasses(eclass_dict):
        """takes a dict, returns a string representing said dict"""
+       """The "new format", which causes older versions of <portage-2.1.2 to
+       traceback with a ValueError due to failed long() conversion.  This format
+       isn't currently written, but the the capability to read it is already built
+       in.
        return "\t".join(["%s\t%s" % (k, str(v)) \
                for k, v in eclass_dict.iteritems()])
+       """
+       """ This is a variation of the old format that uses a relative path instead
+       of the full path of the eclass.  It should only force a regen in older
+       versions of portage (rather than a traceback)."""
+       return "\t".join(["%s\teclass\t%s" % (k, str(v)) \
+               for k, v in eclass_dict.iteritems()])
 
 def reconstruct_eclasses(cpv, eclass_string):
        """returns a dict when handed a string generated by serialize_eclasses"""
@@ -164,16 +174,15 @@ def reconstruct_eclasses(cpv, eclass_string):
        if len(eclasses) % 2 != 0 and len(eclasses) % 3 != 0:
                raise cache_errors.CacheCorruption(cpv, "_eclasses_ was of invalid len %i" % len(eclasses))
        d={}
-       has_paths = False
        try:
-               long(eclasses[1])
+               if eclasses[1].isdigit():
+                       for x in xrange(0, len(eclasses), 2):
+                               d[eclasses[x]] = long(eclasses[x + 1])
+               else:
+                       # The old format contains paths that will be discarded.
+                       for x in xrange(0, len(eclasses), 3):
+                               d[eclasses[x]] = long(eclasses[x + 2])
        except ValueError:
-               has_paths = True
-       if has_paths:
-               for x in range(0, len(eclasses), 3):
-                       d[eclasses[x]] = long(eclasses[x + 2])
-       else:
-               for x in range(0, len(eclasses), 2):
-                       d[eclasses[x]] = long(eclasses[x + 1])
+               raise cache_errors.CacheCorruption(cpv, "_eclasses_ mtime conversion to long failed")
        del eclasses
        return d