Merged from trunk -r14577:14587
authorFabian Groffen <grobian@gentoo.org>
Wed, 14 Oct 2009 19:38:06 +0000 (19:38 -0000)
committerFabian Groffen <grobian@gentoo.org>
Wed, 14 Oct 2009 19:38:06 +0000 (19:38 -0000)
   | 14579   | Bug #288551 - Handle invalid cpv in portdbapi.aux_get() by   |
   | zmedico | raising KeyError.                                            |

   | 14581   | Rename dohtml to dohtml.py. Next commit will add a shell     |
   | zmedico | script wrapper for EPYTHON handling.                         |

   | 14582   | Use a shell script for dohtml instead of a function, for     |
   | zmedico | xargs compatibility.                                         |

   | 14585   | Use a shell script wrapper for EPYTHON handling.             |
   | zmedico |                                                              |

   | 14587   | Document license_groups.                                     |
   | zmedico |                                                              |

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

bin/ebuild-helpers/dohtml
bin/ebuild-helpers/dohtml.py [new file with mode: 0755]
bin/ebuild-helpers/portageq [changed from symlink to file mode: 0755]
bin/ebuild.sh
man/portage.5
pym/portage/dbapi/porttree.py

index 39e7ab10784a36f1cf48524bde37bf0e091cc400..572b1d7dc6dfa2f805f1b2611826c8e14500c12f 100755 (executable)
-#!@PORTAGE_PYTHON@
-# Copyright 1999-2006 Gentoo Foundation
+#!@PORTAGE_BASH@
+# Copyright 2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-#
-# Typical usage:
-# dohtml -r docs/*
-#  - put all files and directories in docs into /usr/share/doc/${PF}/html
-# dohtml foo.html
-#  - put foo.html into /usr/share/doc/${PF}/html
-#
-#
-# Detailed usage:
-# dohtml <list-of-files> 
-#  - will install the files in the list of files (space-separated list) into 
-#    /usr/share/doc/${PF}/html, provided the file ends in .htm, .html, .css,
-#      .js, ,gif, .jpeg, .jpg, or .png.
-# dohtml -r <list-of-files-and-directories>
-#  - will do as 'dohtml', but recurse into all directories, as long as the 
-#    directory name is not CVS
-# dohtml -A jpe,java [-r] <list-of-files[-and-directories]>
-#  - will do as 'dohtml' but add .jpe,.java (default filter list is
-#    added to your list)
-# dohtml -a png,gif,html,htm [-r] <list-of-files[-and-directories]>
-#  - will do as 'dohtml' but filter on .png,.gif,.html,.htm (default filter 
-#    list is ignored)
-# dohtml -x CVS,SCCS,RCS -r <list-of-files-and-directories>
-#  - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS
-#
-
-from __future__ import print_function
-
-import os
-import sys
-
-def dodir(path):
-       os.spawnlp(os.P_WAIT, "install", "install", "-d", path)
-
-def dofile(src,dst):
-       os.spawnlp(os.P_WAIT, "install", "install", "-m0644", src, dst)
-
-def eqawarn(lines):
-       cmd = "source '%s/isolated-functions.sh' ; " % \
-               os.environ["PORTAGE_BIN_PATH"]
-       for line in lines:
-               cmd += "eqawarn \"%s\" ; " % line
-       os.spawnlp(os.P_WAIT, "bash", "bash", "-c", cmd)
-
-skipped_directories = []
-
-def install(basename, dirname, options, prefix=""):
-       fullpath = basename
-       if prefix:
-               fullpath = prefix + "/" + fullpath
-       if dirname:
-               fullpath = dirname + "/" + fullpath
-
-       if options.DOCDESTTREE:
-               destdir = options.ED + "/usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix
-       else:
-               destdir = options.ED + "/usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix
-
-       if not os.path.exists(fullpath):
-               sys.stderr.write("!!! dohtml: %s does not exist\n" % fullpath)
-               return False
-       elif os.path.isfile(fullpath):
-               ext = os.path.splitext(basename)[1]
-               if (len(ext) and ext[1:] in options.allowed_exts) or basename in options.allowed_files:
-                       dodir(destdir)
-                       dofile(fullpath, destdir + "/" + basename)
-       elif options.recurse and os.path.isdir(fullpath) and \
-            basename not in options.disallowed_dirs:
-               for i in os.listdir(fullpath):
-                       pfx = basename
-                       if prefix: pfx = prefix + "/" + pfx
-                       install(i, dirname, options, pfx)
-       elif not options.recurse and os.path.isdir(fullpath):
-               global skipped_directories
-               skipped_directories.append(fullpath)
-               return False
-       else:
-               return False
-       return True
-
-
-class OptionsClass:
-       def __init__(self):
-               self.PF = ""
-               self.ED = ""
-               self.DOCDESTTREE = ""
-               
-               if "PF" in os.environ:
-                       self.PF = os.environ["PF"]
-               if os.environ.has_key("ED"):
-                       self.ED = os.environ["ED"]
-               if "_E_DOCDESTTREE_" in os.environ:
-                       self.DOCDESTTREE = os.environ["_E_DOCDESTTREE_"]
-               
-               self.allowed_exts = [ 'htm', 'html', 'css', 'js',
-                       'gif', 'jpeg', 'jpg', 'png' ]
-               self.allowed_files = []
-               self.disallowed_dirs = [ 'CVS' ]
-               self.recurse = False
-               self.verbose = False
-               self.doc_prefix = ""
-
-def print_help():
-       opts = OptionsClass()
-
-       print("dohtml [-a .foo,.bar] [-A .foo,.bar] [-f foo,bar] [-x foo,bar]")
-       print("       [-r] [-V] <file> [file ...]")
-       print()
-       print(" -a   Set the list of allowed to those that are specified.")
-       print("      Default:", ",".join(opts.allowed_exts))
-       print(" -A   Extend the list of allowed file types.")
-       print(" -f   Set list of allowed extensionless file names.")
-       print(" -x   Set directories to be excluded from recursion.")
-       print("      Default:", ",".join(opts.disallowed_dirs))
-       print(" -p   Set a document prefix for installed files (empty by default).")
-       print(" -r   Install files and directories recursively.")
-       print(" -V   Be verbose.")
-       print()
-
-def parse_args():
-       options = OptionsClass()
-       args = []
-       
-       x = 1
-       while x < len(sys.argv):
-               arg = sys.argv[x]
-               if arg in ["-h","-r","-V"]:
-                       if arg == "-h":
-                               print_help()
-                               sys.exit(0)
-                       elif arg == "-r":
-                               options.recurse = True
-                       elif arg == "-V":
-                               options.verbose = True
-               elif sys.argv[x] in ["-A","-a","-f","-x","-p"]:
-                       x += 1
-                       if x == len(sys.argv):
-                               print_help()
-                               sys.exit(0)
-                       elif arg == "-p":
-                               options.doc_prefix = sys.argv[x]
-                       else:
-                               values = sys.argv[x].split(",")
-                               if arg == "-A":
-                                       options.allowed_exts.extend(values)
-                               elif arg == "-a":
-                                       options.allowed_exts = values
-                               elif arg == "-f":
-                                       options.allowed_files = values
-                               elif arg == "-x":
-                                       options.disallowed_dirs = values
-               else:
-                       args.append(sys.argv[x])
-               x += 1
-       
-       return (options, args)
-
-def main():
-
-       (options, args) = parse_args()
-
-       if options.verbose:
-               print("Allowed extensions:", options.allowed_exts)
-               print("Document prefix : '" + options.doc_prefix         + "'")
-               print("Allowed files :", options.allowed_files)
-
-       success = False
-       
-       for x in args:
-               basename = os.path.basename(x)
-               dirname  = os.path.dirname(x)
-               success |= install(basename, dirname, options)
-
-       if success:
-               retcode = 0
-       else:
-               retcode = 1
-               global skipped_directories
-               for x in skipped_directories:
-                       eqawarn(["QA Notice: dohtml on directory " + \
-                               "'%s' without recursion option" % x])
-
-       sys.exit(retcode)
-
-if __name__ == "__main__":
-       main()
+PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}
+PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}
+# Set EPYTHON variable as empty so that dohtml doesn't try
+# to use potentially unsupported version of Python.
+EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
+       exec "$PORTAGE_BIN_PATH/dohtml.py" "$@"
diff --git a/bin/ebuild-helpers/dohtml.py b/bin/ebuild-helpers/dohtml.py
new file mode 100755 (executable)
index 0000000..39e7ab1
--- /dev/null
@@ -0,0 +1,191 @@
+#!@PORTAGE_PYTHON@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#
+# Typical usage:
+# dohtml -r docs/*
+#  - put all files and directories in docs into /usr/share/doc/${PF}/html
+# dohtml foo.html
+#  - put foo.html into /usr/share/doc/${PF}/html
+#
+#
+# Detailed usage:
+# dohtml <list-of-files> 
+#  - will install the files in the list of files (space-separated list) into 
+#    /usr/share/doc/${PF}/html, provided the file ends in .htm, .html, .css,
+#      .js, ,gif, .jpeg, .jpg, or .png.
+# dohtml -r <list-of-files-and-directories>
+#  - will do as 'dohtml', but recurse into all directories, as long as the 
+#    directory name is not CVS
+# dohtml -A jpe,java [-r] <list-of-files[-and-directories]>
+#  - will do as 'dohtml' but add .jpe,.java (default filter list is
+#    added to your list)
+# dohtml -a png,gif,html,htm [-r] <list-of-files[-and-directories]>
+#  - will do as 'dohtml' but filter on .png,.gif,.html,.htm (default filter 
+#    list is ignored)
+# dohtml -x CVS,SCCS,RCS -r <list-of-files-and-directories>
+#  - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS
+#
+
+from __future__ import print_function
+
+import os
+import sys
+
+def dodir(path):
+       os.spawnlp(os.P_WAIT, "install", "install", "-d", path)
+
+def dofile(src,dst):
+       os.spawnlp(os.P_WAIT, "install", "install", "-m0644", src, dst)
+
+def eqawarn(lines):
+       cmd = "source '%s/isolated-functions.sh' ; " % \
+               os.environ["PORTAGE_BIN_PATH"]
+       for line in lines:
+               cmd += "eqawarn \"%s\" ; " % line
+       os.spawnlp(os.P_WAIT, "bash", "bash", "-c", cmd)
+
+skipped_directories = []
+
+def install(basename, dirname, options, prefix=""):
+       fullpath = basename
+       if prefix:
+               fullpath = prefix + "/" + fullpath
+       if dirname:
+               fullpath = dirname + "/" + fullpath
+
+       if options.DOCDESTTREE:
+               destdir = options.ED + "/usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix
+       else:
+               destdir = options.ED + "/usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix
+
+       if not os.path.exists(fullpath):
+               sys.stderr.write("!!! dohtml: %s does not exist\n" % fullpath)
+               return False
+       elif os.path.isfile(fullpath):
+               ext = os.path.splitext(basename)[1]
+               if (len(ext) and ext[1:] in options.allowed_exts) or basename in options.allowed_files:
+                       dodir(destdir)
+                       dofile(fullpath, destdir + "/" + basename)
+       elif options.recurse and os.path.isdir(fullpath) and \
+            basename not in options.disallowed_dirs:
+               for i in os.listdir(fullpath):
+                       pfx = basename
+                       if prefix: pfx = prefix + "/" + pfx
+                       install(i, dirname, options, pfx)
+       elif not options.recurse and os.path.isdir(fullpath):
+               global skipped_directories
+               skipped_directories.append(fullpath)
+               return False
+       else:
+               return False
+       return True
+
+
+class OptionsClass:
+       def __init__(self):
+               self.PF = ""
+               self.ED = ""
+               self.DOCDESTTREE = ""
+               
+               if "PF" in os.environ:
+                       self.PF = os.environ["PF"]
+               if os.environ.has_key("ED"):
+                       self.ED = os.environ["ED"]
+               if "_E_DOCDESTTREE_" in os.environ:
+                       self.DOCDESTTREE = os.environ["_E_DOCDESTTREE_"]
+               
+               self.allowed_exts = [ 'htm', 'html', 'css', 'js',
+                       'gif', 'jpeg', 'jpg', 'png' ]
+               self.allowed_files = []
+               self.disallowed_dirs = [ 'CVS' ]
+               self.recurse = False
+               self.verbose = False
+               self.doc_prefix = ""
+
+def print_help():
+       opts = OptionsClass()
+
+       print("dohtml [-a .foo,.bar] [-A .foo,.bar] [-f foo,bar] [-x foo,bar]")
+       print("       [-r] [-V] <file> [file ...]")
+       print()
+       print(" -a   Set the list of allowed to those that are specified.")
+       print("      Default:", ",".join(opts.allowed_exts))
+       print(" -A   Extend the list of allowed file types.")
+       print(" -f   Set list of allowed extensionless file names.")
+       print(" -x   Set directories to be excluded from recursion.")
+       print("      Default:", ",".join(opts.disallowed_dirs))
+       print(" -p   Set a document prefix for installed files (empty by default).")
+       print(" -r   Install files and directories recursively.")
+       print(" -V   Be verbose.")
+       print()
+
+def parse_args():
+       options = OptionsClass()
+       args = []
+       
+       x = 1
+       while x < len(sys.argv):
+               arg = sys.argv[x]
+               if arg in ["-h","-r","-V"]:
+                       if arg == "-h":
+                               print_help()
+                               sys.exit(0)
+                       elif arg == "-r":
+                               options.recurse = True
+                       elif arg == "-V":
+                               options.verbose = True
+               elif sys.argv[x] in ["-A","-a","-f","-x","-p"]:
+                       x += 1
+                       if x == len(sys.argv):
+                               print_help()
+                               sys.exit(0)
+                       elif arg == "-p":
+                               options.doc_prefix = sys.argv[x]
+                       else:
+                               values = sys.argv[x].split(",")
+                               if arg == "-A":
+                                       options.allowed_exts.extend(values)
+                               elif arg == "-a":
+                                       options.allowed_exts = values
+                               elif arg == "-f":
+                                       options.allowed_files = values
+                               elif arg == "-x":
+                                       options.disallowed_dirs = values
+               else:
+                       args.append(sys.argv[x])
+               x += 1
+       
+       return (options, args)
+
+def main():
+
+       (options, args) = parse_args()
+
+       if options.verbose:
+               print("Allowed extensions:", options.allowed_exts)
+               print("Document prefix : '" + options.doc_prefix         + "'")
+               print("Allowed files :", options.allowed_files)
+
+       success = False
+       
+       for x in args:
+               basename = os.path.basename(x)
+               dirname  = os.path.dirname(x)
+               success |= install(basename, dirname, options)
+
+       if success:
+               retcode = 0
+       else:
+               retcode = 1
+               global skipped_directories
+               for x in skipped_directories:
+                       eqawarn(["QA Notice: dohtml on directory " + \
+                               "'%s' without recursion option" % x])
+
+       sys.exit(retcode)
+
+if __name__ == "__main__":
+       main()
deleted file mode 120000 (symlink)
index 4d1273c4892cd5a4a6b36eaea1b764be0fbb6b94..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../portageq
\ No newline at end of file
new file mode 100755 (executable)
index 0000000000000000000000000000000000000000..6dc5d7a7d9b3a3070a6da602d958cacbf21d31fb
--- /dev/null
@@ -0,0 +1,11 @@
+#!@PORTAGE_BASH@
+# Copyright 2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}
+PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}
+# Set EPYTHON variable as empty so that dohtml doesn't try
+# to use potentially unsupported version of Python.
+EPYTHON= PYTHONPATH=$PORTAGE_PYM_PATH${PYTHONPATH:+:}$PYTHONPATH \
+       exec "$PORTAGE_BIN_PATH/portageq" "$@"
index 42d23324b960dcb995e33949f5c34affa2e84e81..75ff5cfd63e163e065b9303f26c1f4099a59df70 100755 (executable)
@@ -229,13 +229,6 @@ best_version() {
        esac
 }
 
-dohtml() {
-       # Set EPYTHON variable as empty so that dohtml doesn't try
-       # to use potentially unsupported version of Python.
-       EPYTHON= PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \
-       "${PORTAGE_BIN_PATH}/ebuild-helpers/dohtml" "$@"
-}
-
 use_with() {
        if [ -z "$1" ]; then
                echo "!!! use_with() called without a parameter." >&2
index 50e7e98e58e86412f10ea0cc2db0556445eafd94..ae5f7f1f8981615e45d40d7e16ea5e70822c3c7f 100644 (file)
@@ -73,6 +73,7 @@ arch.list
 categories
 info_pkgs
 info_vars
+license_groups
 package.mask
 profiles.desc
 repo_name
@@ -682,8 +683,24 @@ sys\-kernel
 .BR info_pkgs
 A list of all the packages which will be displayed when you run `emerge info`.
 .TP
-.BR info_vars
-A list of all the variables which will be displayed when you run `emerge info`.
+.BR license_groups
+This contains groups of licenses that may be specifed in the
+\fBACCEPT_LICENSE\fR variable (see \fBmake.conf\fR(5)).
+
+.I Format:
+.nf
+\- comments begin with # (no inline comments)
+\- one group name, followed by list of licenses and nested groups
+\- nested groups are prefixed with the @ symbol
+.fi
+
+.I Example:
+.nf
+# The FSF-APPROVED group includes the entire GPL-COMPATIBLE group and more.
+FSF-APPROVED @GPL-COMPATIBLE Apache-1.1 BSD-4 MPL-1.0 MPL-1.1
+# The GPL-COMPATIBLE group includes all licenses compatible with the GNU GPL.
+GPL-COMPATIBLE Apache-2.0 BSD BSD-2 GPL-2 GPL-3 LGPL-2.1 LGPL-3 X11 ZLIB
+.fi
 .TP
 .BR package.keywords
 Per\-profile KEYWORDS. Useful for cases in which the effective KEYWORDS of a
index e955a6a57e970541f944bc8f6cb0b1dece77c971..a993227cabf75abbdb0d04af5823e58dc5dd22fd 100644 (file)
@@ -609,7 +609,11 @@ class portdbapi(dbapi):
                                return [aux_cache.get(x, "") for x in mylist]
                        cache_me = True
                global auxdbkeys, auxdbkeylen
-               cat,pkg = mycpv.split("/", 1)
+               try:
+                       cat, pkg = mycpv.split("/", 1)
+               except ValueError:
+                       # Missing slash. Can't find ebuild so raise KeyError.
+                       raise KeyError(mycpv)
 
                myebuild, mylocation = self.findname2(mycpv, mytree)