Skip to contentSkip to conversation

ref-manual: Clarify recommended operator for PROVIDES

PATCH Superseded Joshua Watt 3 participants 5 messages Jan 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ref-manual: Clarify recommended operator for PROVIDES

Updates the documentation for PROVIDES so that it recommends "+=" instead of "=".

---
 documentation/ref-manual/variables.rst | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
documentation/ref-manual/variables.rst +5 -11
index 4ce264813..2ea0cc36c 100644
@@ -5915,23 +5915,17 @@ system and gives an overview of their function and contents.
       file ``eudev_3.2.9.bb``:
       ::
 
-         PROVIDES = "udev"
+         PROVIDES += "udev"
 
       The ``PROVIDES`` statement
       results in the "eudev" recipe also being available as simply "udev".
 
       .. note::
 
-         Given that a recipe's own recipe name is already implicitly in its
-         own PROVIDES list, it is unnecessary to add aliases with the "+=" operator;
-         using a simple assignment will be sufficient. In other words,
-         while you could write:
-         ::
-
-                 PROVIDES += "udev"
-
-
-         in the above, the "+=" is overkill and unnecessary.
+         A recipe's own recipe name (:term:`${PN}`) is always implicitly
+         included in the recipe aliases, so while using "+=" in the above
+         example may not be strictly necessary it is recommend to avoid
+         confusion.
 
       In addition to providing recipes under alternate names, the
       ``PROVIDES`` mechanism is also used to implement virtual targets. A
Signature · 1 line
2.30.0
#1 lore raw
Quoted 27 lines · Joshua Watt

Updates the documentation for PROVIDES so that it recommends "+=" instead of "=".

---
 documentation/ref-manual/variables.rst | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
documentation/ref-manual/variables.rst +1 -4
index 4ce264813..2ea0cc36c 100644
@@ -5915,23 +5915,17 @@ system and gives an overview of their function and contents.
       file ``eudev_3.2.9.bb``:
       ::
 
-         PROVIDES = "udev"
+         PROVIDES += "udev"
 
       The ``PROVIDES`` statement
       results in the "eudev" recipe also being available as simply "udev".
 
       .. note::
 
-         Given that a recipe's own recipe name is already implicitly in its
-         own PROVIDES list, it is unnecessary to add aliases with the "+=" operator;
-         using a simple assignment will be sufficient. In other words,

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 5927

Quoted 10 lines
documentation/ref-manual/variables.rst +3 -7
-         while you could write:
-         ::
-
-                 PROVIDES += "udev"
-
-
-         in the above, the "+=" is overkill and unnecessary.
+         A recipe's own recipe name (:term:`${PN}`) is always implicitly
+         included in the recipe aliases, so while using "+=" in the above
+         example may not be strictly necessary it is recommend to avoid

recommended

rday

#2 lore raw
In reply to Joshua Watt

Hi Joshua,

Quoted 26 lines · Joshua Watt

Updates the documentation for PROVIDES so that it recommends "+=" instead of "=".

---
 documentation/ref-manual/variables.rst | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
documentation/ref-manual/variables.rst +1 -3
index 4ce264813..2ea0cc36c 100644
@@ -5915,23 +5915,17 @@ system and gives an overview of their function and contents.
       file ``eudev_3.2.9.bb``:
       ::
 
-         PROVIDES = "udev"
+         PROVIDES += "udev"
 
       The ``PROVIDES`` statement
       results in the "eudev" recipe also being available as simply "udev".
 
       .. note::
 
-         Given that a recipe's own recipe name is already implicitly in its
-         own PROVIDES list, it is unnecessary to add aliases with the "+=" operator;

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 5926

Quoted 10 lines
documentation/ref-manual/variables.rst +2 -8
-         using a simple assignment will be sufficient. In other words,
-         while you could write:
-         ::
-
-                 PROVIDES += "udev"
-
-
-         in the above, the "+=" is overkill and unnecessary.
+         A recipe's own recipe name (:term:`${PN}`) is always implicitly
+         included in the recipe aliases, so while using "+=" in the above

s/included in the recipe aliases/included in its own PROVIDES list/ ?

Just a suggestion.

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 5927

Quoted 1 line
documentation/ref-manual/variables.rst +1 -0
+         example may not be strictly necessary it is recommend to avoid

s/recommend/recommended/

Thanks,
Quentin

#3 lore raw
Quoted 41 lines · Quentin Schulz

Hi Joshua,

Quoted 26 lines · Joshua Watt

Updates the documentation for PROVIDES so that it recommends "+=" instead of "=".

---
  documentation/ref-manual/variables.rst | 16 +++++-----------
  1 file changed, 5 insertions(+), 11 deletions(-)
documentation/ref-manual/variables.rst +1 -3
index 4ce264813..2ea0cc36c 100644
@@ -5915,23 +5915,17 @@ system and gives an overview of their function and contents.
        file ``eudev_3.2.9.bb``:
        ::
 
-         PROVIDES = "udev"
+         PROVIDES += "udev"
 
        The ``PROVIDES`` statement
        results in the "eudev" recipe also being available as simply "udev".
 
        .. note::
 
-         Given that a recipe's own recipe name is already implicitly in its
-         own PROVIDES list, it is unnecessary to add aliases with the "+=" operator;

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 5926

Quoted 10 lines
documentation/ref-manual/variables.rst +2 -8
-         using a simple assignment will be sufficient. In other words,
-         while you could write:
-         ::
-
-                 PROVIDES += "udev"
-
-
-         in the above, the "+=" is overkill and unnecessary.
+         A recipe's own recipe name (:term:`${PN}`) is always implicitly
+         included in the recipe aliases, so while using "+=" in the above

s/included in the recipe aliases/included in its own PROVIDES list/ ?

Quoted 1 line

Just a suggestion.

Hmm, yes. I was trying to avoid saying ${PN} was in PROVIDES because I though it wasn't, but I see that it is (using _prepend).

Quoted 6 lines

documentation/ref-manual/variables.rst system and gives an overview of their function and contents. · line 5927

Quoted 2 lines
documentation/ref-manual/variables.rst +1 -0
+         example may not be strictly necessary it is recommend to avoid

s/recommend/recommended/

Thanks,
Quentin

#4 lore raw

PATCH v2 1/1 ref-manual: Clarify recommended operator for PROVIDES

In reply to Joshua Watt

Updates the documentation for PROVIDES so that it recommends "+=" instead of "=".

---
 documentation/ref-manual/variables.rst | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
documentation/ref-manual/variables.rst +4 -11
index 4ce264813..1bbc5cbca 100644
@@ -5915,23 +5915,16 @@ system and gives an overview of their function and contents.
       file ``eudev_3.2.9.bb``:
       ::
 
-         PROVIDES = "udev"
+         PROVIDES += "udev"
 
       The ``PROVIDES`` statement
       results in the "eudev" recipe also being available as simply "udev".
 
       .. note::
 
-         Given that a recipe's own recipe name is already implicitly in its
-         own PROVIDES list, it is unnecessary to add aliases with the "+=" operator;
-         using a simple assignment will be sufficient. In other words,
-         while you could write:
-         ::
-
-                 PROVIDES += "udev"
-
-
-         in the above, the "+=" is overkill and unnecessary.
+         A recipe's own recipe name (:term:`PN`) is always implicitly prepended
+         to `PROVIDES`, so while using "+=" in the above example may not be
+         strictly necessary it is recommended to avoid confusion.
 
       In addition to providing recipes under alternate names, the
       ``PROVIDES`` mechanism is also used to implement virtual targets. A
Signature · 1 line
2.30.0