Skip to contentSkip to conversation

fixes for package_foo

PATCH In review Robert Yang 2 participants 5 messages Oct 12, 2016 – Oct 13, 2016

lore
Share & tools
lore
#0 lore raw

cover fixes for package_foo

The following changes since commit 1a2311c8fa9a3703568cd390c44639fe3335023e:

build-appliance-image: Update to master head revision (2016-10-11 23:43:20 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/package
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/package

Robert Yang (2):
package_tar: avoid chdir warnings and restore cwd after packaging package_ipk/rpm/deb: remove unneeded dir settings

 meta/classes/package_deb.bbclass | 1 -
 meta/classes/package_ipk.bbclass | 1 -
 meta/classes/package_rpm.bbclass | 1 -
 meta/classes/package_tar.bbclass | 5 +++++
 4 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.9.0
#1 lore raw

PATCH 1/2 package_tar: avoid chdir warnings and restore cwd after packaging

Fixed:
WARNING: attr-2.4.47-r0 do_package_write_tar: Task do_package_tar changed cwd to /path/to/attr/2.4.47-r0/packages-split/attr-locale-sv

---
 meta/classes/package_tar.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes/package_tar.bbclass +5 -0
index 854e645..e217814 100644
@@ -4,6 +4,9 @@ IMAGE_PKGTYPE ?= "tar"
 
 python do_package_tar () {
     import subprocess
+
+    oldcwd = os.getcwd()
+
     workdir = d.getVar('WORKDIR', True)
     if not workdir:
         bb.error("WORKDIR not defined, unable to package")
@@ -49,6 +52,8 @@ python do_package_tar () {
         ret = subprocess.call(args + [tarfn] + dlist)
         if ret != 0:
             bb.error("Creation of tar %s failed." % tarfn)
+
+    os.chdir(oldcwd)
 }
 
 python () {
Signature · 1 line
2.9.0
#2 lore raw

PATCH 2/2 package_ipk/rpm/deb: remove unneeded dir settings

In reply to Robert Yang

There is a do_package_write_foo[cleandirs], so the do_package_write_foo[dirs] is not needed.

---
 meta/classes/package_deb.bbclass | 1 -
 meta/classes/package_ipk.bbclass | 1 -
 meta/classes/package_rpm.bbclass | 1 -
 3 files changed, 3 deletions(-)
meta/classes/package_deb.bbclass +0 -1
index fb6034c..8a2cc7e 100644
@@ -348,7 +348,6 @@ python do_package_write_deb () {
     bb.build.exec_func("read_subpackage_metadata", d)
     bb.build.exec_func("do_package_deb", d)
 }
-do_package_write_deb[dirs] = "${PKGWRITEDIRDEB}"
 do_package_write_deb[cleandirs] = "${PKGWRITEDIRDEB}"
 do_package_write_deb[umask] = "022"
 addtask package_write_deb after do_packagedata do_package
meta/classes/package_ipk.bbclass +0 -1
index eb00932..d280513 100644
@@ -288,7 +288,6 @@ python do_package_write_ipk () {
     bb.build.exec_func("read_subpackage_metadata", d)
     bb.build.exec_func("do_package_ipk", d)
 }
-do_package_write_ipk[dirs] = "${PKGWRITEDIRIPK}"
 do_package_write_ipk[cleandirs] = "${PKGWRITEDIRIPK}"
 do_package_write_ipk[umask] = "022"
 addtask package_write_ipk after do_packagedata do_package
meta/classes/package_rpm.bbclass +0 -1
index c431545..817739d 100644
@@ -763,7 +763,6 @@ python do_package_write_rpm () {
     bb.build.exec_func("do_package_rpm", d)
 }
 
-do_package_write_rpm[dirs] = "${PKGWRITEDIRRPM}"
 do_package_write_rpm[cleandirs] = "${PKGWRITEDIRRPM}"
 do_package_write_rpm[umask] = "022"
 addtask package_write_rpm after do_packagedata do_package
Signature · 1 line
2.9.0
#3 lore raw

Re: [PATCH 2/2] package_ipk/rpm/deb: remove unneeded dir settings

Quoted 3 lines · Robert Yang

There is a do_package_write_foo[cleandirs], so the do_package_write_foo[dirs] is not needed.

[dirs] changes the cwd whereas [cleandirs] doesn't, so assuming that you've verified this isn't a problem the message should explain that the tasks chdir() themselves.

Ross

#4 lore raw

Re: [PATCH 2/2] package_ipk/rpm/deb: remove unneeded dir settings

Quoted 11 lines · Ross

On 12 October 2016 at 10:19, Robert Yang <[email protected] <mailto:[email protected]>> wrote:

There is a do_package_write_foo[cleandirs], so the do_package_write_foo[dirs] is not needed.

[dirs] changes the cwd whereas [cleandirs] doesn't, so assuming that you've verified this isn't a problem the message should explain that the tasks chdir() themselves.

Thanks, I've verified that it works well after remove the [dirs], but since it does make sense (change the cwd), so I think that we'd better not remove them and drop this patch ?

// Robert

Quoted 2 lines

Ross