Add some ACCEPT_LICENSE docs.
Put the package.keywords docs in alphabetical order with the others.
Add some package.license docs.
Add news about ACCEPT_LICENSE and package.license.
Make config.load_infodir also load the data into the env layer in order
to ensure that it has preference over what may have been there.
Don't limit the size of USE in config.load_infodir.
Add package.license to the list of files.
Don't put -* in the env layer, since that layer isn't part of the
incremental stacking in regenerate.
In getmaskingstatus(), add missing check for * in acceptable_licenses.
Don't display the "Please update portage" message in --quiet mode.
Thanks to solar.
Remove paths from _eclasses_ serialization in the cache. This makes the
mtimes of the eclasses the only thing that distinguishes them, but the
probablility of collision is negligible. This same _eclasses_ format
will be used to serialize eclass mtimes in cache that is distributed via
the rsync mirrors. The deserialization code can handle mixtures of both
the old and new formats.
Enable recognition of _mtime_ that doesn't rely on cache mtime mangling.
Add ACCEPT_LICENSE back to incrementals so that profiles can affect it.
Disable ACCEPT_LICENSE support until the details of license groups are
decided and implemented.
svn path=/main/branches/prefix/; revision=4812
portage-2.1.2
------------
+* ACCEPT_LICENSE and package.license allow packages with unaccepted licenses to
+ be masked.
* Ebuilds support default USE flags via +flag in IUSE.
* New-style virtuals are now usable for packages that depend on themselves for
bootstrap.
else:
myversion = "%s-%s" % (mysplit[1], mysplit[2])
- if myversion != portage.VERSION :
+ if myversion != portage.VERSION and "--quiet" not in self.myopts:
if "--emptytree" in self.myopts:
p.append(colorize("WARN", "***")+" Please update portage to the above version before proceeding.")
p.append(" Failure to do so may result in failed or improper merges.")
.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
.nf
bashrc
modules
+package.keywords
+package.license
package.mask
package.unmask
-package.keywords
package.use
mirrors
categories
the user would like to modify eclasses, it is safe to use metadata_overlay
together with PORTDIR_OVERLAY in \fBmake.conf\fR.
.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
-versions earlier than 1.0.4496. No problem!
-
-.I Format:
-.nf
-\- comments begin with #
-\- one DEPEND atom per line
-.fi
-
-.I Example:
-.nf
-# mask out versions 1.0.4496 of the nvidia
-# drivers and later
->=media\-video/nvidia\-kernel\-1.0.4496
->=media\-video/nvidia\-glx\-1.0.4496
-.fi
-.TP
-.BR package.unmask
-Just like package.mask above, except here you list packages you want to
-unmask. Useful for overriding the global package.mask file (see
-below). Note that this does not override packages that are masked via
-KEYWORDS.
-.TP
.BR package.keywords
Per\-package KEYWORDS. Useful for mixing unstable packages in with a normally
-stable machine or vice versa. This will allow you to augment ACCEPT_KEYWORDS
+stable system or vice versa. This will allow ACCEPT_KEYWORDS to be augmented
for a single package.
.nf
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
+versions earlier than 1.0.4496. No problem!
+
+.I Format:
+.nf
+\- comments begin with #
+\- one DEPEND atom per line
+.fi
+
+.I Example:
+.nf
+# mask out versions 1.0.4496 of the nvidia
+# drivers and later
+>=media\-video/nvidia\-kernel\-1.0.4496
+>=media\-video/nvidia\-glx\-1.0.4496
+.fi
+.TP
+.BR package.unmask
+Just like package.mask above, except here you list packages you want to
+unmask. Useful for overriding the global package.mask file (see
+below). Note that this does not override packages that are masked via
+KEYWORDS.
+.TP
.BR package.use
Per\-package USE flags. Useful for tracking local USE flags or for
enabling USE flags for certain packages only. Perhaps you develop GTK
myf = open(fp, "r")
try:
d = self._parse_data(myf, cpv)
- d["_mtime_"] = long(os.fstat(myf.fileno()).st_mtime)
+ if "_mtime_" not in d:
+ """Backward compatibility with old cache that uses mtime
+ mangling."""
+ d["_mtime_"] = long(os.fstat(myf.fileno()).st_mtime)
return d
finally:
myf.close()
def serialize_eclasses(eclass_dict):
"""takes a dict, returns a string representing said dict"""
- return "\t".join(["%s\t%s\t%s" % (k, v[0], str(v[1])) for k,v in eclass_dict.items()])
+ return "\t".join(["%s\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"""
if eclasses == [""]:
# occasionally this occurs in the fs backends. they suck.
return {}
- if len(eclasses) % 3 != 0:
+
+ if len(eclasses) % 2 != 0 and len(eclasses) % 3 != 0:
raise cache_errors.CacheCorruption(cpv, "_eclasses_ was of invalid len %i" % len(eclasses))
d={}
- for x in range(0, len(eclasses), 3):
- d[eclasses[x]] = (eclasses[x + 1], long(eclasses[x + 2]))
+ has_paths = False
+ try:
+ long(eclasses[1])
+ 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])
del eclasses
return d
self.porttree_root = porttree_root
self.eclasses = {} # {"Name": ("location","_mtime_")}
+ self._eclass_locations = {}
# screw with the porttree ordering, w/out having bash inherit match it, and I'll hurt you.
# ~harring
def update_eclasses(self):
self.eclasses = {}
+ self._eclass_locations = {}
eclass_len = len(".eclass")
for x in [normalize_path(os.path.join(y,"eclass")) for y in self.porttrees]:
if not os.path.isdir(x):
except OSError:
continue
ys=y[:-eclass_len]
- self.eclasses[ys] = (x, long(mtime))
+ self.eclasses[ys] = long(mtime)
+ self._eclass_locations[ys] = x
def is_eclass_data_valid(self, ec_dict):
if not isinstance(ec_dict, dict):
return False
- for eclass, tup in ec_dict.iteritems():
- if eclass not in self.eclasses or tuple(tup) != self.eclasses[eclass]:
+ for eclass, mtime in ec_dict.iteritems():
+ if eclass not in self.eclasses or mtime != self.eclasses[eclass]:
return False
return True
print "ec=",ec_dict
print "inherits=",inherits
raise
- if from_master_only and self.eclasses[x][0] != self._master_eclass_root:
+ if from_master_only and \
+ self._eclass_locations[x] != self._master_eclass_root:
return None
return ec_dict
self.pkeywordsdict[cp][key] = pkgdict[key]
#package.license
+ """
+ # Wait until license groups are ready before enabling this.
licdict = grabdict_package(
os.path.join(abs_user_config, "package.license"),
recursive=1)
for k, v in licdict.iteritems():
self._plicensedict.setdefault(
dep_getkey(k), {})[k] = v
+ """
#package.unmask
pkgunmasklines = grabfile_package(
self.regenerate()
self.features = portage_util.unique_array(self["FEATURES"].split())
+
- self._accept_license = set(self.get("ACCEPT_LICENSE", "*").split())
+ # Wait until license groups are ready before enabling this.
+ #self._accept_license = set(self.get("ACCEPT_LICENSE", "*").split())
+ self._accept_license = set(["*"])
if "gpg" in self.features:
if not os.path.exists(self["PORTAGE_GPG_DIR"]) or \
if myre.match(filename):
try:
mydata = string.strip(open(infodir+"/"+filename).read())
- if len(mydata)<2048:
+ if len(mydata) < 2048 or filename == "USE":
if filename == "USE":
- self.configdict["pkg"][filename] = "-* "+mydata
+ binpkg_flags = "-* " + mydata
+ self.configdict["pkg"][filename] = binpkg_flags
+ self.configdict["env"][filename] = mydata
else:
self.configdict["pkg"][filename] = mydata
+ self.configdict["env"][filename] = mydata
# CATEGORY is important because it's used in doebuild
# to infer the cpv. If it's corrupted, it leads to
# strange errors later on, so we'll validate it and
settings.setcpv(mycpv, mydb=portdb)
acceptable_licenses = settings.acceptable_licenses(mycpv)
- def str_matches(myatom):
- return myatom in acceptable_licenses
- license_req = dep_check(mylicense, None, settings,
- str_matches=str_matches)[1]
- if license_req:
- rValue.append(" ".join(license_req) + " license(s)")
+ if "*" not in acceptable_licenses:
+ def str_matches(myatom):
+ return myatom in acceptable_licenses
+ license_req = dep_check(mylicense, None, settings,
+ str_matches=str_matches)[1]
+ if license_req:
+ rValue.append(" ".join(license_req) + " license(s)")
return rValue
COLOR_MAP_FILE = USER_CONFIG_PATH + "/color.map"
INCREMENTALS = ["USE", "USE_EXPAND", "USE_EXPAND_HIDDEN", "FEATURES",
- "ACCEPT_KEYWORDS", "CONFIG_PROTECT_MASK", "CONFIG_PROTECT", "PRELINK_PATH",
+ "ACCEPT_KEYWORDS", "ACCEPT_LICENSE",
+ "CONFIG_PROTECT_MASK", "CONFIG_PROTECT", "PRELINK_PATH",
"PRELINK_PATH_MASK"]
EBUILD_PHASES = ["setup", "unpack", "compile", "test", "install",
"preinst", "postinst", "prerm", "postrm", "other"]