summaryrefslogtreecommitdiffstats
path: root/scripts/oe-pkgdata-util
diff options
context:
space:
mode:
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