summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-17 09:00:29 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-17 22:32:03 (GMT)
commitba110d3b696738efa47fd7df65867567e8224c3b (patch)
treea48869014e4ac771371a64d625beefd8289a4faa
parent74938e387c19c7b72e1553d4148a58a5a3d1ceff (diff)
downloadpoky-ba110d3b696738efa47fd7df65867567e8224c3b.tar.gz
package_rpm/dev/ipk/tar: Drop unused functions
The package_xxx_install functions date from a different era and are not used by anything. In the rpm case, they're simply unimplemented, in the tar case they're using broken whitespace and deprecated functions. We might as well clean out the old broken unused code. (From OE-Core rev: 3684036213c9b1c27389260b7a1e3441c6bd659d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package_deb.bbclass51
-rw-r--r--meta/classes/package_ipk.bbclass56
-rw-r--r--meta/classes/package_rpm.bbclass8
-rw-r--r--meta/classes/package_tar.bbclass27
4 files changed, 0 insertions, 142 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index f4b18c3..12e01d1 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#
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 526c3ae..094ba09 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -14,62 +14,6 @@ OPKG_ARGS = "-f $INSTALL_CONF_IPK -o $INSTALL_ROOTFS_IPK --force_postinstall --p
14 14
15OPKGLIBDIR = "${localstatedir}/lib" 15OPKGLIBDIR = "${localstatedir}/lib"
16 16
17python package_ipk_fn () {
18 d.setVar('PKGFN', d.getVar('PKG'))
19}
20
21python package_ipk_install () {
22 import subprocess
23
24 pkg = d.getVar('PKG', True)
25 pkgfn = d.getVar('PKGFN', True)
26 rootfs = d.getVar('IMAGE_ROOTFS', True)
27 ipkdir = d.getVar('DEPLOY_DIR_IPK', True)
28 stagingdir = d.getVar('STAGING_DIR', True)
29 tmpdir = d.getVar('TMPDIR', True)
30
31 if None in (pkg,pkgfn,rootfs):
32 raise bb.build.FuncFailed("missing variables (one or more of PKG, PKGFN, IMAGEROOTFS)")
33 try:
34 bb.mkdirhier(rootfs)
35 os.chdir(rootfs)
36 except OSError:
37 import sys
38 (type, value, traceback) = sys.exc_info()
39 print value
40 raise bb.build.FuncFailed
41
42 # Generate ipk.conf if it or the stamp doesnt exist
43 conffile = os.path.join(stagingdir,"ipkg.conf")
44 if not os.access(conffile, os.R_OK):
45 ipkg_archs = d.getVar('PACKAGE_ARCHS')
46 if ipkg_archs is None:
47 bb.error("PACKAGE_ARCHS missing")
48 raise FuncFailed
49 ipkg_archs = ipkg_archs.split()
50 arch_priority = 1
51
52 f = open(conffile,"w")
53 for arch in ipkg_archs:
54 f.write("arch %s %s\n" % ( arch, arch_priority ))
55 arch_priority += 1
56 f.write("src local file:%s" % ipkdir)
57 f.close()
58
59
60 if not os.access(os.path.join(ipkdir,"Packages"), os.R_OK) or not os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),os.R_OK):
61 ret = subprocess.call('opkg-make-index -p %s %s ' % (os.path.join(ipkdir, "Packages"), ipkdir), shell=True)
62 if (ret != 0 ):
63 raise bb.build.FuncFailed
64 f = open(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"),"w")
65 f.close()
66
67 ret = subprocess.call('opkg-cl -o %s -f %s update' % (rootfs, conffile), shell=True)
68 ret = subprocess.call('opkg-cl -o %s -f %s install %s' % (rootfs, conffile, pkgfn), shell=True)
69 if (ret != 0 ):
70 raise bb.build.FuncFailed
71}
72
73package_tryout_install_multilib_ipk() { 17package_tryout_install_multilib_ipk() {
74 #try install multilib 18 #try install multilib
75 multilib_tryout_dirs="" 19 multilib_tryout_dirs=""
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 8eb93ce..dac89a7 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -8,14 +8,6 @@ RPMBUILD="rpmbuild"
8PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms" 8PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms"
9PKGWRITEDIRSRPM = "${DEPLOY_DIR}/sources/deploy-srpm" 9PKGWRITEDIRSRPM = "${DEPLOY_DIR}/sources/deploy-srpm"
10 10
11python package_rpm_fn () {
12 d.setVar('PKGFN', d.getVar('PKG'))
13}
14
15python package_rpm_install () {
16 bb.fatal("package_rpm_install not implemented!")
17}
18
19# 11#
20# Update the packages indexes ${DEPLOY_DIR_RPM} 12# Update the packages indexes ${DEPLOY_DIR_RPM}
21# 13#
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass
index e76ce29..d502847 100644
--- a/meta/classes/package_tar.bbclass
+++ b/meta/classes/package_tar.bbclass
@@ -8,33 +8,6 @@ python package_tar_fn () {
8 d.setVar('PKGFN', fn) 8 d.setVar('PKGFN', fn)
9} 9}
10 10
11python package_tar_install () {
12 import subprocess
13 pkg = d.getVar('PKG', True)
14 pkgfn = d.getVar('PKGFN', True)
15 rootfs = d.getVar('IMAGE_ROOTFS', True)
16
17 if None in (pkg,pkgfn,rootfs):
18 bb.error("missing variables (one or more of PKG, PKGFN, IMAGEROOTFS)")
19 raise bb.build.FuncFailed
20 try:
21 bb.mkdirhier(rootfs)
22 os.chdir(rootfs)
23 except OSError:
24 import sys
25 (type, value, traceback) = sys.exc_info()
26 print value
27 raise bb.build.FuncFailed
28
29 if not os.access(pkgfn, os.R_OK):
30 bb.debug(1, "%s does not exist, skipping" % pkgfn)
31 raise bb.build.FuncFailed
32
33 ret = subprocess.call('zcat %s | tar -xf -' % pkgfn, shell=True)
34 if ret != 0:
35 raise bb.build.FuncFailed
36}
37
38python do_package_tar () { 11python do_package_tar () {
39 import subprocess 12 import subprocess
40 workdir = d.getVar('WORKDIR', True) 13 workdir = d.getVar('WORKDIR', True)