summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-11-24 23:06:56 +0000
committerRichard Purdie <richard@openedhand.com>2007-11-24 23:06:56 +0000
commit48c7f7fc85758bad6398b139438ade720724a05e (patch)
tree74ad232631bc2e0d64b178ed1789b2862456d05e
parent1d01a5ef0098de42aac7334a6794d83f91d1f637 (diff)
downloadpoky-48c7f7fc85758bad6398b139438ade720724a05e.tar.gz
package.bbclass: Remove PKGMAPS functionality and supersede with pkgdata. Remove duplicate unneeded PACKAGES checks.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3225 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rw-r--r--meta/classes/debian.bbclass2
-rw-r--r--meta/classes/package.bbclass47
2 files changed, 5 insertions, 44 deletions
diff --git a/meta/classes/debian.bbclass b/meta/classes/debian.bbclass
index a38f10d629..dd0789adae 100644
--- a/meta/classes/debian.bbclass
+++ b/meta/classes/debian.bbclass
@@ -1,5 +1,3 @@
1STAGING_PKGMAPS_DIR = "${STAGING_DIR}/pkgmaps/debian"
2
3# Debian package renaming only occurs when a package is built 1# Debian package renaming only occurs when a package is built
4# We therefore have to make sure we build all runtime packages 2# We therefore have to make sure we build all runtime packages
5# before building the current package to make the packages runtime 3# before building the current package to make the packages runtime
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index c2741d0222..ae5651ad8d 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -34,9 +34,6 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
34 return 34 return
35 35
36 packages = bb.data.getVar('PACKAGES', d, 1).split() 36 packages = bb.data.getVar('PACKAGES', d, 1).split()
37 if not packages:
38 # nothing to do
39 return
40 37
41 if postinst: 38 if postinst:
42 postinst = '#!/bin/sh\n' + postinst + '\n' 39 postinst = '#!/bin/sh\n' + postinst + '\n'
@@ -189,42 +186,16 @@ def runstrip(file, d):
189# Package data handling routines 186# Package data handling routines
190# 187#
191 188
192STAGING_PKGMAPS_DIR ?= "${STAGING_DIR}/pkgmaps"
193
194def add_package_mapping (pkg, new_name, d):
195 import bb, os
196
197 def encode(str):
198 import codecs
199 c = codecs.getencoder("string_escape")
200 return c(str)[0]
201
202 pmap_dir = bb.data.getVar('STAGING_PKGMAPS_DIR', d, 1)
203
204 bb.mkdirhier(pmap_dir)
205
206 data_file = os.path.join(pmap_dir, pkg)
207
208 f = open(data_file, 'w')
209 f.write("%s\n" % encode(new_name))
210 f.close()
211
212def get_package_mapping (pkg, d): 189def get_package_mapping (pkg, d):
213 import bb, os 190 import bb, os
214 191
215 def decode(str): 192 data = read_subpkgdata(pkg, d)
216 import codecs 193 key = "PKG_%s" % pkg
217 c = codecs.getdecoder("string_escape")
218 return c(str)[0]
219 194
220 data_file = bb.data.expand("${STAGING_PKGMAPS_DIR}/%s" % pkg, d) 195 if key in data:
196 bb.msg.plain("Data for %s is %s" % (key, data[key]))
197 return data[key]
221 198
222 if os.access(data_file, os.R_OK):
223 f = file(data_file, 'r')
224 lines = f.readlines()
225 f.close()
226 for l in lines:
227 return decode(l).strip()
228 return pkg 199 return pkg
229 200
230def runtime_mapping_rename (varname, d): 201def runtime_mapping_rename (varname, d):
@@ -258,9 +229,6 @@ python package_do_split_locales() {
258 return 229 return
259 230
260 packages = (bb.data.getVar('PACKAGES', d, 1) or "").split() 231 packages = (bb.data.getVar('PACKAGES', d, 1) or "").split()
261 if not packages:
262 bb.debug(1, "no packages to build; not splitting locales")
263 return
264 232
265 datadir = bb.data.getVar('datadir', d, 1) 233 datadir = bb.data.getVar('datadir', d, 1)
266 if not datadir: 234 if not datadir:
@@ -340,9 +308,6 @@ python populate_packages () {
340 bb.mkdirhier(dvar) 308 bb.mkdirhier(dvar)
341 309
342 packages = bb.data.getVar('PACKAGES', d, 1) 310 packages = bb.data.getVar('PACKAGES', d, 1)
343 if not packages:
344 bb.debug(1, "PACKAGES not defined, nothing to package")
345 return
346 311
347 pn = bb.data.getVar('PN', d, 1) 312 pn = bb.data.getVar('PN', d, 1)
348 if not pn: 313 if not pn:
@@ -445,8 +410,6 @@ python populate_packages () {
445 pkgname = bb.data.getVar('PKG_%s' % pkg, d, 1) 410 pkgname = bb.data.getVar('PKG_%s' % pkg, d, 1)
446 if pkgname is None: 411 if pkgname is None:
447 bb.data.setVar('PKG_%s' % pkg, pkg, d) 412 bb.data.setVar('PKG_%s' % pkg, pkg, d)
448 else:
449 add_package_mapping(pkg, pkgname, d)
450 413
451 dangling_links = {} 414 dangling_links = {}
452 pkg_files = {} 415 pkg_files = {}