Bug 436171

Summary: Double commented line in Discover hides all valid entries from sources.list
Product: [Applications] Discover Reporter: Daniel <kde>
Component: discoverAssignee: Dan Leinir Turthra Jensen <leinir>
Status: RESOLVED UPSTREAM    
Severity: normal CC: aleixpol, nate
Priority: NOR    
Version First Reported In: 5.21.4   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Daniel 2021-04-25 16:21:11 UTC
SUMMARY
plasma-discover does not handle commented lines in /etc/apt/sources.list properly.

STEPS TO REPRODUCE
1. add the following line to your sources.list:
# deb file://archive.local/user/pervert_penguin ./ # test
2. Start `plasma-discover` from command line, switch to settings

OBSERVED RESULT
No sources are shown (besides snap, flatpak, ...)
Get the terminal-message «Transaction error:  PackageKit::Transaction::ErrorFailedConfigParsing "E: Syntax error in line # deb file://archive.local/user/pervert_panda ./ # test\nW: Ignoring invalid record(s) in sources.list file!\nE: Cannot read vendors.list file\n" PackageKit::Transaction(0x5634082d97b0)»


EXPECTED RESULT
The tool should ignore any line beginning with #

SOFTWARE/OS VERSIONS
Discover: 5.21.4
Linux/KDE Plasma: KDE neon
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
The same behaviour occurs in Kubuntu 20.04 (Discover 5.18, KDE/Qt: ancientstable ;) )
Comment 1 Nate Graham 2021-04-27 18:02:42 UTC
Discover doesn't read this file directly; it relies on the PackageKit library to read the file and abstract its contents for us. The fact that the error message you saw in the console output came from PackageKit ("PackageKit::Transaction::ErrorFailedConfigParsing 'blablabla'") is a clue.

So you would need to report this to the PackageKit developers at https://github.com/hughsie/PackageKit/issues

Thanks!
Comment 2 Daniel 2021-05-02 11:30:27 UTC
Hello Nate,

i've reported upstream at
https://github.com/hughsie/PackageKit/issues/469

Thanks too!
Comment 3 Nate Graham 2021-05-03 15:48:25 UTC
You're welcome!