Patchwork classes: Remove references to _remove in function names since this may become a bitbake keyword

login
register
mail settings
Submitter Richard Purdie
Date Aug. 24, 2013, 4:01 p.m.
Message ID <1377360080.6762.194.camel@ted>
Download mbox | patch
Permalink /patch/56525/
State Accepted
Commit 93ec1e347cbba47cb35137047ac2ef8875a1c5d1
Headers show

Comments

Richard Purdie - Aug. 24, 2013, 4:01 p.m.
There is a good chance we might want to support a bitbake operator
"_remove" which works in a similar way to _append and _prepend. As
such, we can't use those keywords in function or variable names.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
Otavio Salvador - Aug. 25, 2013, 5:46 p.m.
On Sat, Aug 24, 2013 at 1:01 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> There is a good chance we might want to support a bitbake operator
> "_remove" which works in a similar way to _append and _prepend. As
> such, we can't use those keywords in function or variable names.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Tested-by: Otavio Salvador <otavio@ossystems.com.br>

Patch

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 3d75d8e..e42c419 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -559,11 +559,11 @@  python do_archive_linux_yocto(){
 do_kernel_checkout[postfuncs] += "do_archive_linux_yocto "
 
 # remove tarball for sources, patches and logs after creating srpm.
-python do_remove_tarlist(){
+python do_delete_tarlist(){
     work_dir = d.getVar('WORKDIR', True)
     tarlist = os.path.join(work_dir, 'tar-package')
     if os.path.exists(tarlist):
         os.remove(tarlist)
 }
-do_remove_tarlist[deptask] = "do_archive_scripts_logs"
-do_package_write_rpm[postfuncs] += "do_remove_tarlist "
+do_delete_tarlist[deptask] = "do_archive_scripts_logs"
+do_package_write_rpm[postfuncs] += "do_delete_tarlist "
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 909702a..ea59c36 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -335,7 +335,7 @@  fakeroot do_rootfs () {
 	fi
 
 	# remove unneeded packages/files from the final image
-	rootfs_remove_unneeded
+	rootfs_uninstall_unneeded
 
 	insert_feed_uris
 
@@ -497,7 +497,7 @@  rootfs_install_complementary() {
     fi
 }
 
-rootfs_remove_unneeded () {
+rootfs_uninstall_unneeded () {
 	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
 		if [ -z "$(delayed_postinsts)" ]; then
 			# All packages were successfully configured.
@@ -506,7 +506,7 @@  rootfs_remove_unneeded () {
 			if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
 				remove_run_postinsts=true
 			fi
-			rootfs_remove_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
+			rootfs_uninstall_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
 
 			# Need to remove rc.d files for run-postinsts by hand since opkg won't
 			# call postrm scripts in offline root mode.
diff --git a/meta/classes/recipe_sanity.bbclass b/meta/classes/recipe_sanity.bbclass
index 8b3a1c9..2f90159 100644
--- a/meta/classes/recipe_sanity.bbclass
+++ b/meta/classes/recipe_sanity.bbclass
@@ -57,7 +57,7 @@  def can_use_autotools_base(cfgdata, d):
 
     return True
 
-def can_remove_FILESPATH(cfgdata, d):
+def can_delete_FILESPATH(cfgdata, d):
     expected = cfgdata.get("FILESPATH")
     #expected = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', True).split(':') for p in d.getVar('FILESPATHPKG', True).split(':') for o in (d.getVar('OVERRIDES', True) + ':').split(':') if os.path.exists(os.path.join(fp, p, o))])}:${FILESDIR}"
     expectedpaths = d.expand(expected)
@@ -71,7 +71,7 @@  def can_remove_FILESPATH(cfgdata, d):
             return False
     return expected != unexpanded
 
-def can_remove_FILESDIR(cfgdata, d):
+def can_delete_FILESDIR(cfgdata, d):
     expected = cfgdata.get("FILESDIR")
     #expected = "${@bb.which(d.getVar('FILESPATH', True), '.')}"
     unexpanded = d.getVar("FILESDIR", 0)
@@ -87,7 +87,7 @@  def can_remove_FILESDIR(cfgdata, d):
            (expanded in filespath or
             expanded == d.expand(expected))
 
-def can_remove_others(p, cfgdata, d):
+def can_delete_others(p, cfgdata, d):
     for k in ["S", "PV", "PN", "DESCRIPTION", "DEPENDS",
               "SECTION", "PACKAGES", "EXTRA_OECONF", "EXTRA_OEMAKE"]:
     #for k in cfgdata:
@@ -113,8 +113,8 @@  python do_recipe_sanity () {
     p = "%s %s %s" % (d.getVar("PN", True), d.getVar("PV", True), d.getVar("PR", True))
 
     sanitychecks = [
-        (can_remove_FILESDIR, "candidate for removal of FILESDIR"),
-        (can_remove_FILESPATH, "candidate for removal of FILESPATH"),
+        (can_delete_FILESDIR, "candidate for removal of FILESDIR"),
+        (can_delete_FILESPATH, "candidate for removal of FILESPATH"),
         #(can_use_autotools_base, "candidate for use of autotools_base"),
         (incorrect_nonempty_PACKAGES, "native or cross recipe with non-empty PACKAGES"),
     ]
@@ -124,7 +124,7 @@  python do_recipe_sanity () {
         if func(cfgdata, d):
             __note(msg, d)
 
-    can_remove_others(p, cfgdata, d)
+    can_delete_others(p, cfgdata, d)
     var_renames_overwrite(cfgdata, d)
     req_vars(cfgdata, d)
     bad_runtime_vars(cfgdata, d)
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index dcfe786..0161f7a 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -125,7 +125,7 @@  rootfs_install_packages() {
 	sed -i -e "s/Status: install ok unpacked/Status: install ok installed/;" $INSTALL_ROOTFS_DEB/var/lib/dpkg/status
 }
 
-rootfs_remove_packages() {
+rootfs_uninstall_packages() {
 	# for some reason, --root doesn't really work here... We use --admindir&--instdir instead.
 	${STAGING_BINDIR_NATIVE}/dpkg --admindir=${IMAGE_ROOTFS}/var/lib/dpkg --instdir=${IMAGE_ROOTFS} -r --force-depends $@
 }
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index c9650cb..a37ab14 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -136,7 +136,7 @@  rootfs_install_packages() {
 	opkg-cl ${OPKG_ARGS} install `cat $1`
 }
 
-rootfs_remove_packages() {
+rootfs_uninstall_packages() {
 	opkg-cl ${OPKG_ARGS} --force-depends remove $@
 }
 
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 30b52d4..6c68ac8 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -178,7 +178,7 @@  rootfs_install_packages() {
 	package_install_internal_rpm
 }
 
-rootfs_remove_packages() {
+rootfs_uninstall_packages() {
 	rpm -e --nodeps --root=${IMAGE_ROOTFS} --dbpath=/var/lib/rpm\
 		--define='_cross_scriptlet_wrapper ${WORKDIR}/scriptlet_wrapper'\
 		--define='_tmppath /install/tmp' $@