public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta/dpkg-raw: do_install into a fresh directory every time
@ 2018-11-14 15:39 Henning Schild
  2018-11-14 16:00 ` Jan Kiszka
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Henning Schild @ 2018-11-14 15:39 UTC (permalink / raw)
  To: isar-users; +Cc: Jan Kiszka, Henning Schild

Permission problems revealed that we always packaged the sum of possibly
many rebuilds and maybe recipe versions. do_install should always start
working on an empty $D to ensure that the package only contains output
of the current build.

Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/dpkg-raw.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index d662422..968e28d 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -8,13 +8,21 @@ MAINTAINER ?= "FIXME Unknown maintainer"
 
 D = "${WORKDIR}/image/"
 
+# make sure we start with a fresh ${D} every single time
+do_fresh_image() {
+	sudo rm -rf ${D}
+}
+
+do_fresh_image[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
+addtask fresh_image after do_unpack before do_install
+
 # Populate folder that will be picked up as package
 do_install() {
 	bbnote "Put your files for this package in ${D}"
 }
 
 do_install[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-addtask install after do_unpack before do_prepare_build
+addtask install after do_fresh_image before do_prepare_build
 
 deb_package_prepare() {
 	sudo rm -rf ${D}/DEBIAN
-- 
2.19.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-23  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 15:39 [PATCH] meta/dpkg-raw: do_install into a fresh directory every time Henning Schild
2018-11-14 16:00 ` Jan Kiszka
2018-11-15  8:25 ` Henning Schild
2018-11-15 16:41   ` Henning Schild
2018-11-15 16:57 ` [PATCH v2] " Henning Schild
2018-11-23  9:46 ` [PATCH] " Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox