Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 100120 Details for
Bug 17367
ACCEPT_LICENSE support required
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against 2.1.2_pre3-r6
accept_license.patch (text/plain), 8.91 KB, created by
Jason Stubbs (RETIRED)
on 2006-10-21 03:24:55 UTC
(
hide
)
Description:
Patch against 2.1.2_pre3-r6
Filename:
MIME Type:
Creator:
Jason Stubbs (RETIRED)
Created:
2006-10-21 03:24:55 UTC
Size:
8.91 KB
patch
obsolete
>--- pym.orig/portage.py 2006-10-22 14:03:10.000000000 +0000 >+++ pym/portage.py 2006-10-22 19:20:25.000000000 +0000 >@@ -916,6 +916,9 @@ > self.dirVirtuals = copy.deepcopy(clone.dirVirtuals) > self.treeVirtuals = copy.deepcopy(clone.treeVirtuals) > self.features = copy.deepcopy(clone.features) >+ >+ self.licensedict = copy.deepcopy(clone.licensedict) >+ self.plicensedict = copy.deepcopy(clone.plicensedict) > else: > > # backupenv is for calculated incremental variables. >@@ -1181,6 +1184,7 @@ > > self.pusedict = {} > self.pkeywordsdict = {} >+ self.plicensedict = {} > self.punmaskdict = {} > abs_user_config = os.path.join(config_root, > USER_CONFIG_PATH.lstrip(os.path.sep)) >@@ -1233,6 +1237,16 @@ > if not self.pkeywordsdict.has_key(cp): > self.pkeywordsdict[cp] = {} > self.pkeywordsdict[cp][key] = pkgdict[key] >+ >+ #package.license >+ licdict = grabdict_package( >+ os.path.join(abs_user_config, "package.license"), >+ recursive=1) >+ for key in licdict.keys(): >+ cp = dep_getkey(key) >+ if not self.plicensedict.has_key(cp): >+ self.plicensedict[cp] = {} >+ self.plicensedict[cp][key] = licdict[key] > > #package.unmask > pkgunmasklines = grabfile_package( >@@ -1326,6 +1340,10 @@ > > self.regenerate() > self.features = portage_util.unique_array(self["FEATURES"].split()) >+ >+ self.licensedict = {} >+ for license in self["ACCEPT_LICENSE"].split(): >+ self.licensedict[license] = True > > if "gpg" in self.features: > if not os.path.exists(self["PORTAGE_GPG_DIR"]) or \ >@@ -1507,6 +1525,7 @@ > self.modifying() > if self.mycpv == mycpv: > return >+ has_changed = False > self.mycpv = mycpv > cp = dep_getkey(mycpv) > pkginternaluse = "" >@@ -1523,7 +1542,10 @@ > best_match = best_match_to_list(self.mycpv, cpdict.keys()) > if best_match: > defaults.append(cpdict[best_match]) >- self.configdict["defaults"]["USE"] = " ".join(defaults) >+ defaults = " ".join(defaults) >+ if defaults != self.configdict["defaults"]["USE"]: >+ self.configdict["defaults"]["USE"] = defaults >+ has_changed = True > useforce = [] > for i in xrange(len(self.profiles)): > useforce.append(self.useforce_list[i]) >@@ -1532,7 +1554,10 @@ > best_match = best_match_to_list(self.mycpv, cpdict.keys()) > if best_match: > useforce.append(cpdict[best_match]) >- self.useforce = set(stack_lists(useforce, incremental=True)) >+ useforce = set(stack_lists(useforce, incremental=True)) >+ if useforce.symmetric_difference(self.useforce): >+ self.useforce = useforce >+ has_changed = True > usemask = [] > for i in xrange(len(self.profiles)): > usemask.append(self.usemask_list[i]) >@@ -1541,17 +1566,24 @@ > best_match = best_match_to_list(self.mycpv, cpdict.keys()) > if best_match: > usemask.append(cpdict[best_match]) >- self.usemask = set(stack_lists(usemask, incremental=True)) >+ usemask = set(stack_lists(usemask, incremental=True)) >+ if usemask.symmetric_difference(self.usemask): >+ self.usemask = usemask >+ has_changed = True >+ oldpuse = self.puse > self.puse = "" > if self.pusedict.has_key(cp): > self.pusekey = best_match_to_list(self.mycpv, self.pusedict[cp].keys()) > if self.pusekey: > self.puse = " ".join(self.pusedict[cp][self.pusekey]) >+ if oldpuse != self.puse: >+ has_changed = True > self.configdict["pkg"]["PKGUSE"] = self.puse[:] # For saving to PUSE file > self.configdict["pkg"]["USE"] = self.puse[:] # this gets appended to USE > # CATEGORY is essential for doebuild calls > self.configdict["pkg"]["CATEGORY"] = mycpv.split("/")[0] >- self.reset(keeping_pkg=1,use_cache=use_cache) >+ if has_changed: >+ self.reset(keeping_pkg=1,use_cache=use_cache) > > def setinst(self,mycpv,mydbapi): > self.modifying() >@@ -3424,9 +3456,7 @@ > return_all_deps=False): > """Takes an unreduced and reduced deplist and removes satisfied dependencies. > Returned deplist contains steps that must be taken to satisfy dependencies.""" >- if trees is None: >- global db >- trees = db >+ > writemsg("ZapDeps -- %s\n" % (use_binaries), 2) > if not reduced or unreduced == ["||"] or \ > (not return_all_deps and dep_eval(reduced)): >@@ -3447,6 +3477,17 @@ > deps = unreduced[1:] > satisfieds = reduced[1:] > >+ if trees is None: >+ # We don't have trees to check availability against, so we >+ # just default to the first choice. >+ if isinstance(deps[0], list): >+ atoms = dep_zapdeps(deps[0], satisfieds[0], myroot, >+ use_binaries=use_binaries, trees=trees, >+ return_all_deps=return_all_deps) >+ else: >+ atoms = [deps[0]] >+ return atoms >+ > # Our preference order is for an the first item that: > # a) contains all unmasked packages with the same key as installed packages > # b) contains all unmasked packages >@@ -3551,7 +3592,8 @@ > mydep, mydb=mydb, use_cache=use_cache, settings=settings) + postfix > > def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, >- use_cache=1, use_binaries=0, myroot="/", trees=None, return_all_deps=False): >+ use_cache=1, use_binaries=0, myroot="/", trees=None, str_matches=None, >+ return_all_deps=False): > """Takes a depend string and parses the condition.""" > > #check_config_instance(mysettings) >@@ -3608,7 +3650,7 @@ > #dependencies were reduced to nothing > return [1,[]] > mysplit2=mysplit[:] >- mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,use_cache=use_cache) >+ mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,str_matches=str_matches,use_cache=use_cache) > if mysplit2 is None: > return [0,"Invalid token"] > >@@ -3629,19 +3671,23 @@ > writemsg("mydict: %s\n" % (mydict), 1) > return [1,mydict.keys()] > >-def dep_wordreduce(mydeplist,mysettings,mydbapi,mode,use_cache=1): >+def dep_wordreduce(mydeplist,mysettings,mydbapi,mode,str_matches=None,use_cache=1): > "Reduces the deplist to ones and zeros" > mypos=0 > deplist=mydeplist[:] > while mypos<len(deplist): > if type(deplist[mypos])==types.ListType: > #recurse >- deplist[mypos]=dep_wordreduce(deplist[mypos],mysettings,mydbapi,mode,use_cache=use_cache) >+ deplist[mypos]=dep_wordreduce(deplist[mypos],mysettings,mydbapi,mode, >+ str_matches=str_matches,use_cache=use_cache) > elif deplist[mypos]=="||": > pass > else: > mykey = dep_getkey(deplist[mypos]) >- if mysettings and mysettings.pprovideddict.has_key(mykey) and \ >+ if str_matches is not None: >+ mykey = deplist[mypos] >+ deplist[mypos]=(mykey in str_matches) >+ elif mysettings and mysettings.pprovideddict.has_key(mykey) and \ > match_from_list(deplist[mypos], mysettings.pprovideddict[mykey]): > deplist[mypos]=True > else: >@@ -3846,7 +3892,7 @@ > rValue.append("package.mask") > > # keywords checking >- mygroups, eapi = portdb.aux_get(mycpv, ["KEYWORDS", "EAPI"]) >+ mygroups, mylicense, eapi = portdb.aux_get(mycpv, ["KEYWORDS", "LICENSE", "EAPI"]) > if not eapi_is_supported(eapi): > return ["required EAPI %s, supported EAPI %s" % (eapi, portage_const.EAPI)] > mygroups = mygroups.split() >@@ -3881,6 +3927,23 @@ > > if kmask: > rValue.append(kmask+" keyword") >+ >+ licdict = settings.plicensedict >+ plicenses = settings["ACCEPT_LICENSE"].split() >+ if licdict.has_key(cp): >+ matches = match_to_list(mycpv, pkgdict[cp].keys()) >+ for match in matches: >+ plicenses.extend(licdict[cp][match]) >+ >+ settings.setcpv(mycpv) >+ if dep_check(mylicense, None, settings, str_matches=plicenses)[1]: >+ license_req = [] >+ mylicense = mylicense.split() >+ for license in mylicense: >+ if license in ("(", ")", "||") or license not in plicenses: >+ license_req.append(license) >+ rValue.append(" ".join(license_req) + " license(s)") >+ > return rValue > > class packagetree: >@@ -5331,16 +5394,17 @@ > newlist=[] > > pkgdict = self.mysettings.pkeywordsdict >+ licdict = self.mysettings.plicensedict > for mycpv in mylist: > #we need to update this next line when we have fully integrated the new db api > auxerr=0 > keys = None > try: >- keys, eapi = self.aux_get(mycpv, ["KEYWORDS", "EAPI"]) >+ keys, license, eapi = self.aux_get(mycpv, ["KEYWORDS", "LICENSE", "EAPI"]) > except KeyError: > pass > except portage_exception.PortageException, e: >- writemsg("!!! Error: aux_get('%s', ['KEYWORDS', 'EAPI'])\n" % mycpv, >+ writemsg("!!! Error: aux_get('%s', ['KEYWORDS', 'LICENSE', 'EAPI'])\n" % mycpv, > noiselevel=-1) > writemsg("!!! %s\n" % str(e), > noiselevel=-1) >@@ -5377,6 +5441,20 @@ > hasstable = True > if not match and ((hastesting and "~*" in pgroups) or (hasstable and "*" in pgroups)): > match=1 >+ if "*" not in self.mysettings.licensedict: >+ if "?" in license: >+ self.mysettings.setcpv(mycpv) >+ reqd = dep_check(license, None, self.mysettings, str_matches=self.mysettings.licensedict)[1] >+ if reqd: >+ plicenses = [] >+ if licdict.has_key(cp): >+ matches = match_to_list(mycpv, licdict[cp].keys()) >+ for atom in matches: >+ plicenses.extend(licdict[cp][atom]) >+ for license in reqd: >+ if license not in plicenses: >+ match = 0 >+ break > if match and eapi_is_supported(eapi): > newlist.append(mycpv) > return newlist
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 17367
:
21107
|
21265
|
21296
|
59091
| 100120