summaryrefslogtreecommitdiffstats
path: root/scripts/oe-pkgdata-util
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-13 13:35:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-14 08:21:00 +0100
commit8ebe7be3d9494c3467b5533091bf6832030aad99 (patch)
treef7b483590c2dd75cfeed99dd8479068cdbafbadb /scripts/oe-pkgdata-util
parentaf5b3f3510d3faa0e570be4b4997e9abcad5a805 (diff)
downloadpoky-8ebe7be3d9494c3467b5533091bf6832030aad99.tar.gz
bitbake.conf/package: Collapse PKGDATA_DIR into a single machine specific directory
Currently we have a hierarchy of pkgdata directories and the code has to put together a search path and look through each in turn until it finds the data it needs. This has lead to a number of hardcoded paths and file globing which is unpredictable and undesirable. Worse, certain tricks that should be easy like a GL specific package architecture become problematic with the curretn search paths. With the modern sstate code, we can do better and construct a single pkgdata directory for each machine in just the same way as we do for the sysroot. This is already tried and well tested. With such a single directory, all the code that iterated through multiple pkgdata directories and simply be removed and give a significant simplification of the code. Even existing build directories adapt to the change well since the package contents doesn't change, just the location they're installed to and the stamp for them. The only complication is the we need a different shlibs directory for each multilib. These are only used by package.bbclass and the simple fix is to add MLPREFIX to the shlib directory name. This means the multilib packages will repackage and the sstate checksum will change but an existing build directory will adapt to the changes safely. It is close to release however I believe the benefits this patch give us are worth consideration for inclusion and give us more options for dealing with problems like the GL one. It also sets the ground work well for shlibs improvements in 1.6. (From OE-Core rev: 1b8e4abd2d9c0901d38d89d0f944fe1ffd019379) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-pkgdata-util')
-rwxr-xr-xscripts/oe-pkgdata-util36
1 files changed, 10 insertions, 26 deletions
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index c63f87d7e6..dcdfe25dfd 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -41,17 +41,13 @@ def usage():
41 41
42 42
43def glob(args): 43def glob(args):
44 if len(args) < 4: 44 if len(args) < 3:
45 usage() 45 usage()
46 sys.exit(1) 46 sys.exit(1)
47 47
48 pkgdata_dir = args[0] 48 pkgdata_dir = args[0]
49 target_suffix = args[1] 49 pkglist_file = args[1]
50 pkglist_file = args[2] 50 globs = args[2].split()
51 globs = args[3].split()
52
53 if target_suffix.startswith("-"):
54 target_suffix = target_suffix[1:]
55 51
56 skipregex = re.compile("-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-") 52 skipregex = re.compile("-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-")
57 53
@@ -63,7 +59,6 @@ def glob(args):
63 continue 59 continue
64 pkg = fields[0] 60 pkg = fields[0]
65 arch = fields[1] 61 arch = fields[1]
66 multimach_target_sys = "%s-%s" % (arch, target_suffix)
67 62
68 # Skip packages for which there is no point applying globs 63 # Skip packages for which there is no point applying globs
69 if skipregex.search(pkg): 64 if skipregex.search(pkg):
@@ -86,9 +81,9 @@ def glob(args):
86 81
87 # Define some functions 82 # Define some functions
88 def revpkgdata(pkgn): 83 def revpkgdata(pkgn):
89 return os.path.join(pkgdata_dir, multimach_target_sys, "runtime-reverse", pkgn) 84 return os.path.join(pkgdata_dir, "runtime-reverse", pkgn)
90 def fwdpkgdata(pkgn): 85 def fwdpkgdata(pkgn):
91 return os.path.join(pkgdata_dir, multimach_target_sys, "runtime", pkgn) 86 return os.path.join(pkgdata_dir, "runtime", pkgn)
92 def readpn(pkgdata_file): 87 def readpn(pkgdata_file):
93 pn = "" 88 pn = ""
94 with open(pkgdata_file, 'r') as f: 89 with open(pkgdata_file, 'r') as f:
@@ -156,17 +151,13 @@ def glob(args):
156 print("\n".join(mappedpkgs)) 151 print("\n".join(mappedpkgs))
157 152
158def read_value(args): 153def read_value(args):
159 if len(args) < 4: 154 if len(args) < 3:
160 usage() 155 usage()
161 sys.exit(1) 156 sys.exit(1)
162 157
163 pkgdata_dir = args[0] 158 pkgdata_dir = args[0]
164 target_suffix = args[1] 159 var = args[1]
165 var = args[2] 160 packages = args[2].split()
166 packages = args[3].split()
167
168 if target_suffix.startswith("-"):
169 target_suffix = target_suffix[1:]
170 161
171 def readvar(pkgdata_file, var): 162 def readvar(pkgdata_file, var):
172 val = "" 163 val = ""
@@ -177,23 +168,16 @@ def read_value(args):
177 return val 168 return val
178 169
179 if debug: 170 if debug:
180 print "read-value('%s', '%s', '%s' '%s'" % (pkgdata_dir, target_suffix, var, packages) 171 print "read-value('%s', '%s' '%s'" % (pkgdata_dir, var, packages)
181 for package in packages: 172 for package in packages:
182 pkg_split = package.split('_') 173 pkg_split = package.split('_')
183 pkg_name = pkg_split[0] 174 pkg_name = pkg_split[0]
184 pkg_arch = '_'.join(pkg_split[1:]) 175 pkg_arch = '_'.join(pkg_split[1:])
185 if debug: 176 if debug:
186 print "package: name: '%s', arch: '%s'" % (pkg_name, pkg_arch) 177 print "package: name: '%s', arch: '%s'" % (pkg_name, pkg_arch)
187 multimach_target_sys = "%s-%s" % (pkg_arch, target_suffix) 178 revlink = os.path.join(pkgdata_dir, "runtime-reverse", pkg_name)
188 revlink = os.path.join(pkgdata_dir, multimach_target_sys, "runtime-reverse", pkg_name)
189 if debug: 179 if debug:
190 print(revlink) 180 print(revlink)
191 if not os.path.exists(revlink):
192 # [YOCTO #4227] try to drop -gnueabi from TARGET_OS
193 multimach_target_sys = '-'.join(multimach_target_sys.split('-')[:-1])
194 revlink = os.path.join(pkgdata_dir, multimach_target_sys, "runtime-reverse", pkg_name)
195 if debug:
196 print(revlink)
197 if os.path.exists(revlink): 181 if os.path.exists(revlink):
198 mappedpkg = os.path.basename(os.readlink(revlink)) 182 mappedpkg = os.path.basename(os.readlink(revlink))
199 qvar = var 183 qvar = var