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

Add support for Void Linux #99

Closed
wants to merge 4 commits into from
Closed

Add support for Void Linux #99

wants to merge 4 commits into from

Conversation

lasers
Copy link
Contributor

@lasers lasers commented Jun 26, 2017

This adds a support for Void Linux... and it should be more than enough.

I'd like get some eyeballs on this... Help, testing, opinions, discussions, etc.

  • I don't know what to do with variables like $_TOPT.
    └── I leave one in xbps_S because it's also in other scripts.
  • I can't run xbps_Qet which seems to be in line with pacman -Qet.
  • Need help with xbps_S_asdeps. I'm guessing we want some $OPT ?
  • Need help with xbps_D_asexplicit. I'm guessing we want some $OPT ?
  • Anything else that might need to be fixed.

I'm new to Void Linux so I want to play around with it using pacapt. Many thanks. :-)

@icy
Copy link
Owner

icy commented Jun 28, 2017

Hi @lasers ,

Thanks a lot for your work.

Regarding tests, you may take a look at examples in https://github.com/icy/pacapt/tree/ng/tests . Basically they are instructions to run pacapt and to match the output against some regular expressions using grep. The tests run inside docker container, so you need to specify the image name (im foobar; see example in dpkg.txt.)

I myself think that writing test is boring, I'd like to write some in-line tests (that mean you write tests inside lib/xbps.sh file.) I am still looking for a way.

Regarding xbps operations:

  • xbps_Qet, xbps_S_asdeps, xbps_D_asexplicit, ... yes you may need to write xbps_Q and use $_TOPT option to launch sub processes.
  • $_TOPT you may see a short description here https://github.com/icy/pacapt/blob/ng/lib/zz_main.sh#L27 . pacman normally requires you to provide them at least two options: the uppercase (Q, S, U), the lowercase (q for Q, s for S,...). Sometimes, they are not enough hence you need to provide also a third option (here comes $_TOPT) or even $_EOPT. Unfortunately, you need to look at the loop https://github.com/icy/pacapt/blob/ng/lib/zz_main.sh#L44 which is quite tricky. The best example is how we treat the --no-confirm or --download-only option.

For example, if you want to implement

xbps_D_asexplicit() {
  # how do we use this? # pacman -D --asexplicit
  xbps-pkgdb -m manual "$@"
}

you would need to figure our the secondary option (there is always one, see in ArchLinux pacman's man page), and will slightly modify the loop (mentioned above) to provide --asexplicit as $_TOPT or $_EOPT. You may implement xbps_D or xbps_Dx here x is any secondary option required by -D option.

I think this is quite painful, so you may want to split your work: let's make some basic operations (search, install,...) then provide more advanced features later.

This is the first time I've heard of Void Linux. I would try them at home and give more details.

Thanks again for your contribution. Please keep going.

@lasers
Copy link
Contributor Author

lasers commented Jul 11, 2017

Hi. I couldn't get xbps_D to work as it's not on the list. I also can't get --asexplicit to work either. I however added --noconfirm and confirmed that it works fine (ie installing without a confirmation). Everything here has been tested just now and should be sufficient for most Void Linux tasks.

I commented out the things I can't get to work.. just for the future reference. I also would like to customize error a bit with red color (and s/Error/pacapt). Would you be okay with that if I make a PR?

I have VoidLinux on a spare laptop so I don't always use it much.

@icy
Copy link
Owner

icy commented Oct 11, 2017

@lasers I have some free time to work on your PR. We need to add test cases and remove some color support,... I will keep you posted. Thanks for your patience

@icy icy self-assigned this May 6, 2021
@icymatter
Copy link
Collaborator

I will continue to work on the new PR #200 and close this one. Thanks.

@icymatter icymatter closed this Jul 29, 2021
@icymatter icymatter linked an issue Jul 29, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Void Linux
3 participants