public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] Add support for supplying more types of debian package relationships
@ 2019-09-11  8:41 Dalamagkidis, Konstantinos
  2019-09-11  8:57 ` Jan Kiszka
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Dalamagkidis, Konstantinos @ 2019-09-11  8:41 UTC (permalink / raw)
  To: isar-users; +Cc: Dalamagkidis, Konstantinos

We need to be able to specify other package relationships, such as
Pre-Depends or Provides/Replaces/Conflicts.

This change supports supplying DEBIAN_PREDEPENDS, DEBIAN_REPLACES,
DEBIAN_CONFLICTS and DEBIAN_PROVIDES, as well as bitbake-style RDEPENDS
or RDEPENDS_{PN} variables. The DEBIAN_* take priority.

Signed-off-by: Konstantinos Dalamagkidis <konstantinos.dalamagkidis@siemens.com>
---
 meta/classes/debianize.bbclass | 19 +++++++++++++++++++
 meta/classes/dpkg-raw.bbclass  |  1 -
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
index ad3a98e..26002c5 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -5,6 +5,21 @@
 
 CHANGELOG_V ?= "${PV}"
 
+DEBIAN_DEPENDS ??= "${@deb_get_relationship(d, 'RDEPENDS')}"
+DEBIAN_PREDEPENDS ??= "${@deb_get_relationship(d, 'RPREDEPENDS')}"
+DEBIAN_CONFLICTS ??= "${@deb_get_relationship(d, 'RCONFLICTS')}"
+DEBIAN_REPLACES ??= "${@deb_get_relationship(d, 'RREPLACES')}"
+DEBIAN_PROVIDES ??= "${@deb_get_relationship(d, 'RPROVIDES')}"
+
+def deb_get_relationship(d, relationship):
+    rel = d.getVar(relationship + '_' + d.getVar('PN', True), True)
+    if rel:
+        return rel
+    rel = d.getVar(relationship, True)
+    if rel:
+        return rel
+    return ""
+
 deb_add_changelog() {
 	timestamp=$(find ${S}/ -type f -not -path "${S}/debian/*" -printf "%T@\n"|sort -n -r|head -n 1)
 	if [ -n "${timestamp}" ]; then
@@ -42,6 +57,10 @@ Build-Depends: debhelper (>= ${compat})
 Package: ${PN}
 Architecture: any
 Depends: ${DEBIAN_DEPENDS}
+Pre-Depends: ${DEBIAN_PREDEPENDS}
+Replaces: ${DEBIAN_REPLACES}
+Conflicts: ${DEBIAN_CONFLICTS}
+Provides: ${DEBIAN_PROVIDES}
 Description: ${DESCRIPTION}
 EOF
 }
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index ea03ea4..0c484fc 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -5,7 +5,6 @@
 
 inherit dpkg
 
-DEBIAN_DEPENDS ?= ""
 MAINTAINER ?= "Unknown maintainer <unknown@example.com>"
 
 D = "${S}"
-- 
2.20.1

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

end of thread, other threads:[~2019-10-15 10:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11  8:41 [PATCH] Add support for supplying more types of debian package relationships Dalamagkidis, Konstantinos
2019-09-11  8:57 ` Jan Kiszka
2019-09-11  9:02   ` Jan Kiszka
2019-09-11  9:32   ` Dalamagkidis, Konstantinos
2019-10-14 17:01     ` Henning Schild
2019-10-15 10:38       ` Baurzhan Ismagulov
2019-09-13  8:32   ` Baurzhan Ismagulov
2019-10-14 16:49   ` Henning Schild
2019-09-17  9:07 ` Henning Schild
2019-10-08 11:01 ` Baurzhan Ismagulov
2019-10-08 11:26   ` Jan Kiszka

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