summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_deb.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/package_deb.bbclass')
-rw-r--r--meta/classes/package_deb.bbclass51
1 files changed, 0 insertions, 51 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index f4b18c36d0..12e01d1d5e 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -10,57 +10,6 @@ DPKG_ARCH ?= "${TARGET_ARCH}"
10 10
11PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs" 11PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
12 12
13python package_deb_fn () {
14 d.setVar('PKGFN', d.getVar('PKG'))
15}
16
17addtask package_deb_install
18python do_package_deb_install () {
19 pkg = d.getVar('PKG', True)
20 pkgfn = d.getVar('PKGFN', True)
21 rootfs = d.getVar('IMAGE_ROOTFS', True)
22 debdir = d.getVar('DEPLOY_DIR_DEB', True)
23 apt_config = d.expand('${STAGING_ETCDIR_NATIVE}/apt/apt.conf')
24 stagingbindir = d.getVar('STAGING_BINDIR_NATIVE', True)
25 tmpdir = d.getVar('TMPDIR', True)
26
27 if None in (pkg,pkgfn,rootfs):
28 raise bb.build.FuncFailed("missing variables (one or more of PKG, PKGFN, IMAGE_ROOTFS)")
29 try:
30 if not os.exists(rootfs):
31 os.makedirs(rootfs)
32 os.chdir(rootfs)
33 except OSError:
34 import sys
35 raise bb.build.FuncFailed(str(sys.exc_value))
36
37 # update packages file
38 (exitstatus, output) = commands.getstatusoutput('dpkg-scanpackages %s > %s/Packages' % (debdir, debdir))
39 if (exitstatus != 0 ):
40 raise bb.build.FuncFailed(output)
41
42 f = open(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"), "w")
43 f.close()
44
45 # NOTE: this env stuff is racy at best, we need something more capable
46 # than 'commands' for command execution, which includes manipulating the
47 # env of the fork+execve'd processs
48
49 # Set up environment
50 apt_config_backup = os.getenv('APT_CONFIG')
51 os.putenv('APT_CONFIG', apt_config)
52 path = os.getenv('PATH')
53 os.putenv('PATH', '%s:%s' % (stagingbindir, os.getenv('PATH')))
54
55 # install package
56 commands.getstatusoutput('apt-get update')
57 commands.getstatusoutput('apt-get install -y %s' % pkgfn)
58
59 # revert environment
60 os.putenv('APT_CONFIG', apt_config_backup)
61 os.putenv('PATH', path)
62}
63
64# 13#
65# Update the Packages index files in ${DEPLOY_DIR_DEB} 14# Update the Packages index files in ${DEPLOY_DIR_DEB}
66# 15#