show licenses or pointer to license files on 'masked by' message
authorMarius Mauch <genone@gentoo.org>
Thu, 26 Oct 2006 16:27:25 +0000 (16:27 -0000)
committerMarius Mauch <genone@gentoo.org>
Thu, 26 Oct 2006 16:27:25 +0000 (16:27 -0000)
svn path=/main/trunk/; revision=4827

bin/emerge
pym/portage.py

index 440a6cb8712bb5eeed6901790bf942d2b5c9ea7e..32bee88b81f9988821740dbeddb969e78dea2625 100755 (executable)
@@ -1358,6 +1358,7 @@ class depgraph:
                                                        print "\n!!! "+red("All ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.")
                                                        print "!!! One of the following masked packages is required to complete your request:"
                                                        oldcomment = ""
+                                                       shown_licenses = []
                                                        for p in alleb:
                                                                mreasons = portage.getmaskingstatus(p,
                                                                        settings=pkgsettings, portdb=portdb)
@@ -1368,6 +1369,19 @@ class depgraph:
                                                                        if comment and comment != oldcomment:
                                                                                print comment
                                                                                oldcomment = comment
+                                                               licdict = portage.getlicensetexts(p, settings=pkgsettings, portdb=portdb, onlymasked=True)
+                                                               for lic in licdict.keys():
+                                                                       if lic+" license" in mreasons and not lic in shown_licenses:
+                                                                               if len(licdict[lic][1]) > 2000:
+                                                                                       print "Please read the text of license %s in %s" % (lic, licdict[lic][0])
+                                                                                       print
+                                                                               else:
+                                                                                       print "License text for license %s:" % lic
+                                                                                       print
+                                                                                       print licdict[lic][1]
+                                                                                       print
+                                                                               shown_licenses.append(lic)
+                                                                               
                                                        print
                                                        print "For more information, see MASKED PACKAGES section in the emerge man page or "
                                                        print "refer to the Gentoo Handbook."
index 2862db7cc18b3c3230444e1645a16f4287954349..6a7f6f33da1b684172831d98dfc29ebaf3d39765 100644 (file)
@@ -1344,8 +1344,8 @@ class config:
 
                        
                        # Wait until license groups are ready before enabling this.
-                       #self._accept_license = set(self.get("ACCEPT_LICENSE", "*").split())
-                       self._accept_license = set(["*"])
+                       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 \