public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH] dpkg: warn when S equals WORKDIR
Date: Mon, 29 Apr 2019 13:06:58 +0200	[thread overview]
Message-ID: <20190429110658.16212-1-henning.schild@siemens.com> (raw)

From: Henning Schild <henning.schild@siemens.com>

This patch does not change any logic, it just introduces a warning. If S
is not a directory inside WORKDIR do_deploy_deb and repo_clean will not
actually find any "*.deb" because they remain inside buildchroot.
Finding debs relative to BUILDROOT instead of S would require mounting
and locking. Intead of doing all of that document the small
limitation/assumption with a warning.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/dpkg-base.bbclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 742b8ad..e31dd8d 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -45,9 +45,12 @@ do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
 do_apt_fetch[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
 
 def get_package_srcdir(d):
-    s = d.getVar("S", True)
-    workdir = d.getVar("WORKDIR", True)
-    if s.startswith(workdir):
+    s = os.path.abspath(d.getVar("S", True))
+    workdir = os.path.abspath(d.getVar("WORKDIR", True))
+    if os.path.commonpath([s, workdir]) == workdir:
+        if s == workdir:
+            bb.warn('S is not a subdir of WORKDIR debian package operations' +
+                    ' will not work for this recipe.')
         return s[len(workdir)+1:]
     bb.warn('S does not start with WORKDIR')
     return s
-- 
2.21.0


             reply	other threads:[~2019-04-29 11:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 11:06 Henning Schild [this message]
2019-05-14 12:42 ` Maxim Yu. Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190429110658.16212-1-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox