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 pkgbuild option to build local package #46

Merged
merged 3 commits into from
Oct 1, 2020

Conversation

ckotte
Copy link
Contributor

@ckotte ckotte commented Sep 24, 2020

Sometimes AUR packages are broken and not fixed. With the pkgbuild option, a local directory with the PKGBUILD and build files can be specified to build the package.

Flake 8 displays a warning: unable to detect undefined names
@kewlfft
Copy link
Owner

kewlfft commented Sep 25, 2020

I think it is a nice feature, thanks for your contribution. I have some comments:

@ckotte
Copy link
Contributor Author

ckotte commented Sep 25, 2020

I could rename it to local_pkgbuild.

I use pikaur in my playbook and I have a specific use case for local pkgbuilds. I just added the functionality for makepkg after I implemented it for pikaur.

Other helpers cannot build local pkgbuilds yet. You could change the function in the future and keep the same options for pikaur and add the commands for the other helpers.

Or you wait until every helper implements it and then you can add it to your module. However, this probably won't happen. pacaur is also discontinued and the issue for yay is open since 2 years.

@ckotte
Copy link
Contributor Author

ckotte commented Sep 25, 2020

Are you happy if I change the new pikaur function to a generic function where someone could add the functionality for other helpers in the future??

@kewlfft
Copy link
Owner

kewlfft commented Sep 25, 2020

yes adding or for removing a helper should require minimum maintenance, it often happens. We have to think if pikaur is discontinued, it should be a question of adding or removing an element in a list.

@ckotte
Copy link
Contributor Author

ckotte commented Sep 26, 2020

I changed the code. Now there's a list for a local package build and a generic function that assumes the last argument is the PKGBUILD file. Both are only used if local_pkgbuild is specified.

This will work in theory with another helper that just need to be added to the new list. In theory because it will only work if the helper requires the PKGBUILD file as the last argument. It doesn't work anymore if the helper requires the directory or if it needs to execute the command inside the directory, etc. pp.

The code is now more bloated. Tell me what you think. I will rebase the PR later.

@kewlfft
Copy link
Owner

kewlfft commented Sep 26, 2020

it seems good thanks for the changes

@ckotte
Copy link
Contributor Author

ckotte commented Sep 29, 2020

ok. rebase done.

@kewlfft
Copy link
Owner

kewlfft commented Sep 30, 2020

can't extra_args be used to add the remove dependencies options to makepkg ?

@kewlfft
Copy link
Owner

kewlfft commented Sep 30, 2020

for behavior that varies depending on the helper let's not try to change or harmonize in the background, this would add complexity. --skip-pgp-check was implemented before extra_args which was only added last June. If extra_args does the job, we could maybe remove the skip pgp check (breaking change).

@ckotte
Copy link
Contributor Author

ckotte commented Sep 30, 2020

I removed the last commit. Sorry. I don't have time for this.

@ckotte
Copy link
Contributor Author

ckotte commented Sep 30, 2020

I would not remove this option because there's also a description that explicitly says why it's useful in the first place. This helps users if they have exactly this issue/use case of installing only one package (AUR helper) that needs GnuPG configured.

@soloturn
Copy link

soloturn commented Sep 30, 2020

i'd love if the option "yay -U" learns to take either a package file and installs it, or PKGBUILD and builds it beforehand, instead of having "local_pkgbuild" as addition. yay -U only would use the PKGBUILD in the current dir. thanks a lot for this contribution!

@kewlfft
Copy link
Owner

kewlfft commented Sep 30, 2020

@soloturn what you describe and would like yay to support is it what pikaur does already with the pkgbuild option?

library/aur.py Outdated Show resolved Hide resolved
library/aur.py Outdated Show resolved Hide resolved
library/aur.py Outdated Show resolved Hide resolved
library/aur.py Outdated Show resolved Hide resolved
@ckotte
Copy link
Contributor Author

ckotte commented Oct 1, 2020

I implemented all suggestions. Please check.

@kewlfft kewlfft merged commit 592c6d9 into kewlfft:master Oct 1, 2020
@ckotte ckotte deleted the pkgbuild branch October 1, 2020 17:35
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