[elbe-devel] Package version specified with <pkg version=""/> attribute gets silently ignored

Manuel Traut manuel.traut at linutronix.de
Wed Apr 4 16:50:01 CEST 2018


Hi Lukasz,

> Suppose I want to install a particular version of package A, say version X, in my resulting RFS image. In order to achieve that I request the desired version using:
> 
> <pkg version="X">A</pkg>
> 
> If version X is not available from any of the mirrors specified in the <mirror/> tag, but instead version Y is available, it will be *silently* installed without issuing any warning, not mentioning halting the build with an error.

using version results in this:
https://wiki.ubuntuusers.de/Apt-Pinning/#Pinning-per-Version
with pin priority 1001, so it should be always installed in the desired version.
However apt seems to install (silently) another version if this version is
not available. We decided to use pinning, because than even if using apt on the
target the pinning should avoid installing another version of the package.
However we have the posibility to give a package version to the apt cache
instead of None, than the commit should fail:

elbepack/elbeproject.py:

def install_packages(self, buildenv=False):
...
   self.get_rpcaptcache().mark_install(p, None)

Feel free to change the behaviour, if you find a better solution please post
patches. It would be nice to see some improvements here.

BTW. you can also use, <pkg pin='stretch-backports'>A></pkg> to install a
package from a specific suite. But also always the latest package will be used.

> I consider this behavior to be a serious issue, since the user that requests a particular version obviously knows what he is doing, but doesn't get what he explicitly requested, and that without a smallest sign of a failure! This renders the "version" attribute useless as you cannot trust that it will have any influence on the build process: it gets silently ignored at circumstances described above.

elbepack/dump.py - check_full_pkgs() checks if the correct version of a package
is installed, if rebuild from a source.xml including the full-pkg-list section.
A violation ends with an entry in validation.txt which is shown at the end of
each 'elbe initvm submit'.

Feel free to improve the code, that also the 'version' attribute of a pkg in
the 'normal' pkg-list is checked.

> If the "version" attribute is an unsupported/undocumented feature (I don't see it in the current "XML Reference" nor in the examples), what is the supported/recommended way of requesting a particular version when many are available (equivalent to "apt-get install A=X")?

It's documented in the schema, but doesn't end in the man-pages and website
probably because of: https://github.com/Linutronix/elbe/issues/129

  Manuel



More information about the elbe-devel mailing list