Closed philmmanjaro closed 7 years ago
The --no-update on itself does nothing
## When set to True prevents the regeneration of the mirrorlist if
## pacman-mirrors is invoked with the --no-update argument.
## Useful if you don't want the mirrorlist regenerated after a
## pacman-mirrors package upgrade.
# NoUpdate = False
The --no-update requires NoUpdate = True in pacman-mirrors.conf
If you use the recently added --no-mirrorlist argument you have the desired effect
If you use the --no-mirrorlist argument you have the desired effect
Are you sure?
phil@manjaro ~/dev/git/manjaro/basic/pacman-mirrors $ sudo pacman-mirrors --no-mirrorlist
.: Info Downloading mirrors from repo.manjaro.org
.: Info Schreibe Mirrorliste
Germany : https://mirror.netzspielplatz.de/manjaro/packages/unstable
.: Info Mirrordatei generiert und gesichert in: /etc/pacman.d/mirrorlist
No - will check immediately - I think it is connected to the api - try adding -a
The issue is: When we update our system and pacman-mirrors regenerates the mirrorlist file it may lead to an outdated mirror and then the update might fail. Therefore it is better not to edit the mirrorlist on post_upgrade. Downloading a new list of available mirrors however might make sense. The generation of the mirrorlist however should be triggered by the user himself when already installed.
There is no function --no-mirrorlist. Also the -no-update should work with the switch only and is needed for package pacman-mirrors update thru pacman. Using a switch in our config makes no sense at all. So we have to fix that and make the function work without the need to configure it first.
The users pacman databases reflects the former primary mirror. Thus when changing the mirrorlist we remove the symbiotic relationship between the users computer and the primary mirror leading to partial updates and a broken user system.
I see where you are going.
I you will do it at you have done it up till now you can do
pacman-mirrors --geoip --no-update -u
Now I remember why I wanted to call it -y --sync instead of update because it makes no sense at all to present to args --update and --no-update which refers to two completely different concepts
Whatever we call it. It just needs to make sense. We might want to have the latest mirrors-yaml file downloaded, however /etc/pacman.d/mirrorlist should only be touched by first install of the package or when the user wants it. This created a lot of unneeded issues for our users.
Since I use Netzspielplatz mirror, I don't care, as it is always the same mirror and syncs every 5 mins. Others might not.
There is no function --no-mirrorlist.
Yes there is :) it is tied to api so -a -n will skip mirrorlist but since you have scripts every where relying on --no-update it must be changed so it works as you intend.
Also the -no-update should work with the switch only and is needed for package pacman-mirrors update thru pacman. Using a switch in our config makes no sense at all. So we have to fix that and make the function work without the need to configure it first.
I can't say what has been the idea but that can be changed. However there are users which rely on config - Handys allservers script for example - if you look at the old pacman-mirrors.conf you will see that --no-update has always been connected with the conf.
This created a lot of unneeded issues for our users.
Agree - I will change the 4.2.0 version to
Breaking changes to previously introduced behavior
With these backwards breaking changes is the version then 5.0.0?
Ok, then we keep the logic. However I need some option to update the package pacman-mirrors within a regular System update without generation of mirrorlist. If --no-mirrorlist is the switch to go, then it is fine with me. Simply put: with a post_upgrade we should not touch /etc/pacman.d/mirrorlist.
Do you want to keep --no-update as is (the allservers script)?
And change the regular updates to use -a --no-mirrorlist?
Should I remove --no-updates dependency on the config entry NoUpdate = True?
--no-mirrorlist seems not documented. If the switch available is --no-update then we should remove the need of NoUpdate = True in our conf. However the naming was in the past as no update of mirrorlist. Since we now also update the available mirrors in our yaml file the naming now might confuse. So using some like -no-mirrorlist makes sense. Handy may update his script as we are upstream and decide if a switch makes sense or not. The naming we give our functions must make some sense and don't confuse people.
Simply put: --no-mirrorlist might be the function I need to have the mirrorlist not updated. We may then think about dropping --no-update completely in v4.2.0 as not needed anymore. This will give Handy time to adopt, as removing a function leads to a version bump of our application.
In docs/index.md in the API section
-n, --no-mirrorlist
Skip mirrorlist and exit when tasks has been done.
Just remember --no-mirrorlist will not work without --api argument :)
Ok, so it is no bug and I simply have to use pacman-mirrors --api -n
in my PKGBUILD for post_upgrade function?
We can get the best from both worlds by
So your system update
pacman-mirrors --no-mirrorlist
which will effectively update the users mirrorfiles (mirrors.json and status.json) and then exit
@philmmanjaro I have changed behavior in master branch 4.2.0-dev
I have pushed to 4.1.x-stable
This is not a breaking change for 4.1.0-stable - a minor behind the scenes improvement :)
For v4.1.x it is fine as it is. I simply use --api --no-mirrorlist in post_upgrade function, or does this not download the current status.json file? For v4.2.x I'll use --no-mirrorlist.
It does not download any files - it works as you expected --no-update to - exit - no change
Ok, sounds fine. However the source-code checks are partly broken in master and 4.1.x-stable branch. Maybe you adopt them to your made changes. I assume the given code now works :+1:
Let me check and report back
@philmmanjaro Check - all green
Ok, for master it is, not for stable ;)
I am sorry I can't see what is failing - make test exits clean
Is it a command a screwed up?
@philmmanjaro Found it and fixed
Hmm, seems still failing ... https://github.com/manjaro/pacman-mirrors/issues/100
Annoying as they are - they are harmless.
Wait 5 and I have fixed the tests.
And they fixes is up
The dev package does need the same change as the stable package.
pacman-mirrors --no-mirrorlist
https://github.com/manjaro/packages-core/commit/4b34b260896fcb5e9e838f24dd738319c7f7a47a
I added alpm hooks for the dev package currently, but they work for default pacman-mirros too if required.
We have some issues with the --no-update function. In post_upgrade we use
pacman-mirrors -g --no-update
. This however results somehow in a new generated mirrorlist and might lead to an outdated mirror. When we update pacman-mirrors we shouldn't change the given mirrorlist. This will prevent some issues we currently have.