public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Claudius Heine <ch@denx.de>
To: isar-users@googlegroups.com
Cc: Claudius Heine <ch@denx.de>
Subject: [RFC PATCH v2 1/1] meta/dpkg-raw: support for special debian package dependencies
Date: Fri, 15 Dec 2017 09:08:42 +0100	[thread overview]
Message-ID: <20171215080842.4075-2-ch@denx.de> (raw)
In-Reply-To: <20171215080842.4075-1-ch@denx.de>

Now special debian dependencies can be specified in the recipe like
this:

    DEBIAN_DEPENDS = "'libc (>= 2.16)' 'tar | bsdtar' systemd"

and the package contains this 'Depends' entry:

    Depends: libc (>= 2.16), tar | bsdtar, systemd

Signed-off-by: Claudius Heine <ch@denx.de>
---
 meta/classes/dpkg-raw.bbclass | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index 1435e10..60c1170 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -19,6 +19,15 @@ addtask install after do_unpack before do_deb_package_prepare
 # so we can put hooks etc. in there already
 do_install[dirs] = "${D}/DEBIAN"
 
+python () {
+    import re
+    debian_deps = d.getVar("DEBIAN_DEPENDS", True)
+    regex = re.compile(r"'([^']+)'|\"([^\"]+)\"|([^ ]+)")
+    debian_deps_comma = ", ".join([s for m in regex.finditer(debian_deps)
+                                     for s in m.groups() if s])
+    d.setVar("DEBIAN_DEPENDS_COMMA", debian_deps_comma)
+}
+
 do_deb_package_prepare() {
 	cat<<-__EOF__ > ${D}/DEBIAN/control
 		Package: ${PN}
@@ -32,8 +41,7 @@ do_deb_package_prepare() {
 	if [ ${DEBIAN_DEPENDS} != "" ]
 	then
 		echo -n Depends: >> ${D}/DEBIAN/control
-		echo ${DEBIAN_DEPENDS} | tr '[:blank:]' ',' >> \
-			${D}/DEBIAN/control
+		echo " ${DEBIAN_DEPENDS_COMMA}" >> ${D}/DEBIAN/control
 	fi
 	for t in pre post
 	do
-- 
2.14.3


  reply	other threads:[~2017-12-15  8:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15  8:08 [RFC PATCH v2 0/1] Special debian depends entries Claudius Heine
2017-12-15  8:08 ` Claudius Heine [this message]
2017-12-15  8:30 ` Claudius Heine
2018-01-03 16:08   ` Henning Schild
2018-01-09 13:34     ` Alexander Smirnov

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=20171215080842.4075-2-ch@denx.de \
    --to=ch@denx.de \
    --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