Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(brew): Automatically install and maintain brew package list (#347) #348

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mecattaf
Copy link
Contributor

Let me know if you want me to make any changes, to comply with the coding standards of the modules project!
Corresponds to #347

Thanks,
T

Copy link
Collaborator

@fiftydinar fiftydinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial thoughts before fully testing this

if [[ -n "${INSTALL_PACKAGES}" ]]; then
echo "install:" > /usr/share/bluebuild/brew/repo-info.yml
echo "${INSTALL_PACKAGES}" | sed 's/^/ - /' >> /usr/share/bluebuild/brew/repo-info.yml
echo "The following Brew packages will be installed when the system is live:"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "The following Brew packages will be installed when the system is live:"
echo "The following Brew packages will be installed when system is booted:"

Description=Setup Brew Packages
After=brew-setup.service
Requires=brew-setup.service
ConditionPathExists=!/var/lib/brew-packages-setup.stamp
Copy link
Collaborator

@fiftydinar fiftydinar Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition makes this execute only once.

It should execute every boot, to install packages from updated install list over time. If there are no packages, it will just say Package \$package is already installed.

To make logs more sane in this scenario (when there are no new packages to install),
instead of printing this echo for every package, it should print once: Installed packages are up-to-date with install list, no changes need to be done

modules/brew/brew.sh Show resolved Hide resolved
Comment on lines +295 to +296
# Write brew-packages-setup script
cat > /usr/bin/brew-packages-setup <<EOF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be just a file in the module's directory that is cp'd in place. Having it inline doesn't work with syntax highlighting and shellcheck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants