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 refresh package #63

Merged
merged 5 commits into from
Nov 1, 2021
Merged

Add support for refresh package #63

merged 5 commits into from
Nov 1, 2021

Conversation

assapir
Copy link

@assapir assapir commented Oct 19, 2021

Should add support for refreshing the local cache as part of the current run.

@kewlfft
Copy link
Owner

kewlfft commented Oct 19, 2021

with which helper have you tested it?

@assapir
Copy link
Author

assapir commented Oct 19, 2021

Was tested with yay.

@kewlfft
Copy link
Owner

kewlfft commented Oct 19, 2021

Can you show me where --y is described in yay's documentation and it needs to be supported by the majority of the other helpers to be introduced. Are the other helpers following the same syntax?

@assapir
Copy link
Author

assapir commented Oct 19, 2021

It's part of pacman syntax, same as -u

@gotmax23
Copy link
Contributor

gotmax23 commented Oct 19, 2021

Notes

  • The scope of this module is installation and update from the AUR; for package removal or for updates from the repositories, it is recommended to use the official pacman module.

- ansible-aur's README

Can't you just use the community.general.pacman module?

- name: Run the equivalent of "pacman -Sy" as a separate step
  community.general.pacman:
    update_cache: yes

- community.general.pacman examples on docs.ansible.com.

@assapir
Copy link
Author

assapir commented Oct 19, 2021

Then full system update isn't currect.

@gotmax23
Copy link
Contributor

gotmax23 commented Oct 19, 2021

@kewlfft wrote:

Can you show me where --y is described in yay's documentation and it needs to be supported by the majority of the other helpers to be introduced. Are the other helpers following the same syntax?

@assapir wrote:

It's part of pacman syntax, same as -u

I think it should be -y or --refresh not --y.

-man pacman

@assapir wrote:

Then full system update isn't currect.

So you're saying that you want to be able to run the equivalent of $helper -Syu with this module, correct? In other words, currently, it is possible to update packages but not update the package cache beforehand.

@assapir
Copy link
Author

assapir commented Oct 20, 2021

So you're saying that you want to be able to run the equivalent of $helper -Syu with this, correct? In other words, currently, it is possible to update packages but not update the package cache beforehand.

Exactly.
There is also anther place (on update) where it using the shorthand and not the full flag name.

@gotmax23
Copy link
Contributor

Hi @assapir,

So you're saying that you want to be able to run the equivalent of $helper -Syu with this, correct? In other words, currently, it is possible to update packages but not update the package cache beforehand.

Exactly.

Okay, I am glad we're on the same page. Now that you explained the usecase, it makes more sense to me. We will have to see what @kewlfft thinks.

There is also anther place (on update) where it using the shorthand and not the full flag name.

I am not arguing for or against using shorthand. --y is just not a valid flag according to man pacman. If yay or another AUR helper interprets that differently, I do not think that is the intended behavior.

Thanks,
Maxwell

@gotmax23
Copy link
Contributor

גם, ראיתי שאתה ישראלי. עברית היא השפה השניה שלי. זא מגניב לראות אנשים אחרים שמדברים עברית על גיטהוב!

@gotmax23
Copy link
Contributor

Also, make sure that your code is idempotent.

@assapir
Copy link
Author

assapir commented Oct 21, 2021

Also, make sure that your code is idempotent.

Yes, this is idempotent. nothing happens if you try to refresh if the packages db is already up-to-date.

I fix the flag. trying to use the full flag (aka --refresh) doesn't work and fails.

@assapir
Copy link
Author

assapir commented Oct 21, 2021

גם, ראיתי שאתה ישראלי. עברית היא השפה השניה שלי. זא מגניב לראות אנשים אחרים שמדברים עברית על גיטהוב!

יש המון :)

@gotmax23
Copy link
Contributor

I think you should change refresh to update_cache so you are inline with the other Ansible package modules.

@assapir
Copy link
Author

assapir commented Oct 22, 2021

I think you should change refresh to update_cache so you are inline with the other Ansible package modules.

done

@kewlfft
Copy link
Owner

kewlfft commented Oct 25, 2021

I understand better now with --refresh, I will review shortly

@kewlfft kewlfft merged commit c8bf68a into kewlfft:master Nov 1, 2021
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