Skip to content

Conversation

@chetanc10
Copy link

This allows basher-installable packages to setup required linux tools.

Did bats test as per Contributing.md guidelines.

My 1st pull request. Correct me if anything's missing.

This allows basher-installable packages to setup
required linux tools.

Signed-off-by: ChetaN KS <chetan.kumarsanga@gmail.com>
@juanibiapina juanibiapina requested a review from Copilot July 14, 2025 17:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for installing Debian package dependencies defined in the DPKG_DEPS environment variable by splitting on : and invoking apt install for each.

  • Parses DPKG_DEPS and installs each listed package via sudo apt install -y.
  • Injects this new block immediately after the existing basher-install loop.
Comments suppressed due to low confidence (1)

libexec/basher-_deps:34

  • The new block handling DPKG_DEPS doesn’t appear to have accompanying bats tests. Please add tests covering cases with multiple dependencies, empty DPKG_DEPS, and error scenarios.
IFS=: read -ra deps <<< "$DPKG_DEPS"

@juanibiapina
Copy link
Member

This wouldn't work on a Mac. Also, where is DPKG_DEPS coming from?

Signed-off-by: ChetaN KS <chetan.kumarsanga@gmail.com>
@chetanc10
Copy link
Author

This wouldn't work on a Mac. Also, where is DPKG_DEPS coming from?

Thanks. Updated to select brew/apt for installation based on os type.

And DPKG_DEPS comes from package.sh, with syntax similar to DEPS.
e.g.

DPKG_DEPS=p7zip-full:rar:unrar:zip:xz-utils:bzip2
BINS=packit.sh:unpack.sh

@juanibiapina
Copy link
Member

Thanks for the clarification. I find this feature difficult to support. It means I could install something on my machine as a side effect of installing something with basher, which to me is unexpected. Also, even if we somehow designed a way to ask for user confirmation, we'd still have to account to all possible Linux distributions. I use nixos, for example, and packages are not installed with commands.

@pawamoy
Copy link
Contributor

pawamoy commented Jul 15, 2025

I'm not in favor of this feature. IMO the right way to integrate with brew/apt would be to package the Basher apps you're interested in as such (apt packages, brew packages). This way you'll be able to declare their dependencies using the same system.

Just like pip, npm, go get, etc. don't allow specifying system deps, I don't think Basher should.

@juanibiapina
Copy link
Member

juanibiapina commented Jul 16, 2025

@chetanc10 Do you have a specific repo in mind, so we can try to solve the problem in a different way?

@chetanc10
Copy link
Author

@juanibiapina @pawamoy

With your insights, I think I hasted to change basher's behavior. Most of my scripts need to install tools that are not present in the system by default. And I'm only a Linux user, and I didn't think of all parameters when I did this.

I'll still make my packages basher-installable without changing basher. But I'll update my packages to install the required dependencies - using similar approach as in basher package deps.

BTW @juanibiapina basher is just awesome!

@chetanc10 chetanc10 closed this Jul 16, 2025
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