<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-live-build.git/functions/packages.sh, branch rolling</title>
<subtitle> (mirror of https://github.com/vyos/vyos-live-build.git)
</subtitle>
<id>https://git.amelek.net/vyos/vyos-live-build.git/atom?h=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-live-build.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/'/>
<updated>2021-01-13T12:39:07+00:00</updated>
<entry>
<title>packages.sh: check for /etc/debian_version existance rather than dpkg-query aviability</title>
<updated>2021-01-13T12:39:07+00:00</updated>
<author>
<name>Jan Kot</name>
<email>janymalino@gmail.com</email>
</author>
<published>2021-01-13T12:18:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=96fe9e7ca979c768986948d8314479140e7fa63b'/>
<id>urn:sha1:96fe9e7ca979c768986948d8314479140e7fa63b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>s/Remove_package/Remove_packages/</title>
<updated>2020-05-05T18:55:28+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-05-05T15:45:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=18eefdd6f38631e15e56a2bd7a25bba50b05acfa'/>
<id>urn:sha1:18eefdd6f38631e15e56a2bd7a25bba50b05acfa</id>
<content type='text'>
it removes one or more, so should be plural for clarity

Gbp-Dch: Short
</content>
</entry>
<entry>
<title>s/Install_package/Install_packages/</title>
<updated>2020-05-05T18:55:28+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-05-05T15:42:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=919a464b64b4bda52a56b8732ea5ef7727649cf0'/>
<id>urn:sha1:919a464b64b4bda52a56b8732ea5ef7727649cf0</id>
<content type='text'>
it installs one or more, so should be plural for clarity

Gbp-Dch: Short
</content>
</entry>
<entry>
<title>packages: avoid unnecessary nesting</title>
<updated>2020-05-05T18:55:28+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-05-05T18:29:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=9c8d26c97ff51ebc105e2bcf815c29ff79eea2a6'/>
<id>urn:sha1:9c8d26c97ff51ebc105e2bcf815c29ff79eea2a6</id>
<content type='text'>
Gbp-Dch: Ignore
</content>
</entry>
<entry>
<title>make temporary state of installed tools recoverable</title>
<updated>2020-05-05T18:43:15+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-05-05T00:56:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=f27d13de08af9ae788b0d2f848e2202a399e4f43'/>
<id>urn:sha1:f27d13de08af9ae788b0d2f848e2202a399e4f43</id>
<content type='text'>
some scripts temporarily install packages to accomplish some work before
then removing them. the list of packages installed is kept in memory in a
variable.

a weakness of this design is that if a failure occurs or the user cancels,
and then following this the user re-runs `lb build`, letting it try to
pick up and recover from where it left off, that list of packages that had
been installed is lost, resulting in those packages that were installed
then being a permanent part of the chroot.

here we fix this weakness by backing up the list to a file, which is always
read from on removal. thus in a recovery situation, any packages still
installed from a situation like that just described, will be removed upon
the next use of `Remove_package()`.

this is not perfect, since we are having to wait for opportunistic
execution of the remove function. we need to find a suitable place for the
`Cleanup_temp_packages()` function to be used.

 - doing so in `Init_config_data()` would not be suitable because we don't
   hold the lock when that's run, even if we ignored the hijacking of that
   function for taking such action...
 - doing it in `Exit()` doesn't seem a good fit either.
 - putting it explicitly in every build script just seems a little messy...

perhaps a local exit trap like for removing the lock...?

note that `binary_rootfs` skips running the remove function after installing
tooling, since it just throws the wrapper chroot away, which then leaves the
file around with stale data for the next remove instance to pick up, which
then does not actually remove it because it's not installed. this is not
ideal either... perhaps the optimisation should be removed from that script?

Gbp-Dch: Short
</content>
</entry>
<entry>
<title>Replace 'which' with 'command -v' to test for the existance of an executable</title>
<updated>2020-05-01T09:59:11+00:00</updated>
<author>
<name>johnraff</name>
<email>github@rafflesnagoya.com</email>
</author>
<published>2020-05-01T02:23:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=0e5d0483e5596e200430d28356b808af76806439'/>
<id>urn:sha1:0e5d0483e5596e200430d28356b808af76806439</id>
<content type='text'>
This is considered to be more robust.

Two instances remain:

scripts/build/chroot_archives, line 257:
if [ "${LB_APT}" = "aptitude" ] &amp;&amp; [ ! $(Chroot chroot "which aptitude") ]
The command is run inside a chroot where the environment might be special,
and would need further testing.

manpages/Makefile, line 42:
@if [ ! -x "$$(which po4a 2&gt;/dev/null)" ]; \
I am insufficiently familiar with makefile syntax to edit this.
</content>
</entry>
<entry>
<title>packages: remove auto-installed on removal</title>
<updated>2020-04-23T09:25:17+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-03-30T22:57:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=f6a50b6db204fa1a6d0ae8b371c4108911aed0eb'/>
<id>urn:sha1:f6a50b6db204fa1a6d0ae8b371c4108911aed0eb</id>
<content type='text'>
i've been noticing that in the binary_syslinux stage a wholebunch of
packages get installed whilst installing isolinux, and then upon removing
the installed packages at the end of the script, apt is listing a large
number of those that were auto installed as no longer in use and can be
removed via `apt autoremove`. this then persists through package
installation and removal steps throughout remaining scripts.

adding `--auto-remove` to `apt-get remove --purge` and similarly
`--purge-unused` to `aptitude purge` instructs apt to get rid of the unused
auto-installed packages at the same time as removing specific package that
brought them in in the first place, and thus resolves the problem.

Gbp-Dch: Short
</content>
</entry>
<entry>
<title>use local scope for private function vars</title>
<updated>2020-03-16T22:10:03+00:00</updated>
<author>
<name>Lyndon Brown</name>
<email>jnqnfe@gmail.com</email>
</author>
<published>2020-02-20T06:58:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=c55eb8a0c3ca5b8ed1081e7eb8a423563288fb58'/>
<id>urn:sha1:c55eb8a0c3ca5b8ed1081e7eb8a423563288fb58</id>
<content type='text'>
all vars affected have been carefully checked to be quite certain
that they are definitely local

where variable is assigned the return value of a function/command, the
local "declaration" is deliberately done on a separate line, since
`local FOO` is actually treated itself as a command rather than a
declaration; will thus always cause $? to be zero, and thus if done on
the same line as such an assignment can not only clobber $? but in doing
so unintentionally blocks failure of a command from triggering the
expected exit from having `set -e`.

also, from testing, i have found that when assigning "${@}" this must be
done on a separate line confusingly as otherwise an error occurs.

Gbp-Dch: Short
</content>
</entry>
<entry>
<title>Revert "Test for executables: replace 'which' with more robust 'command -v'"</title>
<updated>2020-03-12T12:32:26+00:00</updated>
<author>
<name>Luca Boccassi</name>
<email>luca.boccassi@microsoft.com</email>
</author>
<published>2020-03-12T12:32:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=015e6b65f3173e16d7ee4c3d9fa407d7ed1c9c45'/>
<id>urn:sha1:015e6b65f3173e16d7ee4c3d9fa407d7ed1c9c45</id>
<content type='text'>
This reverts commit 2d9ab1f7f82f9a98b97d1503c1e3f31c86061c15.

Causes test failure due to bashism.
</content>
</entry>
<entry>
<title>Test for executables: replace 'which' with more robust 'command -v'</title>
<updated>2020-03-12T10:35:57+00:00</updated>
<author>
<name>johnraff</name>
<email>github@rafflesnagoya.com</email>
</author>
<published>2020-03-12T05:37:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-live-build.git/commit/?id=2d9ab1f7f82f9a98b97d1503c1e3f31c86061c15'/>
<id>urn:sha1:2d9ab1f7f82f9a98b97d1503c1e3f31c86061c15</id>
<content type='text'>
Instances of:
if [ $(which &lt;command&gt; ]
have been replaced with:
if command -v &lt;command&gt; &gt;/dev/null
which is considered to be more robust in a range of environments.

scripts/build/chroot_archives: line 259:
	if [ "${LB_APT}" = "aptitude" ] &amp;&amp; [ ! $(Chroot chroot "which aptitude") ]
has been left untouched because the chroot might require a more complex command
which would need more testing.

manpages/Makefile: line 42:
	@if [ ! -x "$$(which po4a 2&gt;/dev/null)" ]; \
has been left untouched because I am not sufficiently familiar with makefiles.
</content>
</entry>
</feed>
