<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/classes/update-alternatives.bbclass, branch yocto-4.0.19</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-4.0.19</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-4.0.19'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2023-05-12T14:04:52+00:00</updated>
<entry>
<title>update-alternatives.bbclass: fix old override syntax</title>
<updated>2023-05-12T14:04:52+00:00</updated>
<author>
<name>Peter Bergin</name>
<email>peter.bergin@windriver.com</email>
</author>
<published>2023-05-02T10:37:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=53e8446fe79e2aaee33ce8f882db5e2a20fe8197'/>
<id>urn:sha1:53e8446fe79e2aaee33ce8f882db5e2a20fe8197</id>
<content type='text'>
Function 'gen_updatealternativesvardeps' still used old override
syntax when fetching variable flags. Update to use ':' instead to match
recipe meta data. This was found by review and no real issue encountered
but it is a bug that affects variable dependencies and can affect rebuilds
as task hashes might not be accurate.

(From OE-Core rev: d5fd577c066fa2fddbd16c286f2dde2883cc7828)

Signed-off-by: Peter Bergin &lt;peter.bergin@windriver.com&gt;
Signed-off-by: Peter Bergin &lt;peter@berginkonsult.se&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 5691f554b2cd50f256a8cbb1d96781e9eb6b930e)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
</content>
</entry>
<entry>
<title>update-alternatives: fix typos</title>
<updated>2023-02-24T16:41:46+00:00</updated>
<author>
<name>Ulrich Ölmann</name>
<email>u.oelmann@pengutronix.de</email>
</author>
<published>2023-02-08T00:01:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=3ad697337df9eaad9d774bdf211b6f40e1cf13e7'/>
<id>urn:sha1:3ad697337df9eaad9d774bdf211b6f40e1cf13e7</id>
<content type='text'>
(From OE-Core rev: 6b6f3cfe8995663b31482e70285863266dfd9d80)

Signed-off-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit d3ca05b072c152b76a86edaaddebabdef312ea95)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>package_rpm/update-alternatives: fix package's provides</title>
<updated>2021-08-22T21:21:46+00:00</updated>
<author>
<name>Chen Qi</name>
<email>Qi.Chen@windriver.com</email>
</author>
<published>2021-08-20T06:59:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0d8f2ed39efc018b231bd1bd340b285bad2348b0'/>
<id>urn:sha1:0d8f2ed39efc018b231bd1bd340b285bad2348b0</id>
<content type='text'>
Currently we have:
  $ rpm -qp --provides tmp/deploy/rpm/core2_64/bash-5.1.8-r0.core2_64.rpm
  bash = 5.1.8-r0

This is incorrect as bash provides /bin/bash and /bin/sh. This is caused by
incomplete conversion of new override syntax, which breaks the per-file
parsing of package_rpm.

With this patch, we have:
  $ rpm -qp --provides tmp/deploy/rpm/core2_64/bash-5.1.8-r0.core2_64.rpm
  /bin/bash
  /bin/sh
  bash = 5.1.8-r0

(From OE-Core rev: f186d32ff8bf176ad0bd8d49e47cdb017c701a46)

Signed-off-by: Chen Qi &lt;Qi.Chen@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Convert to new override syntax</title>
<updated>2021-08-02T14:44:10+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2021-07-28T22:28:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=bb6ddc3691ab04162ec5fd69a2d5e7876713fd15'/>
<id>urn:sha1:bb6ddc3691ab04162ec5fd69a2d5e7876713fd15</id>
<content type='text'>
This is the result of automated script conversion:

scripts/contrib/convert-overrides.py &lt;oe-core directory&gt;

converting the metadata to use ":" as the override character instead of "_".

