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

"pkg set-publisher" should have a flag to clear all existing mirrors #448

Open
jclulow opened this issue Sep 24, 2023 · 2 comments
Open

Comments

@jclulow
Copy link

jclulow commented Sep 24, 2023

The --origin-uri (-O) flag to pkg set-publisher will remove and replace all existing origin type publisher entries from the configuration.

There does not appear to be an analogous flag for replacing all current mirror type publisher entries; --add-mirror (-m) and --remove-mirror (-M) both require understanding the current state before specifying a new one.

Basically it would be good to be able to do something like:

pkg set-publisher \
    -O https://pkg.omnios.org/r151046/core/ \
    -I https://us-west.mirror.omnios.org/r151046/core/ \
    omnios

And end up replacing any existing origin and mirror records for the omnios publisher.

I suspect it would also be good to have a --no-mirrors flag as well, that would remove all mirror entries altogether, in case the new repository doesn't actually come with a mirror anymore; i.e.,

pkg set-publisher \
    -O https://pkg.omnios.org/r151046/core/ \
    --no-mirrors \
    omnios

This would replace all origin entries and remove any mirror entries (if any are present) in one operation.

@citrus-it
Copy link
Member

citrus-it commented Sep 24, 2023

You can use -M '*' to remove all mirrors, and even chain this with -m

root@braich:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
omnios                      origin   online F https://pkg.omnios.org/bloody/braich/
omnios                      mirror   online F https://us-west.mirror.omnios.org/bloody/braich/

root@braich:~# pkg set-publisher -O https://pkg.omnios.org/bloody/core -M '*' -m https://us-west.mirror.omnios.org/bloody/core omnios

root@braich:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
omnios                      origin   online F https://pkg.omnios.org/bloody/core/
omnios                      mirror   online F https://us-west.mirror.omnios.org/bloody/core/

A flag like -O but for mirrors sounds useful, but -O is basically implemented as -G '*' -g

@jclulow
Copy link
Author

jclulow commented Sep 25, 2023

Ah, it's even right there in the manual! Thanks!

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

No branches or pull requests

2 participants