<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/classes/update-alternatives.bbclass, branch master-next2</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=master-next2</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=master-next2'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2019-06-27T11:20:36+00:00</updated>
<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>
<entry>
<title>meta: remove True option to getVar calls (again)</title>
<updated>2019-01-14T11:35:56+00:00</updated>
<author>
<name>André Draszik</name>
<email>andre.draszik@jci.com</email>
</author>
<published>2019-01-13T11:16:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=dfd833725dab28015474359754883a67bbc80cc6'/>
<id>urn:sha1:dfd833725dab28015474359754883a67bbc80cc6</id>
<content type='text'>
A couple have still been missed in the past despite multiple
attempts at doing so (or simply have re-appeared?).

Search &amp; replace made using the following command:
    sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' \
        -i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' \
             | cut -d':' -f1 \
             | sort -u)

(From OE-Core rev: 9f551d588693328e4d99d33be94f26684eafcaba)

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.bbclass: Stabilize iteration order</title>
<updated>2019-01-07T10:54:13+00:00</updated>
<author>
<name>Clemens Lang</name>
<email>clemens.lang@bmw-carit.de</email>
</author>
<published>2019-01-03T15:55:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=caf55cf9b4be08693c561824fd8d8835617c4c06'/>
<id>urn:sha1:caf55cf9b4be08693c561824fd8d8835617c4c06</id>
<content type='text'>
The use of a dictionary for link_rename causes problems for higher-order
alternatives, i.e. when an alternative link points to another
alternative link, since these links must be processed in the order in
which they were originally added for symlink correction to work.

Switch from a dict to a list of tuples to ensure processing happens in
the original order.

(From OE-Core rev: 326220267ffc43ec1f507ad0cc47ac59caafd5b7)

Signed-off-by: Clemens Lang &lt;clemens.lang@bmw-carit.de&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>classes/update-alternatives: Skip alternatives when disabled</title>
<updated>2018-12-03T12:20:01+00:00</updated>
<author>
<name>Joshua Watt</name>
<email>jpewhacker@gmail.com</email>
</author>
<published>2018-11-29T14:57:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=9775741a20937cab6ccd0c359482bc08d1a2b2d6'/>
<id>urn:sha1:9775741a20937cab6ccd0c359482bc08d1a2b2d6</id>
<content type='text'>
Skips the update alternative steps for recipes that shouldn't have them
enabled.

Fixes errors like:

 nativesdk-bzip2-1.0.6-r5 do_package: bzip2: alternative target
 (/opt/poky/2.5+snapshot/sysroots/i686-pokysdk-mingw32/usr/bin/bunzip2
 or
 /opt/poky/2.5+snapshot/sysroots/i686-pokysdk-mingw32/usr/bin/bunzip2.bzip2)
 does not exist, skipping...

When building mingw SDKs

[YOCTO #12962]

(From OE-Core rev: d11576f569ee618a8e638eee3b1f17bf8a9d4264)

Signed-off-by: Joshua Watt &lt;JPEWhacker@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>update-alternatives.bbclass: refuse to manage SysV init scripts</title>
<updated>2017-12-02T11:25:33+00:00</updated>
<author>
<name>Markus Lehtonen</name>
<email>markus.lehtonen@linux.intel.com</email>
</author>
<published>2016-12-05T11:35:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=4958d810aacb124ad21be8f3736a224e433817dc'/>
<id>urn:sha1:4958d810aacb124ad21be8f3736a224e433817dc</id>
<content type='text'>
Sanity check for future packages.

[YOCTO #10944]

(From OE-Core rev: 061fa614cec49deb0374ccadf3013e5cc8ad2c51)

Signed-off-by: Markus Lehtonen &lt;markus.lehtonen@linux.intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "classes: Fix alternatives and rc.d ordering"</title>
<updated>2017-12-02T11:25:33+00:00</updated>
<author>
<name>Markus Lehtonen</name>
<email>markus.lehtonen@linux.intel.com</email>
</author>
<published>2017-01-19T12:28:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=a779b1d9fbbecad1d62847c0907fa809f13b9c2f'/>
<id>urn:sha1:a779b1d9fbbecad1d62847c0907fa809f13b9c2f</id>
<content type='text'>
This kludge is not needed anymore, now that syslog packages (or any
other package) don't use update-alternatives for managing SysV init
scripts.

This reverts commit fc89a3f739ff25306ea91d9bdb424fc8389bdf72.

[YOCTO #10944]

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
