aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-10-18 14:52:10 +0100
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-10-28 17:08:07 +0000
commit4ab561ac3df105b4b6487271b6ccc29445518d52 (patch)
treef2dc0b80fdbb9f3692568c8b3726dbbbb862b5b1
parentd923846d91ae307372f1e48483e86807feeeb09d (diff)
downloadopenembedded-core-contrib-4ab561ac3df105b4b6487271b6ccc29445518d52.tar.gz
scripts/oe-pkgdata-util: add ability to find a recipe from a target package
Add a "lookup-recipe" command to show which recipe produced a particular package. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rwxr-xr-xscripts/oe-pkgdata-util37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 08773e9b05..80cacc5b66 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -219,6 +219,38 @@ def lookup_pkg(args, usage):
items.extend(mappings.get(pkg, []))
print '\n'.join(items)
+def lookup_recipe(args, usage):
+ if len(args) < 2:
+ usage()
+ sys.exit(1)
+
+ pkgdata_dir = args[0]
+ pkgs = args[1].split()
+
+ if not os.path.exists(pkgdata_dir):
+ print('ERROR: Unable to find pkgdata directory %s' % pkgdata_dir)
+ sys.exit(1)
+
+ mappings = defaultdict(list)
+ for pkg in pkgs:
+ pkgfile = os.path.join(pkgdata_dir, 'runtime-reverse', pkg)
+ if os.path.exists(pkgfile):
+ with open(pkgfile, 'r') as f:
+ for line in f:
+ fields = line.rstrip().split(': ')
+ if fields[0] == 'PN':
+ mappings[pkg].append(fields[1])
+ break
+ if len(mappings) < len(pkgs):
+ missing = list(set(pkgs) - set(mappings.keys()))
+ sys.stderr.write("ERROR: the following packages could not be found: %s\n" % ', '.join(missing))
+ sys.exit(1)
+
+ items = []
+ for pkg in pkgs:
+ items.extend(mappings.get(pkg, []))
+ print '\n'.join(items)
+
def find_path(args, usage):
if len(args) < 2:
usage()
@@ -263,6 +295,9 @@ Available commands:
lookup-pkg <pkgdatadir> "<recipe-pkgs>"
look up the specified recipe-space package name(s) to see what the
final runtime package name is (e.g. eglibc becomes libc6)
+ lookup-recipe <pkgdatadir> "<pkgs>"
+ look up the specified package(s) to see which recipe they were
+ produced by
find-path <pkgdatadir> <path>
find the package providing the specified path (wildcards * ? allowed)
read-value <pkgdatadir> <value-name> "<pkgs>"
@@ -284,6 +319,8 @@ Available commands:
glob(args[1:], parser.print_help)
elif args[0] == "lookup-pkg":
lookup_pkg(args[1:], parser.print_help)
+ elif args[0] == "lookup-recipe":
+ lookup_recipe(args[1:], parser.print_help)
elif args[0] == "find-path":
find_path(args[1:], parser.print_help)
elif args[0] == "read-value":
sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
Microsoft Reciprocal License (Ms-RL)
 

This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
 

Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software. 
A "contributor" is any person that distributes its contribution under this license. 
"Licensed patents" are a contributor`s patent claims that read directly on its contribution.
Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
Conditions and Limitations
(A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose. 
(B) No Trademark License- This license does not grant you rights to use any contributors` name, logo, or trademarks. 
(C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. 
(D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. 
(E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. 
(F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.