All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] package.bbclass: add PACKAGE_ADD_METADATA to sstate variables
@ 2020-05-25  7:43 Michael Ho
  2020-05-25  7:43 ` [PATCH 2/5] package_ipk.bbclass: add PACKAGE_ADD_METADATA_IPK " Michael Ho
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Michael Ho @ 2020-05-25  7:43 UTC (permalink / raw)
  To: openembedded-core; +Cc: Michael Ho

From: Michael Ho <Michael.Ho@bmw.de>

The PACKAGE_ADD_METADATA can be used to define additional metadata for
packages. Changes to this variable should affect the packaging sstate hash
so packages are re-generated when this variable changes.

This variable is added to both PKGDATA_VARS and PACKAGEVARS. It is needed
in PACKAGEVARS to ensure changes invoke do_package to re-run. It is needed
in PKGDATA_VARS to ensure changes are written into the pkgdata so that the
hash equiv reports a change and does not skip over the package_write tasks.

Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
---
 meta/classes/package.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 0b5cf47..0af5f66 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1508,7 +1508,7 @@ EXPORT_FUNCTIONS package_name_hook
 
 PKGDESTWORK = "${WORKDIR}/pkgdata"
 
-PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS RPROVIDES RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS SECTION PKG ALLOW_EMPTY FILES CONFFILES FILES_INFO pkg_postinst pkg_postrm pkg_preinst pkg_prerm"
+PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS RPROVIDES RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS SECTION PKG ALLOW_EMPTY FILES CONFFILES FILES_INFO PACKAGE_ADD_METADATA pkg_postinst pkg_postrm pkg_preinst pkg_prerm"
 
 python emit_pkgdata() {
     from glob import glob
@@ -2263,7 +2263,7 @@ python package_depchains() {
 
 # Since bitbake can't determine which variables are accessed during package
 # iteration, we need to list them here:
-PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm pkg_postinst_ontarget INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE SKIP_FILEDEPS PRIVATE_LIBS"
+PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm pkg_postinst_ontarget INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE SKIP_FILEDEPS PRIVATE_LIBS PACKAGE_ADD_METADATA"
 
 def gen_packagevar(d, pkgvars="PACKAGEVARS"):
     ret = []
-- 
2.7.4


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

* [PATCH 2/5] package_ipk.bbclass: add PACKAGE_ADD_METADATA_IPK to sstate variables
  2020-05-25  7:43 [PATCH 1/5] package.bbclass: add PACKAGE_ADD_METADATA to sstate variables Michael Ho
@ 2020-05-25  7:43 ` Michael Ho
  2020-05-25  7:43 ` [PATCH 3/5] package_deb.bbclass: add PACKAGE_ADD_METADATA_DEB " Michael Ho
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ho @ 2020-05-25  7:43 UTC (permalink / raw)
  To: openembedded-core; +Cc: Michael Ho

From: Michael Ho <Michael.Ho@bmw.de>

Add PACKAGE_ADD_METADATA_IPK to IPKEXTRAVARS so it affects the sstate hash
of do_package_write_ipk.

Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
---
 meta/classes/package_ipk.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index c008559..79cb36c 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -238,7 +238,7 @@ def ipk_write_pkg(pkg, d):
         bb.utils.unlockfile(lf)
 
 # Have to list any variables referenced as X_<pkg> that aren't in pkgdata here
-IPKEXTRAVARS = "PRIORITY MAINTAINER PACKAGE_ARCH HOMEPAGE"
+IPKEXTRAVARS = "PRIORITY MAINTAINER PACKAGE_ARCH HOMEPAGE PACKAGE_ADD_METADATA_IPK"
 ipk_write_pkg[vardeps] += "${@gen_packagevar(d, 'IPKEXTRAVARS')}"
 
 # Otherwise allarch packages may change depending on override configuration
-- 
2.7.4


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

* [PATCH 3/5] package_deb.bbclass: add PACKAGE_ADD_METADATA_DEB to sstate variables
  2020-05-25  7:43 [PATCH 1/5] package.bbclass: add PACKAGE_ADD_METADATA to sstate variables Michael Ho
  2020-05-25  7:43 ` [PATCH 2/5] package_ipk.bbclass: add PACKAGE_ADD_METADATA_IPK " Michael Ho
@ 2020-05-25  7:43 ` Michael Ho
  2020-05-25  7:43 ` [PATCH 4/5] package_rpm.bbclass: add PACKAGE_ADD_METADATA_RPM " Michael Ho
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ho @ 2020-05-25  7:43 UTC (permalink / raw)
  To: openembedded-core; +Cc: Michael Ho

From: Michael Ho <Michael.Ho@bmw.de>

Refactor the addition of vardeps for this package class to use DEBEXTRAVARS
and pass the items through gen_packagevar so package name specific overrides
are accounted for. This matches the style used in package_ipk.bbclass.

Additionally add PACKAGE_ADD_METADATA_DEB to the DEBEXTRAVARS list so the
packaging is redone if the variable changes value.

Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
---
 meta/classes/package_deb.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 790b26a..cb723fc 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -283,8 +283,9 @@ def deb_write_pkg(pkg, d):
 # Otherwise allarch packages may change depending on override configuration
 deb_write_pkg[vardepsexclude] = "OVERRIDES"
 
-# Indirect references to these vars
-do_package_write_deb[vardeps] += "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE"
+# Have to list any variables referenced as X_<pkg> that aren't in pkgdata here
+DEBEXTRAVARS = "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE PACKAGE_ADD_METADATA_DEB"
+do_package_write_deb[vardeps] += "${@gen_packagevar(d, 'DEBEXTRAVARS')}"
 
 SSTATETASKS += "do_package_write_deb"
 do_package_write_deb[sstate-inputdirs] = "${PKGWRITEDIRDEB}"
-- 
2.7.4


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

* [PATCH 4/5] package_rpm.bbclass: add PACKAGE_ADD_METADATA_RPM to sstate variables
  2020-05-25  7:43 [PATCH 1/5] package.bbclass: add PACKAGE_ADD_METADATA to sstate variables Michael Ho
  2020-05-25  7:43 ` [PATCH 2/5] package_ipk.bbclass: add PACKAGE_ADD_METADATA_IPK " Michael Ho
  2020-05-25  7:43 ` [PATCH 3/5] package_deb.bbclass: add PACKAGE_ADD_METADATA_DEB " Michael Ho
@ 2020-05-25  7:43 ` Michael Ho
  2020-05-25  7:43 ` [PATCH 5/5] ref-manual: add PACKAGE_ADD_METADATA documentation Michael Ho
  2020-05-25  8:02 ` ✗ patchtest: failure for "package.bbclass: add PACKAGE_A..." and 4 more Patchwork
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ho @ 2020-05-25  7:43 UTC (permalink / raw)
  To: openembedded-core; +Cc: Michael Ho

From: Michael Ho <Michael.Ho@bmw.de>

Refactor the addition of vardeps for this package class to use RPMEXTRAVARS
and pass the items through gen_packagevar so package name specific overrides
are accounted for. This matches the style used in package_ipk.bbclass. Since
do_package_write_rpm does not have any "extra vars" that affect the rpm
packaging yet, this commit has to add the variable.

This refactoring is needed to add PACKAGE_ADD_METADATA_RPM to RPMEXTRAVARS
so it affects the sstate hash of do_package_write_rpm.

Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
---
 meta/classes/package_rpm.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 9145717..9a4be2e 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -621,6 +621,10 @@ python write_specfile () {
 # Otherwise allarch packages may change depending on override configuration
 write_specfile[vardepsexclude] = "OVERRIDES"
 
+# Have to list any variables referenced as X_<pkg> that aren't in pkgdata here
+RPMEXTRAVARS = "PACKAGE_ADD_METADATA_RPM"
+write_specfile[vardeps] += "${@gen_packagevar(d, 'RPMEXTRAVARS')}"
+
 python do_package_rpm () {
     workdir = d.getVar('WORKDIR')
     tmpdir = d.getVar('TMPDIR')
-- 
2.7.4


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

* [PATCH 5/5] ref-manual: add PACKAGE_ADD_METADATA documentation
  2020-05-25  7:43 [PATCH 1/5] package.bbclass: add PACKAGE_ADD_METADATA to sstate variables Michael Ho
                   ` (2 preceding siblings ...)
  2020-05-25  7:43 ` [PATCH 4/5] package_rpm.bbclass: add PACKAGE_ADD_METADATA_RPM " Michael Ho
@ 2020-05-25  7:43 ` Michael Ho
  2020-05-25  8:02 ` ✗ patchtest: failure for "package.bbclass: add PACKAGE_A..." and 4 more Patchwork
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Ho @ 2020-05-25  7:43 UTC (permalink / raw)
  To: openembedded-core; +Cc: Michael Ho

From: Michael Ho <Michael.Ho@bmw.de>

Add a basic variable definition and a small section to the development
tasks manual for using PACKAGE_ADD_METADATA to add custom metadata to
packages.

Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
---
 .../dev-manual/dev-manual-common-tasks.xml         | 58 ++++++++++++++++++++++
 documentation/ref-manual/ref-variables.xml         | 34 +++++++++++++
 2 files changed, 92 insertions(+)

diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml
index e9ce182..605d1ad 100644
--- a/documentation/dev-manual/dev-manual-common-tasks.xml
+++ b/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -9057,6 +9057,9 @@
                 <listitem><para>
                     <link linkend='creating-node-package-manager-npm-packages'>Creating node package manager (NPM) packages</link>
                     </para></listitem>
+                <listitem><para>
+                    <link linkend='adding-custom-metadata-to-packages'>Adding custom metadata to packages</link>
+                    </para></listitem>
             </itemizedlist>
         </para>
 
@@ -10761,6 +10764,61 @@
                 </para>
             </section>
         </section>
+
+        <section id='adding-custom-metadata-to-packages'>
+            <title>Adding custom metadata to packages</title>
+
+            <para>
+                The variable <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ADD_METADATA'><filename>PACKAGE_ADD_METADATA</filename></ulink>
+                can be used to add additional metadata to packages. This is
+                reflected in the package control/spec file. To take the ipk
+                format for example, the CONTROL file stored inside would
+                contain the additional metadata as additional lines.
+            </para>
+
+            <para>
+                The variable can be used in multiple ways, including using
+                suffixes to set it for a specific package type and/or package.
+                Note that the order of precedence is the same as this list:
+                <itemizedlist>
+                    <listitem><para>
+                        <filename>PACKAGE_ADD_METADATA_&lt;PKGTYPE&gt;_&lt;PN&gt;</filename>
+                    </para></listitem>
+                    <listitem><para>
+                        <filename>PACKAGE_ADD_METADATA_&lt;PKGTYPE&gt;</filename>
+                    </para></listitem>
+                    <listitem><para>
+                        <filename>PACKAGE_ADD_METADATA_&lt;PN&gt;</filename>
+                    </para></listitem>
+                    <listitem><para>
+                        <filename>PACKAGE_ADD_METADATA</filename>
+                    </para></listitem>
+                </itemizedlist>
+                &lt;PKGTYPE&gt; is a parameter and expected to be a
+                distinct name of specific package type:
+                <itemizedlist>
+                    <listitem><para>IPK for .ipk packages</para></listitem>
+                    <listitem><para>DEB for .deb packages</para></listitem>
+                    <listitem><para>RPM for .rpm packages</para></listitem>
+                </itemizedlist>
+                &lt;PN&gt; is a parameter and expected to be a package name.
+            </para>
+
+            <para>
+                The variable can contain multiple [one-line] metadata fields
+                separated by the literal sequence '\n'. The separator can be
+                redefined using the variable flag <filename>separator</filename>.
+            </para>
+
+            <para>
+                The following is an example that adds two custom fields for
+                ipk packages:
+                <literallayout class='monospaced'>
+    PACKAGE_ADD_METADATA_IPK = "Vendor: CustomIpk\nGroup: Applications/Spreadsheets"
+                </literallayout>
+            </para>
+        </section>
+
     </section>
 
     <section id='efficiently-fetching-source-files-during-a-build'>
diff --git a/documentation/ref-manual/ref-variables.xml b/documentation/ref-manual/ref-variables.xml
index 364cd09..657f6cf 100644
--- a/documentation/ref-manual/ref-variables.xml
+++ b/documentation/ref-manual/ref-variables.xml
@@ -9539,6 +9539,40 @@
             </glossdef>
         </glossentry>
 
+        <glossentry id='var-PACKAGE_ADD_METADATA'><glossterm>PACKAGE_ADD_METADATA</glossterm>
+            <info>
+                PACKAGE_ADD_METADATA[doc] = "This variable defines additional metadata to add to packages."
+            </info>
+            <glossdef>
+                <para role="glossdeffirst">
+<!--                <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+                    This variable defines additional metdata to add to packages.
+                </para>
+
+                <para>
+                    You may find you need to inject additional metadata into
+                    packages. This variable allows you to do that by setting
+                    the injected data as the value. Multiple fields can be
+                    added by splitting the content with the literal separator
+                    "\n".
+                </para>
+
+                <para>
+                    The suffixes '_IPK', '_DEB', or '_RPM' can be applied to
+                    the variable to do package type specific settings. It can
+                    also be made package specific by using the package name as
+                    a suffix.
+                </para>
+
+                <para>
+                    You can find out more about applying this variable in
+                    the
+                    "<ulink url='&YOCTO_DOCS_DEV_URL;#adding-custom-metadata-to-packages'>Adding custom metadata to packages</ulink>"
+                    section in the Yocto Project Development Tasks Manual.
+                </para>
+            </glossdef>
+        </glossentry>
+
         <glossentry id='var-PACKAGE_ARCH'><glossterm>PACKAGE_ARCH</glossterm>
             <info>
                 PACKAGE_ARCH[doc] = "The architecture of the resulting package or packages."
-- 
2.7.4


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

* ✗ patchtest: failure for "package.bbclass: add PACKAGE_A..." and 4 more
  2020-05-25  7:43 [PATCH 1/5] package.bbclass: add PACKAGE_ADD_METADATA to sstate variables Michael Ho
                   ` (3 preceding siblings ...)
  2020-05-25  7:43 ` [PATCH 5/5] ref-manual: add PACKAGE_ADD_METADATA documentation Michael Ho
@ 2020-05-25  8:02 ` Patchwork
  4 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2020-05-25  8:02 UTC (permalink / raw)
  To: Michael Ho; +Cc: openembedded-core

