-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: parsing options in sources.list (LP: #1822712) #148
Conversation
|
Thanks for developing a fix. Please add a test case for the crash. Maybe the better fix is to offload the parsing to python-apt instead? |
Codecov Report
@@ Coverage Diff @@
## main #148 +/- ##
===========================================
- Coverage 81.95% 46.52% -35.44%
===========================================
Files 87 74 -13
Lines 18197 17271 -926
===========================================
- Hits 14914 8035 -6879
- Misses 3283 9236 +5953
... and 58 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
Using python-apt would give us deb822 compat for free, too :) |
|
This finds the url: |
In sources.list the enclosing brackets of the options are separated by
spaces from option values, e.g.
deb [ arch=riscv64 ] http://ports.ubuntu.com/ubuntu-ports/ lunar main
Fixes: f7ab55f ("* apt/dpkg: Recognize options in apt sources.list. (LP: #1238620)")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
89f37cb
to
6394417
Compare
This would require changing _get_mirror() which uses hard coded "/etc/apt/sources.list". DEB822 sources have the extension .sources. |
The assumption that all sources in /etc/apt/sources.list use the same url which is illegal. The whole class should be rewritten. But that is beyond the scope of a simple bug fix. |
82162a4
to
6d160bc
Compare
|
Test added |
Provide a test for __AptDpkgPackageInfo.get_primary_mirror_from_apt_sources(). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
6d160bc
to
9b29db2
Compare
This code snippet is what we want to use instead of extending our parser further. I used your research and your test case and developed a fix that uses |
|
Superseded by #154 |
In sources.list the enclosing brackets of the options are separated by spaces from option values, e.g.
Fixes: f7ab55f ("* apt/dpkg: Recognize options in apt sources.list. (LP: #1238620)")