summaryrefslogtreecommitdiff
path: root/classes/package_tar.oeclass
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2004-12-07 22:05:47 +0000
committerChris Larson <clarson@kergoth.com>2004-12-07 22:05:47 +0000
commita780643c4b6aa11e1a36965a69df7116477c7b4c (patch)
tree17e81e77bde19931facf9b30fa5b5981df796071 /classes/package_tar.oeclass
parent88cce8db7ebf88ab9da2366a2ac21a5a723340b8 (diff)
Merge oe-devel@oe-devel.bkbits.net:packages.bb
into handhelds.org:/home/kergoth/code/packages.bb 2004/12/07 04:58:25-06:00 ti.com!kergoth More updates per the core rename. 2004/12/07 04:46:51-06:00 ti.com!kergoth Update soundtracker per the core rename. 2004/12/07 04:44:14-06:00 ti.com!kergoth Merge 2004/12/07 04:42:38-06:00 ti.com!kergoth Updates per the recent rename of the oe core from 'oe' to 'bitbake'. BKrev: 41b6293b91LRHSxMOt6WnrZVAdLbFw
Diffstat (limited to 'classes/package_tar.oeclass')
-rw-r--r--classes/package_tar.oeclass100
1 files changed, 0 insertions, 100 deletions
diff --git a/classes/package_tar.oeclass b/classes/package_tar.oeclass
deleted file mode 100644
index 02e74bc8ad..0000000000
--- a/classes/package_tar.oeclass
+++ /dev/null
@@ -1,100 +0,0 @@
-inherit package
-
-python package_tar_fn () {
- import os
- from oe import data
- fn = os.path.join(oe.data.getVar('DEPLOY_DIR_TAR', d), "%s-%s-%s.tar.gz" % (oe.data.getVar('PKG', d), oe.data.getVar('PV', d), oe.data.getVar('PR', d)))
- fn = oe.data.expand(fn, d)
- oe.data.setVar('PKGFN', fn, d)
-}
-
-python package_tar_install () {
- import os, sys
- pkg = oe.data.getVar('PKG', d, 1)
- pkgfn = oe.data.getVar('PKGFN', d, 1)
- rootfs = oe.data.getVar('IMAGE_ROOTFS', d, 1)
-
- if None in (pkg,pkgfn,rootfs):
- oe.error("missing variables (one or more of PKG, PKGFN, IMAGEROOTFS)")
- raise oe.build.FuncFailed
- try:
- oe.mkdirhier(rootfs)
- os.chdir(rootfs)
- except OSError:
- (type, value, traceback) = sys.exc_info()
- print value
- raise oe.build.FuncFailed
-
- if not os.access(pkgfn, os.R_OK):
- oe.debug(1, "%s does not exist, skipping" % pkgfn)
- raise oe.build.FuncFailed
-
- ret = os.system('zcat %s | tar -xf -' % pkgfn)
- if ret != 0:
- raise oe.build.FuncFailed
-}
-
-python do_package_tar () {
- workdir = oe.data.getVar('WORKDIR', d, 1)
- if not workdir:
- oe.error("WORKDIR not defined, unable to package")
- return
-
- import os # path manipulations
- outdir = oe.data.getVar('DEPLOY_DIR_TAR', d, 1)
- if not outdir:
- oe.error("DEPLOY_DIR_TAR not defined, unable to package")
- return
- oe.mkdirhier(outdir)
-
- dvar = oe.data.getVar('D', d, 1)
- if not dvar:
- oe.error("D not defined, unable to package")
- return
- oe.mkdirhier(dvar)
-
- packages = oe.data.getVar('PACKAGES', d, 1)
- if not packages:
- oe.debug(1, "PACKAGES not defined, nothing to package")
- return
-
- for pkg in packages.split():
- from copy import copy, deepcopy
- localdata = deepcopy(d)
- root = "%s/install/%s" % (workdir, pkg)
-
- oe.data.setVar('ROOT', '', localdata)
- oe.data.setVar('ROOT_%s' % pkg, root, localdata)
- oe.data.setVar('PKG', pkg, localdata)
-
- overrides = oe.data.getVar('OVERRIDES', localdata)
- if not overrides:
- raise oe.build.FuncFailed('OVERRIDES not defined')
- overrides = oe.data.expand(overrides, localdata)
- oe.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata)
-
- oe.data.update_data(localdata)
-# stuff
- root = oe.data.getVar('ROOT', localdata)
- oe.mkdirhier(root)
- basedir = os.path.dirname(root)
- pkgoutdir = outdir
- oe.mkdirhier(pkgoutdir)
- oe.build.exec_func('package_tar_fn', localdata)
- tarfn = oe.data.getVar('PKGFN', localdata, 1)
-# if os.path.exists(tarfn):
-# del localdata
-# continue
- os.chdir(root)
- from glob import glob
- if not glob('*'):
- oe.note("Not creating empty archive for %s-%s-%s" % (pkg, oe.data.getVar('PV', localdata, 1), oe.data.getVar('PR', localdata, 1)))
- continue
- ret = os.system("tar -czvf %s %s" % (tarfn, '.'))
- if ret != 0:
- oe.error("Creation of tar %s failed." % tarfn)
-# end stuff
- del localdata
-}
-
-addtask package_tar after do_package before do_build