Skip to contentSkip to conversation

package_rpm/dev/ipk/tar: Drop unused functions

PATCH New Richard Purdie 1 participant 1 message Feb 17, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

meta/classes/package_deb.bbclass +0 -51
index f4b18c3..12e01d1 100644
@@ -10,57 +10,6 @@ DPKG_ARCH ?= "${TARGET_ARCH}"
 
 PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
 
-python package_deb_fn () {
-    d.setVar('PKGFN', d.getVar('PKG'))
-}
-
-addtask package_deb_install
-python do_package_deb_install () {
-    pkg = d.getVar('PKG', True)
-    pkgfn = d.getVar('PKGFN', True)
-    rootfs = d.getVar('IMAGE_ROOTFS', True)
-    debdir = d.getVar('DEPLOY_DIR_DEB', True)
-    apt_config = d.expand('${STAGING_ETCDIR_NATIVE}/apt/apt.conf')
-    stagingbindir = d.getVar('STAGING_BINDIR_NATIVE', True)
-    tmpdir = d.getVar('TMPDIR', True)
-
-    if None in (pkg,pkgfn,rootfs):
-        raise bb.build.FuncFailed("missing variables (one or more of PKG, PKGFN, IMAGE_ROOTFS)")
-    try:
-        if not os.exists(rootfs):
-            os.makedirs(rootfs)
-        os.chdir(rootfs)
-    except OSError:
-        import sys
-        raise bb.build.FuncFailed(str(sys.exc_value))
-
-    # update packages file
-    (exitstatus, output) = commands.getstatusoutput('dpkg-scanpackages %s > %s/Packages' % (debdir, debdir))
-    if (exitstatus != 0 ):
-        raise bb.build.FuncFailed(output)
-
-    f = open(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"), "w")
-    f.close()
-
-    # NOTE: this env stuff is racy at best, we need something more capable
-    # than 'commands' for command execution, which includes manipulating the
-    # env of the fork+execve'd processs
-
-    # Set up environment
-    apt_config_backup = os.getenv('APT_CONFIG')
-    os.putenv('APT_CONFIG', apt_config)
-    path = os.getenv('PATH')
-    os.putenv('PATH', '%s:%s' % (stagingbindir, os.getenv('PATH')))
-
-    # install package
-    commands.getstatusoutput('apt-get update')
-    commands.getstatusoutput('apt-get install -y %s' % pkgfn)
-
-    # revert environment
-    os.putenv('APT_CONFIG', apt_config_backup)
-    os.putenv('PATH', path)
-}
-
 #
 # Update the Packages index files in ${DEPLOY_DIR_DEB}
 #
meta/classes/package_ipk.bbclass +0 -56

62 lines not on this page · raw message

meta/classes/package_rpm.bbclass +0 -8
index e85e027..a0715fe 100644
@@ -8,14 +8,6 @@ RPMBUILD="rpmbuild"
 PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms"
 PKGWRITEDIRSRPM = "${DEPLOY_DIR}/sources/deploy-srpm"
 
-python package_rpm_fn () {
-    d.setVar('PKGFN', d.getVar('PKG'))
-}
-
-python package_rpm_install () {
-    bb.fatal("package_rpm_install not implemented!")
-}
-
 #
 # Update the packages indexes ${DEPLOY_DIR_RPM}
 #
meta/classes/package_tar.bbclass +0 -27
index e76ce29..aaa3ca6 100644
@@ -3,36 +3,9 @@ inherit package
 IMAGE_PKGTYPE ?= "tar"
 
 python package_tar_fn () {
 	fn = os.path.join(d.getVar('DEPLOY_DIR_TAR'), "%s-%s-%s.tar.gz" % (d.getVar('PKG'), d.getVar('PKGV'), d.getVar('PKGR')))
 	fn = d.expand(fn)
 	d.setVar('PKGFN', fn)
-}
-
-python package_tar_install () {
-	import subprocess
-	pkg = d.getVar('PKG', True)
-	pkgfn = d.getVar('PKGFN', True)
-	rootfs = d.getVar('IMAGE_ROOTFS', True)
-
-	if None in (pkg,pkgfn,rootfs):
-		bb.error("missing variables (one or more of PKG, PKGFN, IMAGEROOTFS)")
-		raise bb.build.FuncFailed
-	try:
-		bb.mkdirhier(rootfs)
-		os.chdir(rootfs)
-	except OSError:
-		import sys
-		(type, value, traceback) = sys.exc_info()
-		print value
-		raise bb.build.FuncFailed
-
-	if not os.access(pkgfn, os.R_OK):
-		bb.debug(1, "%s does not exist, skipping" % pkgfn)
-		raise bb.build.FuncFailed
-
-	ret = subprocess.call('zcat %s | tar -xf -' % pkgfn, shell=True)
-	if ret != 0:
-		raise bb.build.FuncFailed
 }
 
 python do_package_tar () {