summaryrefslogtreecommitdiff
path: root/functions/packages.sh
AgeCommit message (Collapse)Author
2021-01-13packages.sh: check for /etc/debian_version existance rather than dpkg-query ↵Jan Kot
aviability
2020-05-05s/Remove_package/Remove_packages/Lyndon Brown
it removes one or more, so should be plural for clarity Gbp-Dch: Short
2020-05-05s/Install_package/Install_packages/Lyndon Brown
it installs one or more, so should be plural for clarity Gbp-Dch: Short
2020-05-05packages: avoid unnecessary nestingLyndon Brown
Gbp-Dch: Ignore
2020-05-05make temporary state of installed tools recoverableLyndon Brown
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
2020-05-01Replace 'which' with 'command -v' to test for the existance of an executablejohnraff
This is considered to be more robust. Two instances remain: scripts/build/chroot_archives, line 257: if [ "${LB_APT}" = "aptitude" ] && [ ! $(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>/dev/null)" ]; \ I am insufficiently familiar with makefile syntax to edit this.
2020-04-23packages: remove auto-installed on removalLyndon Brown
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
2020-03-16use local scope for private function varsLyndon Brown
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
2020-03-12Revert "Test for executables: replace 'which' with more robust 'command -v'"Luca Boccassi
This reverts commit 2d9ab1f7f82f9a98b97d1503c1e3f31c86061c15. Causes test failure due to bashism.
2020-03-12Test for executables: replace 'which' with more robust 'command -v'johnraff
Instances of: if [ $(which <command> ] have been replaced with: if command -v <command> >/dev/null which is considered to be more robust in a range of environments. scripts/build/chroot_archives: line 259: if [ "${LB_APT}" = "aptitude" ] && [ ! $(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>/dev/null)" ]; \ has been left untouched because I am not sufficiently familiar with makefiles.
2020-03-11amend copyright & licensing blocksLyndon Brown
Current versions of the project files are built upon versions published and licensed by Daniel Baumann, but are modified copies of those files and thus need to be marked as such per licensing requirements (afaik he did not pass along ownership / licensing rights to anyone when he left the project). We should also be careful to not be misrepresenting such modified copies as being attributed to Daniel. Adding a new copyright line referring to "The Debian Live team" should suffice for this. The authorship block in man pages has also similarly been updated. Notes: - tweaked a copy of daniel copyright lines stating 2014 instead of 2015. both of these cases were in files that i had personally introduced in some of my past merged commits that moved some code around. i don't know why they stated 2014. - binary_onie was introduced in 2018, so that has a 2018 date instead of 2016 unlike the rest. - 'efi-image' is a 3rd-party (Canonical Ltd) work that we bundle, but it has been modified by 674794a8f4d61a729d2dbd6d99385d2826138694 and 36a3ba76347ef72df1c316312ed3a26aa4b0c816 so I similarly added a debian live copyright line. - 'grub-cpmodules' is similar. it was only changed by the indentation fix of 36a3ba76347ef72df1c316312ed3a26aa4b0c816 but modification is modification, and this does help cover any possible future changes that might be made.
2020-03-11functions: consistency fixLyndon Brown
missed in 7ee59d408ed7681908966a5b2fb28e8f98116d31 Gbp-Dch: Ignore
2018-04-05Print an error and exit if a host package (dependency) is missing.Luca Boccassi
Check_package will just add a missing dependency to the LB_PACKAGES todo list if it doesn't find it, when build-with-chroot is true, even if the check was not for the chroot. Instead error out if the check is not done for the chroot, e.g. Check_package host /bin/foo foo
2017-09-01Error out when needed packages are missing on the hostMatthijs Kooijman
Previously, Check_package would only show an error when host packages are missing on a non-apt system. On apt system, the packages would be added to _LB_PACKAGES, which causes them to be installed in the chroot, not in the host (or not at all if Install_package is not called). This behaviour could break the build. This applies to either packages that must be present in the host (as checked with `Check_package host ...`), as well as packages that can be either in the chroot or host (as checked with `Check_package chroot`) when LB_BUILD_WITH_CHROOT=false.
2016-11-28Fix Check_installed function when checking against hostRaphaël Hertzog
Thanks to jnqnfe for the report. Closes: #774807
2015-01-04Updating year in copyright notices to 2015.Daniel Baumann
2015-01-04Changing package dependency checks within chroot to work outside as well.Daniel Baumann
2014-02-08Updating copyright notices for 2014.Daniel Baumann
2013-05-06Removing all references to my old email address.Daniel Baumann
2013-05-06Updating year in all copyright notices.Daniel Baumann
2013-05-06Adding debian version 4.0~a1-1.debian/4.0_a1-1Daniel Baumann
2013-01-01Updating year in all copyright notices.Daniel Baumann
2012-07-30Updating GPL standard header in all files.Daniel Baumann
2012-02-06Updating year in copyright notices for 2012.Daniel Baumann
2011-03-09Updating year in hooks and script files.Daniel Baumann
2011-03-09Adding debian version 3.0~a1-1.Daniel Baumann
2011-03-09Updating year in manpage, hooks, script and template files.Daniel Baumann
2011-03-09Updating internal variables from lh to lb scheme, should be the last piece ↵Daniel Baumann
to finish the live-helper to live-build rename.
2011-03-09Updating copyright headers for live-build.Daniel Baumann
2011-03-09Renaming --chroot-build to --build-with-chroot.Daniel Baumann
2011-03-09Updating year to 2010 in copyright notices.Daniel Baumann
2011-03-09For consistency, using true|false instead of enabled|disabled in ↵Daniel Baumann
configuration options.
2011-03-09Also respecting general apt/aptitude options for the install functions used ↵Cody A.W. Somerville
during binary stage.
2011-03-09Updating year in copyright notices for 2009.Daniel Baumann
2011-03-09Don't use set -e in sourced functions, this is the job of the actual ↵Daniel Baumann
executed script.
2011-03-09Generalizing internal Chroot(); by requiring its first argument to be the ↵Daniel Baumann
chroot directory.
2011-03-09Using internal prefix for PACKAGES variable in function/packages.sh (Closes: ↵Daniel Baumann
#468900).
2011-03-09Adding last modifications in order to have localization fully working in ↵Tiago Bortoletto Vaz
live-helper. This commit goes with some pt_BR translations just for testing. Thanks to Antonio Terceiro for helping and coding in some shell stuff.
2011-03-09Use APT::Install-Recommends to disable installation of recommends for EtchChris Lamb
2011-03-09Don't install "Recommends:" when installing local toolsChris Lamb
This patch disables the installation of "Recommends:" packages whilst obtaining build utilities such as 'syslinux'. It has three benefits: * Doesn't waste time installing useless packages whilst building. * Keeps the "binary chroot" clean - packages leak into the the live system on a rebuild. * Makes the behaviour of Install_Package more predictable and independent of the chroot's APT configuration.
2011-03-09Updating copyright years to 2008.Daniel Baumann
2011-03-09Consistently using the pipe as seperator in sed commands now.Daniel Baumann
2011-03-09Replacing backticks with POSIX expression.Daniel Baumann
2011-03-09Adding live-helper 1.0~a22-1.Daniel Baumann
2011-03-09Adding live-helper 1.0~a21-1.Daniel Baumann