Summary: | app-portage/mirrorselect ignores continuation lines (backslash) in make.conf | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Jack <ostroffjh> |
Component: | Tools | Assignee: | Portage Tools Team <tools-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | InVCS |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Use shlex to support multi-line GENTOO_MIRRORS assignments
GENTOO_MIRROPRS patch for multiline mirror list |
Description
Jack
2015-03-19 18:24:10 UTC
I just confirmed the problem is still present with versions 2.2.2-r2 and 2.2.3. Problem still present in mirrorselect-2.2.4-r1 The faulty code is located at https://gitweb.gentoo.org/proj/mirrorselect.git/tree/mirrorselect/configs.py?h=2.2.4#n78: > regex = re.compile('^%s=.*' % var) > for line in lines: > if regex.match(line): > lines.remove(line) We can use a shlex instance to detect the line number where the GENTOO_MIRRORS setting ends. This is the same approach that portage uses to read make.conf, and mirrorselect already uses this approach in the get_filesystem_mirrors function here: https://gitweb.gentoo.org/proj/mirrorselect.git/tree/mirrorselect/configs.py?h=2.2.4#n153 Created attachment 577868 [details, diff]
Use shlex to support multi-line GENTOO_MIRRORS assignments
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=42238f4ff13ae6c75bc1925f366429a35c26317d commit 42238f4ff13ae6c75bc1925f366429a35c26317d Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2019-05-27 06:11:28 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-05-27 07:39:39 +0000 write_make_conf: support multi-line GENTOO_MIRRORS (bug 543814) Use shlex to support multi-line GENTOO_MIRRORS assignments. Bug: https://bugs.gentoo.org/543814 Signed-off-by: Zac Medico <zmedico@gentoo.org> .gitignore | 1 - mirrorselect/configs.py | 33 +++++++++++++++++++++++++++------ setup.py | 37 ++++++++++++++++++------------------- tests/__init__.py | 0 tests/test_write_make_conf.py | 41 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 26 deletions(-) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82bbe253084208ac9216f8a5a822e8e15361d7f4 commit 82bbe253084208ac9216f8a5a822e8e15361d7f4 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2019-05-27 17:47:08 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-05-27 18:10:57 +0000 app-portage/mirrorselect: version bump to 2.2.5 Bug: https://bugs.gentoo.org/543814 Bug: https://bugs.gentoo.org/582508 Package-Manager: Portage-2.3.67, Repoman-2.3.13 Signed-off-by: Zac Medico <zmedico@gentoo.org> app-portage/mirrorselect/Manifest | 1 + app-portage/mirrorselect/mirrorselect-2.2.5.ebuild | 39 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) I confirm 2.2.6-r1 fixes the problem. Is there any reasonable way to get it to use backslashes and one mirror per line, especially if the previous version had it that way? (I agree it may not be worth the effort it would take, but ask just in case.) Created attachment 781601 [details, diff]
GENTOO_MIRROPRS patch for multiline mirror list
possible backslah patch for 1 mirror per line.
Something is still strange. I just tried "mirrorselect -R 'North America' -s 5" (with my current make.conf having four mirrors on separate linet) which replace the current selection with four servers on one line. I recompiled with the patch from Comment #8, increasing to '-s 6' and then "-s 10" and it put three servers (but correctly on separate lines.) Note that in all cases, it recognized the -s parameter saying "Using netselect to choose the top 6 mirrors...Done." with the appropriate number. Why would it not provide the number of mirrors it said it was going to? Is it related, or a separate bug? My comment #10 still applies (without needing that patch) with mirrorselect-2.3.0-r1 - whether I use -s 6 or -s 10, I only get three mirrors. In addition 'mirrorselect -a -R "North America"' gives me "ERROR: Choose at most one of -s or -a". Should I close this as FIXED and open a new bug, or can someone look at this issue? I see there is already bug 872218 for --all not working, so I suppose this can be closed as fixed, but it should probably refer to the appropriate commit. (In reply to Jack from comment #12) > I see there is already bug 872218 for --all not working, so I suppose this > can be closed as fixed, but it should probably refer to the appropriate > commit. Indeed, https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=a09b4d302e4cee79254d3ff4a5ac9f080b958acf in 2.3.0. Would you mind filing a new bug if there's any outstanding issues (aside from the aforementioned --all issue)? Thanks. Confirmed this does now work correctly. Thanks. |