manjaro / pacman-mirrors

This repo has been archived. Our code is now hosted at
https://gitlab.manjaro.org
GNU General Public License v3.0
25 stars 16 forks source link

v.4.3 #112

Closed fhdk closed 7 years ago

fhdk commented 7 years ago

I have made the following changes mostly based on the feed back from the forum post.

https://forum.manjaro.org/t/change-to-pacman-mirrors-app/30751

The highlights are

The was a majority of users who would like to be sure they were using an up-to-date mirror so when generating a mirror list - the users branch are used when selecting up-to-date mirrors. This works for both -f -g

The only place which has not changed is the interactive which as defined is created to give the user full control over the mirror file generation. The only thing not controlled here is the protocol selection which, if done, the user has specifically altered pacman-mirrors.conf.

I have ran all more than 100 tests and and would like you to preview the changes before building it for unstable branch. When looking at my branch it seems like the Travis build reveals no obvious mistakes.

Though it is not strictly necessary I have ensured all lines comply with PEP and the flake8 linter.

I have rearranged the files in module folders - I think it is a huge improvement to having it all in one folder.

There are some obvious points in the code I have added extended commenting simply because the understanding on the how and why is essential at those point - so please let the be for an eventual successor.

So please gentlemen - the hunt is hereby opened :bangbang:

philmmanjaro commented 7 years ago

Will give it a try ...

philmmanjaro commented 7 years ago

Ok, seems it is somehow broken:

[2017-10-17 02:48] [ALPM] running 'pacman-mirrors-upgrade.hook'...
[2017-10-17 02:48] [ALPM-SCRIPTLET] Traceback (most recent call last):
[2017-10-17 02:48] [ALPM-SCRIPTLET]   File "/usr/sbin/pacman-mirrors", line 23, in <module>
[2017-10-17 02:48] [ALPM-SCRIPTLET]     from pacman_mirrors import pacman_mirrors
[2017-10-17 02:48] [ALPM-SCRIPTLET]   File "/usr/lib/python3.6/site-packages/pacman_mirrors/pacman_mirrors.py", line 37, in <module>
[2017-10-17 02:48] [ALPM-SCRIPTLET]     from pacman_mirrors.api import apifn
[2017-10-17 02:48] [ALPM-SCRIPTLET] ModuleNotFoundError: No module named 'pacman_mirrors.api'
[2017-10-17 02:48] [ALPM-SCRIPTLET] hint: use `pacman-mirrors` to generate and update your pacman mirrorlist.
fhdk commented 7 years ago

From the message it seems that the new folder structure is not created correct.

Maybe this is the setup.py generating this mess - I must admit - that I didn't test.

My bad - I missed a couple of module folders in setup.py.

I also missed the a change to 4.2 which removed the requirement of root to read the current branch.

I corrected the errors.

excalibur1234 commented 7 years ago

the -g and -y arguments are still mentioned as non-deprecated when running "pacman-mirrors -h". please correct that.

also, -g and -y arguments are clearly mentioned as deprecated in the man page and when running "sudo pacman-mirrors -g -y". do these arguments still work as intended? will these arguments stop working in pacman-mirrors 4.4?

fhdk commented 7 years ago

Thanks for noting the issue with the -h argument. I will fix that.

The reasoning behind letting the -g and -y live a little longer is making a forehand warning about the coming deprecation so when the are removed no confusion exist. So they will probably be removed with the next version.