== Series Details ==

Series: "package.bbclass: add PACKAGE_A..." and 4 more
Revision: 1
URL   : https://patchwork.openembedded.org/series/24303/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists [test_target_mailing_list] 
  Suggested fix    Send the series again to the correct mailing list (ML)
  Suggested ML     yocto@yoctoproject.org [http://git.yoctoproject.org/cgit/cgit.cgi/yocto-docs/]
  Patch's path:    documentation/dev-manual/dev-manual-common-tasks.xml

* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at eb8ae6702a)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe


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

end of thread, other threads:[~2020-05-25  8:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25  7:43 [PATCH 1/5] package.bbclass: add PACKAGE_ADD_METADATA to sstate variables Michael Ho
2020-05-25  7:43 ` [PATCH 2/5] package_ipk.bbclass: add PACKAGE_ADD_METADATA_IPK " Michael Ho
2020-05-25  7:43 ` [PATCH 3/5] package_deb.bbclass: add PACKAGE_ADD_METADATA_DEB " Michael Ho
2020-05-25  7:43 ` [PATCH 4/5] package_rpm.bbclass: add PACKAGE_ADD_METADATA_RPM " Michael Ho
2020-05-25  7:43 ` [PATCH 5/5] ref-manual: add PACKAGE_ADD_METADATA documentation Michael Ho
2020-05-25  8:02 ` ✗ patchtest: failure for "package.bbclass: add PACKAGE_A..." and 4 more Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.