(From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>classes/lib/scripts: Use bb.utils.rename() instead of os.rename()</title>
<updated>2021-05-06T10:16:23+00:00</updated>
<author>
<name>Devendra Tewari</name>
<email>devendra.tewari@gmail.com</email>
</author>
<published>2021-04-19T14:23:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=b71375304f393db62e0894af66e9a60bb9a5c8cc'/>
<id>urn:sha1:b71375304f393db62e0894af66e9a60bb9a5c8cc</id>
<content type='text'>
Incremental build in Docker fails with:

OSError: [Errno 18] Invalid cross-device link

when source and destination are on different overlay filesystems.

Rather than adding fallback code to every call site, use a new wrapper
in bitbake which detects this case and falls back to shutil.move
which is slower but will handtle the overlay docker filesystems correctly.

[YOCTO #14301]

(From OE-Core rev: 656a65b2b84e7d529b89cf5de7eb838f902d84a2)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>update-alternatives.bbclass: run update-alternatives firstly in postinst script</title>
<updated>2019-06-27T11:20:36+00:00</updated>
<author>
<name>Robert Yang</name>
<email>liezhi.yang@windriver.com</email>
</author>
<published>2019-06-26T07:40:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8d22a45cdd97e14e1c8f9f0410406c4c1e0a0950'/>
<id>urn:sha1:8d22a45cdd97e14e1c8f9f0410406c4c1e0a0950</id>
<content type='text'>
Recipes like postfix run command newaliases in postinst, but newaliases is
installed as newaliases.postfix, it needs run update-alternatives to update it
to newaliases, so there was an error when installed postinst on target.

Fixed:
$ opkg install postfix
Configuring postfix.
///var/lib/opkg/info/postfix.postinst: line 4: newaliases: command not found

Run update-alternatives firstly will fix the problem.

(From OE-Core rev: 52c36dd869c605c0065c17f9ed502a319ce3dd84)

Signed-off-by: Robert Yang &lt;liezhi.yang@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>update-alternatives.bbclass: Add function to get metadata</title>
<updated>2019-04-11T20:12:48+00:00</updated>
<author>
<name>Mariano Lopez</name>
<email>just.another.mariano@gmail.com</email>
</author>
<published>2019-04-09T05:44:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=5feccb430bfc56e278f2e3bab87b87ea9973e08f'/>
<id>urn:sha1:5feccb430bfc56e278f2e3bab87b87ea9973e08f</id>
<content type='text'>
This adds update_alternatives_alt_targets function to get the metadata
for a package. This is for code reuse because the metadata would help
other classes that needs to be aware of how update-alternatives modify
the final package.

[YOCTO #12597]
[YOCTO #13238]

(From OE-Core rev: 04d966c0a91c5e16555bba827969a0a2fd96bb96)

Signed-off-by: Mariano Lopez &lt;just.another.mariano@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>update-alternatives: correctly escape PATHs when updating FILES_${PN}</title>
<updated>2019-02-06T08:29:06+00:00</updated>
<author>
<name>André Draszik</name>
<email>andre.draszik@jci.com</email>
</author>
<published>2019-02-05T02:32:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=d05823086d0299272d2aea7ba440d3dae21c48ba'/>
<id>urn:sha1:d05823086d0299272d2aea7ba440d3dae21c48ba</id>
<content type='text'>
The recently added support for updating FILES based on the file renames
that are happening here is using a regex replace, but failed to
properly escape the search pattern (the full path). This manifests itself
in FILES not being updated as soon as the full path contains any
character that has a special meaning, e.g. '+'.

In other words an original path (alt_target in the code) like
    /opt/poky/2.6+snapshot/sysroots/i686-pokysdk-linux/sbin/losetup
can't be matched, and hence we fail to update FILES with the new value,
causing packaging errors.

Fix by using re.escape() on the original path before passing into re.sub()

Fixes: 5c23fe378732 ("update-alternatives: try to update FILES_${PN} when
renaming a file"), or bcb3e7b7f88a in poky.git

[YOCTO #13058]

(From OE-Core rev: 126743162397e4145902b3f127f2dafd80a8a49b)

Signed-off-by: André Draszik &lt;andre.draszik@jci.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>update-alternatives: try to update FILES_${PN} when renaming a file</title>
<updated>2019-02-02T11:05:59+00:00</updated>
<author>
<name>André Draszik</name>
<email>andre.draszik@jci.com</email>
</author>
<published>2019-01-16T12:51:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=bcb3e7b7f88adaabc7b78c7c0155b4f68da254d8'/>
<id>urn:sha1:bcb3e7b7f88adaabc7b78c7c0155b4f68da254d8</id>
<content type='text'>
When using update-alternatives, FILES_${PN} must be
referencing the new name after update-alternatives has
renamed files.

This is more or less OK when having static lists of files to
be packaged into a package, but makes it quite hard to
dynamically generate FILES_${PN}, e.g. using do_split_packages(),
as in that case we can not easily modify what goes into
FILES_${PN}, because that list is based on filenames as seen
at the time do_split_packages() is executing.

Of couse one could explicitly specify the (renamed) file(s)
in the recipe, but that contradicts the intended usage of
do_split_packages().

Instead, if FILES_${PN} contains the file name as it was pre
renaming, we here modify this to reflect the new name.

This will allow usage of do_split_packages() to populate
FILES_${PN}.

[YOCTO #13058]

(From OE-Core rev: 5c23fe378732038643a450cbf916334d24764b70)

Signed-off-by: André Draszik &lt;andre.draszik@jci.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>update-alternatives: convert file renames to PACKAGE_PREPROCESS_FUNCS</title>
<updated>2019-02-02T11:05:59+00:00</updated>
<author>
<name>André Draszik</name>
<email>andre.draszik@jci.com</email>
</author>
<published>2019-01-16T12:51:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0b782c39b9bb54fc3c15942a1b7fa3f6e179f9b6'/>
<id>urn:sha1:0b782c39b9bb54fc3c15942a1b7fa3f6e179f9b6</id>
<content type='text'>
At the moment, the update-alternatives file renaming is
happening right after copying into PKGD during packaging
time using an _append OVERRIDE to the copy function
perform_packagecopy().

This is not really readable and hard to maintain.

Additionally, this makes it impossible to e.g. populate
PACKAGES dynamically using do_split_packages() and still
do update-alternatives - update-alternatives file renaming
requires the PACKAGES variable to have been fully populated
to work correctly. On the other hand, do_split_packages()
can only execute after perform_packagecopy(), as it needs
PKGD populated; so it's impossible to insert
do_split_packages() early enough in a deterministic way in
this use-case.

As there doesn't seem to be a reason not to, convert
this to a proper function and use PACKAGE_PREPROCESS_FUNCS
instead - after all, that's what this is meant for.

No other classes or recipes in oe-core or meta-openembededd
seem to have a hard requirement on update-alterantives
executing before any other PACKAGE_PREPROCESS_FUNCS, so
this should be perfectly fine.

The only implication is that if compress_doc is inherited,
compressed man-page file names will end up being, e.g.
    eject.1.util-linux.gz
  or
    eject.1.gz.util-linux
based on the include of compress_doc.bbclass vs.
update-alternatives.bbclass order, but the symlink created
(alternative name) will always be correct.

This solves both problems:
* the code is easier to read / follow
* the above described use-case can be accomodated easily

[YOCTO #13058]

(From OE-Core rev: 8c3db2fa735e5933f842f80321bb3ed38753812d)

Signed-off-by: André Draszik &lt;andre.draszik@jci.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
