Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

Improve install_command test #22

@gardar

Description

@gardar

install_command() {
# Run test if this binary exists
PACKAGE=$1
TEST_BINARY=$PACKAGE
podman exec --user root:root "$CONTAINER_ID" /bin/bash -c 'if ! type '"$TEST_BINARY"' >/dev/null 2>&1; then

I think the install_command test could be improved as the packages listed under the dependencies don't all contain binaries that are equal to the name of the package.
The ca-certificates package for example does not contain any binary called ca-certificates (at least not on archlinux/debian/redhat) which causes the ca-certificates package to be installed in every job.
This can count for a significant amount of time, especially on yum based distros that have a lot of repos enabled.

Possible solutions:

  • Adding a second argument to install_command for a file to check (or perhaps a command to run).
  • Check if a package is installed instead of relying on the existence of a certain file/binary. This would need to be distro specific but it would be possible to use dpkg/rpm/etc. instead of apt/yum/dnf (using rpm is significantly faster than relying on yum/dnf).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions