Skip to content

Add Deb822 sources support (issue #149) - #150

Open
aybanda wants to merge 43 commits into
mvo5:masterfrom
aybanda:feature/deb822-sources
Open

Add Deb822 sources support (issue #149)#150
aybanda wants to merge 43 commits into
mvo5:masterfrom
aybanda:feature/deb822-sources

Conversation

@aybanda

@aybandaaybanda commented May 5, 2025

Copy link
Copy Markdown

This PR implements support for the Deb822 source format in Synaptic, as requested in issue #149.

What’s new

  • Introduces RDeb822Source and RSourceManager classes for parsing, validating, and serializing Deb822 sources.
  • Updates the repository window UI to allow adding, editing, and removing Deb822 sources.
  • Handles multiple URIs and suites per source, and supports enabling/disabling sources.
  • Ensures backward compatibility with existing sources.

Testing

  • Added C++ integration tests (tests/test_deb822_integration.cc) to verify parsing, file I/O, and validation.
  • Supplemented with a Python script to simulate and test edge cases for Deb822 parsing and logic. (not included)

Sample Python test results

Created test directory: /tmp/tmpabcd1234
Initialized source manager
Source validation: PASS
Source string representation:
deb http://example.com stable main
Successfully wrote source to file: /tmp/tmpabcd1234/test.sources
Read source from file:
Type: deb
URI: http://example.com
Suite: stable
Components: main
Disabled source test: PASS
Multiple URIs test: PASS
Multiple suites test: PASS

@aybandaaybanda mentioned this pull request May 5, 2025
Comment threadgtk/rgrepositorywindow.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why were the rgrepositorywin.* files renamed to rgrepositorywindow?

This probably won't work properly with the rest of the build process and also the translatable strings present in these files won't get translated.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll revert this, renaming was unintentional

@mvo5

mvo5 commented May 5, 2025

Copy link
Copy Markdown
Owner

I tried this real quick (did not really look into the code) with my "apt modernize-source" updates sources but I only get an empty window when I open the repository dialog.

My debian sources:

$ cat /etc/apt/sources.list.d/debian.sources 
# Modernized from /etc/apt/sources.listTypes: deb deb-srcURIs: http://ftp.de.debian.org/debian/Suites: trixieComponents: main non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# Modernized from /etc/apt/sources.listTypes: deb deb-srcURIs: http://security.debian.org/debian-security/Suites: trixie-securityComponents: main non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# Modernized from /etc/apt/sources.listTypes: deb deb-srcURIs: http://ftp.de.debian.org/debian/Suites: trixie-updatesComponents: main non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

@aybanda

Copy link
Copy Markdown
Author

I tried this real quick (did not really look into the code) with my "apt modernize-source" updates sources but I only get an empty window when I open the repository dialog.

My debian sources:

$ cat /etc/apt/sources.list.d/debian.sources # Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://ftp.de.debian.org/debian/
Suites: trixie
Components: main non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://ftp.de.debian.org/debian/
Suites: trixie-updates
Components: main non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

I've made several improvements, Could you please test again with your file? You should see all three sources listed in the window.

Comment threadcommon/rpackagelister.cc Outdated
#endif
}

bool RPackageLister::handleFailedInstallation(const string &pkgName)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks unrelated to deb822? It looks interesting and maybe worth its own PR but I would prefer if we could keep this PR strictly focused on deb822 support :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still get compiler errors for this function and when I remove it the build fails now with:

$ make.../usr/bin/ld: ../common/libsynaptic.a(rsources.o): in function `SourcesList::ReadDeb822SourcePart(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':/home/mvogt/devel/synaptic/trunk.git/common/rsources.cc:592:(.text+0x386e): undefined reference to `RDeb822Source::ParseDeb822File(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<RDeb822Source::Deb822Entry, std::allocator<RDeb822Source::Deb822Entry> >&)'/usr/bin/ld: /home/mvogt/devel/synaptic/trunk.git/common/rsources.cc:600:(.text+0x39c3): undefined reference to `RDeb822Source::ConvertToSourceRecord(RDeb822Source::Deb822Entry const&, SourcesList::SourceRecord&)'/usr/bin/ld: ../common/libsynaptic.a(rsources.o): in function `SourcesList::WriteDeb822Source(SourcesList::SourceRecord*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':/home/mvogt/devel/synaptic/trunk.git/common/rsources.cc:651:(.text+0x5c24): undefined reference to `RDeb822Source::ConvertFromSourceRecord(SourcesList::SourceRecord const&, RDeb822Source::Deb822Entry&)'/usr/bin/ld: /home/mvogt/devel/synaptic/trunk.git/common/rsources.cc:656:(.text+0x5d5e): undefined reference to `RDeb822Source::WriteDeb822File(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<RDeb822Source::Deb822Entry, std::allocator<RDeb822Source::Deb822Entry> > const&)'/usr/bin/ld: ../common/libsynaptic.a(rsources.o): in function `SourcesList::UpdateSources()':/home/mvogt/devel/synaptic/trunk.git/common/rsources.cc:340:(.text+0x6a80): undefined reference to `RDeb822Source::ConvertFromSourceRecord(SourcesList::SourceRecord const&, RDeb822Source::Deb822Entry&)'/usr/bin/ld: /home/mvogt/devel/synaptic/trunk.git/common/rsources.cc:345:(.text+0x6ad5): undefined reference to `RDeb822Source::WriteDeb822File(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<RDeb822Source::Deb822Entry, std::allocator<RDeb822Source::Deb822Entry> > const&)'

this is a standard debian/unstable system I'm testing with. Any hints how to resolve this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linker errors persist because we need to regenerate the build system after adding rsource_deb822.cc and rsource_deb822.h to Makefile.am. try running:

./autogen.sh
./configure
make clean
make

This will ensure the new files are properly integrated into the build system.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I tried this but no luck - when I pulled now I get a different error and it looks like common/rsource_deb822.cc is now urf-16 instead of the expected ascii or utf-8. this makes g++ unhappy:

$ file common/rsource_deb822.cccommon/rsource_deb822.cc: C source, Unicode text, UTF-16, little-endian text, with CRLF line terminators...
$ file common/rswig.h common/rswig.h: C++ source, ASCII text

can you please update again? (in GH the file is also shown as binary data now).

@mvo5

mvo5 commented May 5, 2025

Copy link
Copy Markdown
Owner

I tried this real quick (did not really look into the code) with my "apt modernize-source" updates sources but I only get an empty window when I open the repository dialog.
[..]
I've made several improvements, Could you please test again with your file? You should see all three sources listed in the window.

It currently fails to build in the new "handleFailedInstallation" - if I remove this new function it builds and runs but still no luck, still an empty repositories window for me.

@mvo5mvo5 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for working on this! Some quick feedback inline, still have not read the code line-by-line but went real quick over it)

Comment threadcommon/rpackagemanager.h Outdated

};

/**

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets put this into either "rsources.{cc,h}" or a new "rsource_deb822.{cc,h}" - the rpackagemanager file is not quite the right place for this (and/or rsources_deb822 and rsources_manager).

Comment threadcommon/rsource_deb822.cc Outdated
@@ -0,0 +1,252 @@
/* rsource_deb822.cc - Deb822 format sources support

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new file should be added to POTFILES.in.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be wrong, but shouldn't this new file be also added to common/Makefile.am?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you are right

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add it? Thanks! :-)

@mvo5

mvo5 commented May 13, 2025

Copy link
Copy Markdown
Owner

Thank you, I still get compiler errors when I run this locally, if you could rebase the branch to current master that would be great, this way we will get working CI again (the github action was on ubuntu-20.04 and 15b6a17 which is EOL now moved it to ubuntu-latest)

@aybandaaybanda closed this May 15, 2025
@aybanda
aybandaforce-pushed the feature/deb822-sources branch from 0e07c9b to 15b6a17CompareMay 15, 2025 15:49
@AsciiWolf

AsciiWolf commented May 15, 2025

Copy link
Copy Markdown
Contributor

Why was this closed and all commits removed?

@aybandaaybanda reopened this May 15, 2025
@aybanda

Copy link
Copy Markdown
Author

Why was this closed and all commits removed?

While rebasing, The PR closed due to a force-push that temporarily removed my changes.

@aybanda

Copy link
Copy Markdown
Author

Thank you, I still get compiler errors when I run this locally, if you could rebase the branch to current master that would be great, this way we will get working CI again (the github action was on ubuntu-20.04 and 15b6a17 which is EOL now moved it to ubuntu-latest)

I've rebased the branch to the current master, which includes the CI workflow update from ubuntu-20.04 to ubuntu-latest. This should resolve the CI issues.

Regarding the compiler errors you're seeing locally, could you please share the specific error messages?

@AsciiWolf

Copy link
Copy Markdown
Contributor

@aybanda Not sure about Michael's errors, but this is how it looks like on my (Debian Testing) system:

$ sudo apt-get build-dep synaptic
$ ./autogen.sh
$ ./configure --prefix=/usr
$ make -j32
make all-recursive
make[1]: Entering directory '/home/asciiwolf/synaptic'
Making all in data
make[2]: Entering directory '/home/asciiwolf/synaptic/data'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/asciiwolf/synaptic/data'
Making all in common
make[2]: Entering directory '/home/asciiwolf/synaptic/common'
depbase=`echo rpackagelister.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/apt-pkg -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/usr/var"\" -g -O2 -MT rpackagelister.o -MD -MP -MF $depbase.Tpo -c -o rpackagelister.o rpackagelister.cc &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo rsource_deb822.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/apt-pkg -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/usr/var"\" -g -O2 -MT rsource_deb822.o -MD -MP -MF $depbase.Tpo -c -o rsource_deb822.o rsource_deb822.cc &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo rpackagemanager.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/apt-pkg -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/usr/var"\" -g -O2 -MT rpackagemanager.o -MD -MP -MF $depbase.Tpo -c -o rpackagemanager.o rpackagemanager.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from rsource_deb822.cc:6:
rsource_deb822.h:37:65: error: 'SourcesList' has not been declared
37 | static bool ConvertToSourceRecord(const Deb822Entry& entry, SourcesList::SourceRecord& record);
| ^~~~~~~~~~~
rsource_deb822.h:37:90: error: expected ',' or '...' before '&' token
37 | static bool ConvertToSourceRecord(const Deb822Entry& entry, SourcesList::SourceRecord& record);
| ^
rsource_deb822.h:38:47: error: 'SourcesList' does not name a type; did you mean 'pkgSourceList'?
38 | static bool ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry);
| ^~~~~~~~~~~
| pkgSourceList
rsource_deb822.h:38:72: error: expected unqualified-id before '&' token
38 | static bool ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry);
| ^
rsource_deb822.h:38:72: error: expected ')' before '&' token
38 | static bool ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry);
| ~ ^
| )
rsource_deb822.h:38:72: error: static member function 'static bool RDeb822Source::ConvertFromSourceRecord(...)' cannot have ref-qualifier
rsource_deb822.h:38:72: error: expected ';' at end of member declaration
38 | static bool ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry);
| ^
| ;
rsource_deb822.h:38:74: error: 'record' does not name a type
38 | static bool ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry);
| ^~~~~~
rsource_deb822.cc: In static member function 'static bool RDeb822Source::ParseDeb822File(const std::string&, std::vector<Deb822Entry>&)':
rsource_deb822.cc:20:16: error: '_error' was not declared in this scope; did you mean 'perror'?
20 | return _error->Error(_("Cannot open %s"), path.c_str());
| ^~~~~~
| perror
rsource_deb822.cc:33:20: error: '_error' was not declared in this scope; did you mean 'perror'?
33 | return _error->Error(_("Missing Types field in %s"), path.c_str());
| ^~~~~~
| perror
rsource_deb822.cc:39:20: error: '_error' was not declared in this scope; did you mean 'perror'?
39 | return _error->Error(_("Missing URIs field in %s"), path.c_str());
| ^~~~~~
| perror
rsource_deb822.cc:45:20: error: '_error' was not declared in this scope; did you mean 'perror'?
45 | return _error->Error(_("Missing Suites field in %s"), path.c_str());
| ^~~~~~
| perror
rsource_deb822.cc: In static member function 'static bool RDeb822Source::WriteDeb822File(const std::string&, const std::vector<Deb822Entry>&)':
rsource_deb822.cc:77:16: error: '_error' was not declared in this scope; did you mean 'perror'?
77 | return _error->Error(_("Cannot write to %s"), path.c_str());
| ^~~~~~
| perror
rsource_deb822.cc: At global scope:
rsource_deb822.cc:128:69: error: 'SourcesList' has not been declared
128 | bool RDeb822Source::ConvertToSourceRecord(const Deb822Entry& entry, SourcesList::SourceRecord& record) {
| ^~~~~~~~~~~
rsource_deb822.cc:128:94: error: expected ',' or '...' before '&' token
128 | bool RDeb822Source::ConvertToSourceRecord(const Deb822Entry& entry, SourcesList::SourceRecord& record) {
| ^
rsource_deb822.cc: In static member function 'static bool RDeb822Source::ConvertToSourceRecord(const Deb822Entry&, int)':
rsource_deb822.cc:138:5: error: 'record' was not declared in this scope
138 | record.Type = 0;
| ^~~~~~
rsource_deb822.cc:139:33: error: 'SourcesList' has not been declared
139 | if (has_deb) record.Type |= SourcesList::Deb;
| ^~~~~~~~~~~
rsource_deb822.cc:140:37: error: 'SourcesList' has not been declared
140 | if (has_deb_src) record.Type |= SourcesList::DebSrc;
| ^~~~~~~~~~~
rsource_deb822.cc:141:40: error: 'SourcesList' has not been declared
141 | if (!entry.Enabled) record.Type |= SourcesList::Disabled;
| ^~~~~~~~~~~
rsource_deb822.cc: At global scope:
rsource_deb822.cc:194:51: error: 'SourcesList' does not name a type; did you mean 'pkgSourceList'?
194 | bool RDeb822Source::ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry) {
| ^~~~~~~~~~~
| pkgSourceList
rsource_deb822.cc:194:76: error: expected unqualified-id before '&' token
194 | bool RDeb822Source::ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry) {
| ^
rsource_deb822.cc:194:76: error: expected ')' before '&' token
194 | bool RDeb822Source::ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry) {
| ~ ^
| )
rsource_deb822.cc:194:78: error: expected initializer before 'record'
194 | bool RDeb822Source::ConvertFromSourceRecord(const SourcesList::SourceRecord& record, Deb822Entry& entry) {
| ^~~~~~
rsource_deb822.cc:289:6: error: no declaration matches 'void RDeb822Source::TrimWhitespace(std::string&)'
289 | void RDeb822Source::TrimWhitespace(std::string& str) {
| ^~~~~~~~~~~~~
rsource_deb822.cc:289:6: note: no functions named 'void RDeb822Source::TrimWhitespace(std::string&)'
rsource_deb822.h:20:7: note: 'class RDeb822Source' defined here
20 | class RDeb822Source {
| ^~~~~~~~~~~~~
In file included from rpackagemanager.cc:1:
rpackagemanager.h: In member function 'pkgPackageManager::OrderResult RPackageManager::DoInstallPostFork()':
rpackagemanager.h:72:21: error: no matching function for call to 'pkgPackageManager::Go()'
72 | return (pm->Go() == false) ? pkgPackageManager::Failed : Res;
| ~~~~~~^~
In file included from rpackagemanager.h:46:
/usr/include/apt-pkg/packagemanager.h:91:17: note: candidate: 'virtual bool pkgPackageManager::Go(APT::Progress::PackageManager*)'
91 | virtual bool Go(APT::Progress::PackageManager * /*progress*/) {return true;};
| ^~
/usr/include/apt-pkg/packagemanager.h:91:17: note: candidate expects 1 argument, 0 provided
make[2]: *** [Makefile:486: rsource_deb822.o] Error 1
make[2]: *** Waiting for unfinished jobs....
rpackagemanager.cc: At global scope:
rpackagemanager.cc:10:1: error: redefinition of 'RPackageManager::RPackageManager(pkgPackageManager*)'
10 | RPackageManager::RPackageManager(pkgPackageManager *pm) : pm(pm) {}
| ^~~~~~~~~~~~~~~
rpackagemanager.h:76:4: note: 'RPackageManager::RPackageManager(pkgPackageManager*)' previously defined here
76 | RPackageManager(pkgPackageManager *pm) : pm(pm) {}
| ^~~~~~~~~~~~~~~
rpackagemanager.cc:12:32: error: redefinition of 'pkgPackageManager::OrderResult RPackageManager::DoInstallPreFork()'
12 | pkgPackageManager::OrderResult RPackageManager::DoInstallPreFork() {
| ^~~~~~~~~~~~~~~
rpackagemanager.h:62:35: note: 'pkgPackageManager::OrderResult RPackageManager::DoInstallPreFork()' previously defined here
62 | pkgPackageManager::OrderResult DoInstallPreFork() {
| ^~~~~~~~~~~~~~~~
rpackagemanager.cc:22:32: error: redefinition of 'pkgPackageManager::OrderResult RPackageManager::DoInstallPostFork()'
22 | pkgPackageManager::OrderResult RPackageManager::DoInstallPostFork() {
| ^~~~~~~~~~~~~~~
rpackagemanager.h:71:35: note: 'pkgPackageManager::OrderResult RPackageManager::DoInstallPostFork()' previously defined here
71 | pkgPackageManager::OrderResult DoInstallPostFork() {
| ^~~~~~~~~~~~~~~~~
rpackagemanager.cc:28:1: error: 'RDeb822Source' does not name a type
28 | RDeb822Source::RDeb822Source() : enabled(true) {}
| ^~~~~~~~~~~~~
rpackagemanager.cc:30:1: error: 'RDeb822Source' does not name a type
30 | RDeb822Source::RDeb822Source(const std::string& types, const std::string& uris,
| ^~~~~~~~~~~~~
rpackagemanager.cc:34:6: error: 'RDeb822Source' has not been declared
34 | bool RDeb822Source::isValid() const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:34:31: error: non-member function 'bool isValid()' cannot have cv-qualifier
34 | bool RDeb822Source::isValid() const {
| ^~~~~
rpackagemanager.cc: In function 'bool isValid()':
rpackagemanager.cc:36:9: error: 'types' was not declared in this scope; did you mean 'typeof'?
36 | if (types.empty() || uris.empty() || suites.empty()) {
| ^~~~~
| typeof
rpackagemanager.cc:36:26: error: 'uris' was not declared in this scope
36 | if (types.empty() || uris.empty() || suites.empty()) {
| ^~~~
rpackagemanager.cc:36:42: error: 'suites' was not declared in this scope
36 | if (types.empty() || uris.empty() || suites.empty()) {
| ^~~~~~
rpackagemanager.cc:41:9: error: 'types' was not declared in this scope; did you mean 'typeof'?
41 | if (types != "deb" && types != "deb-src") {
| ^~~~~
| typeof
rpackagemanager.cc:46:34: error: 'uris' was not declared in this scope
46 | std::istringstream uriStream(uris);
| ^~~~
rpackagemanager.cc:58:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
58 | if (uri.starts_with("http://") ||
| ^~~~~~~~~~~
rpackagemanager.cc:59:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
59 | uri.starts_with("https://") ||
| ^~~~~~~~~~~
rpackagemanager.cc:60:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
60 | uri.starts_with("ftp://") ||
| ^~~~~~~~~~~
rpackagemanager.cc:61:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
61 | uri.starts_with("file://") ||
| ^~~~~~~~~~~
rpackagemanager.cc:62:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
62 | uri.starts_with("cdrom:")) {
| ^~~~~~~~~~~
rpackagemanager.cc:72:36: error: 'suites' was not declared in this scope
72 | std::istringstream suiteStream(suites);
| ^~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:90:13: error: 'RDeb822Source' has not been declared
90 | std::string RDeb822Source::toString() const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:90:39: error: non-member function 'std::string toString()' cannot have cv-qualifier
90 | std::string RDeb822Source::toString() const {
| ^~~~~
rpackagemanager.cc: In function 'std::string toString()':
rpackagemanager.cc:94:10: error: 'enabled' was not declared in this scope
94 | if (!enabled) {
| ^~~~~~~
rpackagemanager.cc:99:11: error: 'types' was not declared in this scope; did you mean 'typeof'?
99 | ss << types << " " << uris << " " << suites;
| ^~~~~
| typeof
rpackagemanager.cc:99:27: error: 'uris' was not declared in this scope
99 | ss << types << " " << uris << " " << suites;
| ^~~~
rpackagemanager.cc:99:42: error: 'suites' was not declared in this scope
99 | ss << types << " " << uris << " " << suites;
| ^~~~~~
rpackagemanager.cc:100:10: error: 'components' was not declared in this scope
100 | if (!components.empty()) {
| ^~~~~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:108:1: error: 'RDeb822Source' does not name a type
108 | RDeb822Source RDeb822Source::fromString(const std::string& content) {
| ^~~~~~~~~~~~~
rpackagemanager.cc:162:6: error: 'RDeb822Source' has not been declared
162 | bool RDeb822Source::operator==(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:162:38: error: 'RDeb822Source' does not name a type
162 | bool RDeb822Source::operator==(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:162:60: error: non-member function 'bool operator==(const int&)' cannot have cv-qualifier
162 | bool RDeb822Source::operator==(const RDeb822Source& other) const {
| ^~~~~
rpackagemanager.cc:162:6: error: 'bool operator==(const int&)' must have an argument of class or enumerated type
162 | bool RDeb822Source::operator==(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:170:6: error: 'RDeb822Source' has not been declared
170 | bool RDeb822Source::operator!=(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:170:38: error: 'RDeb822Source' does not name a type
170 | bool RDeb822Source::operator!=(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:170:60: error: non-member function 'bool operator!=(const int&)' cannot have cv-qualifier
170 | bool RDeb822Source::operator!=(const RDeb822Source& other) const {
| ^~~~~
rpackagemanager.cc:170:6: error: 'bool operator!=(const int&)' must have an argument of class or enumerated type
170 | bool RDeb822Source::operator!=(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:175:1: error: 'RSourceManager' does not name a type
175 | RSourceManager::RSourceManager() : sourcesDir("/etc/apt/sources.list.d") {}
| ^~~~~~~~~~~~~~
rpackagemanager.cc:177:1: error: 'RSourceManager' does not name a type
177 | RSourceManager::RSourceManager(const std::string& sourcesDir) : sourcesDir(sourcesDir) {}
| ^~~~~~~~~~~~~~
rpackagemanager.cc:179:6: error: 'RSourceManager' has not been declared
179 | bool RSourceManager::addSource(const RDeb822Source& source) {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:179:38: error: 'RDeb822Source' does not name a type
179 | bool RSourceManager::addSource(const RDeb822Source& source) {
| ^~~~~~~~~~~~~
rpackagemanager.cc: In function 'bool addSource(const int&)':
rpackagemanager.cc:180:17: error: request for member 'isValid' in 'source', which is of non-class type 'const int'
180 | if (!source.isValid()) {
| ^~~~~~~
rpackagemanager.cc:185:33: error: 'sources' was not declared in this scope; did you mean 'source'?
185 | for (const auto& existing : sources) {
| ^~~~~~~
| source
rpackagemanager.cc:191:5: error: 'sources' was not declared in this scope; did you mean 'source'?
191 | sources.push_back(source);
| ^~~~~~~
| source
rpackagemanager.cc: At global scope:
rpackagemanager.cc:195:6: error: 'RSourceManager' has not been declared
195 | bool RSourceManager::removeSource(const RDeb822Source& source) {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:195:41: error: 'RDeb822Source' does not name a type
195 | bool RSourceManager::removeSource(const RDeb822Source& source) {
| ^~~~~~~~~~~~~
rpackagemanager.cc: In function 'bool removeSource(const int&)':
rpackagemanager.cc:196:25: error: 'sources' was not declared in this scope; did you mean 'source'?
196 | auto it = std::find(sources.begin(), sources.end(), source);
| ^~~~~~~
| source
rpackagemanager.cc: At global scope:
rpackagemanager.cc:205:6: error: 'RSourceManager' has not been declared
205 | bool RSourceManager::updateSource(const RDeb822Source& oldSource, const RDeb822Source& newSource) {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:205:41: error: 'RDeb822Source' does not name a type
205 | bool RSourceManager::updateSource(const RDeb822Source& oldSource, const RDeb822Source& newSource) {
| ^~~~~~~~~~~~~
rpackagemanager.cc:205:73: error: 'RDeb822Source' does not name a type
205 | bool RSourceManager::updateSource(const RDeb822Source& oldSource, const RDeb822Source& newSource) {
| ^~~~~~~~~~~~~
rpackagemanager.cc: In function 'bool updateSource(const int&, const int&)':
rpackagemanager.cc:206:20: error: request for member 'isValid' in 'newSource', which is of non-class type 'const int'
206 | if (!newSource.isValid()) {
| ^~~~~~~
rpackagemanager.cc:210:25: error: 'sources' was not declared in this scope
210 | auto it = std::find(sources.begin(), sources.end(), oldSource);
| ^~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:219:13: error: 'RDeb822Source' was not declared in this scope
219 | std::vector<RDeb822Source> RSourceManager::getSources() const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:219:26: error: template argument 1 is invalid
219 | std::vector<RDeb822Source> RSourceManager::getSources() const {
| ^
rpackagemanager.cc:219:26: error: template argument 2 is invalid
rpackagemanager.cc:219:28: error: 'RSourceManager' has not been declared
219 | std::vector<RDeb822Source> RSourceManager::getSources() const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:219:57: error: non-member function 'int getSources()' cannot have cv-qualifier
219 | std::vector<RDeb822Source> RSourceManager::getSources() const {
| ^~~~~
rpackagemanager.cc: In function 'int getSources()':
rpackagemanager.cc:220:12: error: 'sources' was not declared in this scope; did you mean 'getSources'?
220 | return sources;
| ^~~~~~~
| getSources
rpackagemanager.cc: At global scope:
rpackagemanager.cc:223:6: error: 'RSourceManager' has not been declared
223 | bool RSourceManager::loadSources() {
| ^~~~~~~~~~~~~~
rpackagemanager.cc: In function 'bool loadSources()':
rpackagemanager.cc:224:5: error: 'sources' was not declared in this scope; did you mean 'getSources'?
224 | sources.clear();
| ^~~~~~~
| getSources
rpackagemanager.cc:228:70: error: 'sourcesDir' was not declared in this scope
228 | for (const auto& entry : std::filesystem::directory_iterator(sourcesDir)) {
| ^~~~~~~~~~
rpackagemanager.cc:243:29: error: 'RDeb822Source' was not declared in this scope
243 | std::vector<RDeb822Source> fileSources = parseSources(content);
| ^~~~~~~~~~~~~
rpackagemanager.cc:243:42: error: template argument 1 is invalid
243 | std::vector<RDeb822Source> fileSources = parseSources(content);
| ^
rpackagemanager.cc:243:42: error: template argument 2 is invalid
rpackagemanager.cc:243:58: error: 'parseSources' was not declared in this scope; did you mean 'fileSources'?
243 | std::vector<RDeb822Source> fileSources = parseSources(content);
| ^~~~~~~~~~~~
| fileSources
rpackagemanager.cc:244:59: error: request for member 'begin' in 'fileSources', which is of non-class type 'int'
244 | sources.insert(sources.end(), fileSources.begin(), fileSources.end());
| ^~~~~
rpackagemanager.cc:244:80: error: request for member 'end' in 'fileSources', which is of non-class type 'int'
244 | sources.insert(sources.end(), fileSources.begin(), fileSources.end());
| ^~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:254:13: error: 'RDeb822Source' was not declared in this scope
254 | std::vector<RDeb822Source> RSourceManager::parseSources(const std::string& content)
| ^~~~~~~~~~~~~
rpackagemanager.cc:254:26: error: template argument 1 is invalid
254 | std::vector<RDeb822Source> RSourceManager::parseSources(const std::string& content)
| ^
rpackagemanager.cc:254:26: error: template argument 2 is invalid
rpackagemanager.cc:254:28: error: 'RSourceManager' has not been declared
254 | std::vector<RDeb822Source> RSourceManager::parseSources(const std::string& content)
| ^~~~~~~~~~~~~~
rpackagemanager.cc: In function 'int parseSources(const std::string&)':
rpackagemanager.cc:256:17: error: 'RDeb822Source' was not declared in this scope
256 | std::vector<RDeb822Source> sources;
| ^~~~~~~~~~~~~
rpackagemanager.cc:256:30: error: template argument 1 is invalid
256 | std::vector<RDeb822Source> sources;
| ^
rpackagemanager.cc:256:30: error: template argument 2 is invalid
rpackagemanager.cc:265:16: error: 'trim' was not declared in this scope; did you mean 'tm'?
265 | line = trim(line);
| ^~~~
| tm
rpackagemanager.cc:270:30: error: expected ';' before 'source'
270 | RDeb822Source source = createSourceFromFields(currentFields);
| ^~~~~~~
| ;
rpackagemanager.cc:271:21: error: 'source' was not declared in this scope; did you mean 'sources'?
271 | if (source.isValid()) {
| ^~~~~~
| sources
rpackagemanager.cc:272:29: error: request for member 'push_back' in 'sources', which is of non-class type 'int'
272 | sources.push_back(source);
| ^~~~~~~~~
rpackagemanager.cc:280:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
280 | if (line.starts_with("#") && line.find("Modernized") != std::string::npos) {
| ^~~~~~~~~~~
rpackagemanager.cc:282:30: error: expected ';' before 'source'
282 | RDeb822Source source = createSourceFromFields(currentFields);
| ^~~~~~~
| ;
rpackagemanager.cc:283:21: error: 'source' was not declared in this scope; did you mean 'sources'?
283 | if (source.isValid()) {
| ^~~~~~
| sources
rpackagemanager.cc:284:29: error: request for member 'push_back' in 'sources', which is of non-class type 'int'
284 | sources.push_back(source);
| ^~~~~~~~~
rpackagemanager.cc:293:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
293 | if (line.starts_with("#")) {
| ^~~~~~~~~~~
rpackagemanager.cc:306:42: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
306 | if (line.empty() || line.starts_with("#") || line.find(':') != std::string::npos) {
| ^~~~~~~~~~~
rpackagemanager.cc:320:22: error: expected ';' before 'source'
320 | RDeb822Source source = createSourceFromFields(currentFields);
| ^~~~~~~
| ;
rpackagemanager.cc:321:13: error: 'source' was not declared in this scope; did you mean 'sources'?
321 | if (source.isValid()) {
| ^~~~~~
| sources
rpackagemanager.cc:322:21: error: request for member 'push_back' in 'sources', which is of non-class type 'int'
322 | sources.push_back(source);
| ^~~~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:329:1: error: 'RDeb822Source' does not name a type
329 | RDeb822Source RSourceManager::createSourceFromFields(const std::map<std::string, std::string>& fields)
| ^~~~~~~~~~~~~
rpackagemanager.cc:347:6: error: 'RSourceManager' has not been declared
347 | bool RSourceManager::saveSources() const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:347:36: error: non-member function 'bool saveSources()' cannot have cv-qualifier
347 | bool RSourceManager::saveSources() const {
| ^~~~~
rpackagemanager.cc: In function 'bool saveSources()':
rpackagemanager.cc:349:35: error: 'sources' was not declared in this scope; did you mean 'source'?
349 | for (const auto& source : sources) {
| ^~~~~~~
| source
rpackagemanager.cc:350:36: error: 'getSourceFilename' was not declared in this scope
350 | std::string filename = getSourceFilename(source);
| ^~~~~~~~~~~~~~~~~
rpackagemanager.cc:351:18: error: 'writeSourceFile' was not declared in this scope
351 | if (!writeSourceFile(filename, source)) {
| ^~~~~~~~~~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:361:6: error: 'RSourceManager' has not been declared
361 | bool RSourceManager::writeSourceFile(const std::string& filename, const RDeb822Source& source) const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:361:73: error: 'RDeb822Source' does not name a type
361 | bool RSourceManager::writeSourceFile(const std::string& filename, const RDeb822Source& source) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:361:96: error: non-member function 'bool writeSourceFile(const std::string&, const int&)' cannot have cv-qualifier
361 | bool RSourceManager::writeSourceFile(const std::string& filename, const RDeb822Source& source) const {
| ^~~~~
rpackagemanager.cc: In function 'bool writeSourceFile(const std::string&, const int&)':
rpackagemanager.cc:372:24: error: request for member 'toString' in 'source', which is of non-class type 'const int'
372 | file << source.toString();
| ^~~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:379:1: error: 'RDeb822Source' does not name a type
379 | RDeb822Source RSourceManager::readSourceFile(const std::string& filename) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:394:6: error: 'RSourceManager' has not been declared
394 | bool RSourceManager::updateAptSources() {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:399:6: error: 'RSourceManager' has not been declared
399 | bool RSourceManager::reloadAptCache() {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:404:6: error: 'RSourceManager' has not been declared
404 | bool RSourceManager::validateSourceFile(const std::string& filename) const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:404:70: error: non-member function 'bool validateSourceFile(const std::string&)' cannot have cv-qualifier
404 | bool RSourceManager::validateSourceFile(const std::string& filename) const {
| ^~~~~
rpackagemanager.cc: In function 'bool validateSourceFile(const std::string&)':
rpackagemanager.cc:405:5: error: 'RDeb822Source' was not declared in this scope
405 | RDeb822Source source = readSourceFile(filename);
| ^~~~~~~~~~~~~
rpackagemanager.cc:406:12: error: 'source' was not declared in this scope
406 | return source.isValid();
| ^~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:409:13: error: 'RSourceManager' has not been declared
409 | std::string RSourceManager::getSourceFilename(const RDeb822Source& source) const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:409:53: error: 'RDeb822Source' does not name a type
409 | std::string RSourceManager::getSourceFilename(const RDeb822Source& source) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:409:76: error: non-member function 'std::string getSourceFilename(const int&)' cannot have cv-qualifier
409 | std::string RSourceManager::getSourceFilename(const RDeb822Source& source) const {
| ^~~~~
rpackagemanager.cc: In function 'std::string getSourceFilename(const int&)':
rpackagemanager.cc:411:35: error: request for member 'getUris' in 'source', which is of non-class type 'const int'
411 | std::string filename = source.getUris();
| ^~~~~~~
rpackagemanager.cc:414:30: error: request for member 'getSuites' in 'source', which is of non-class type 'const int'
414 | filename += "-" + source.getSuites() + ".sources";
| ^~~~~~~~~
rpackagemanager.cc:415:35: error: 'sourcesDir' was not declared in this scope; did you mean 'source'?
415 | return (std::filesystem::path(sourcesDir) / filename).string();
| ^~~~~~~~~~
| source
rpackagemanager.cc: At global scope:
rpackagemanager.cc:418:13: error: 'RSourceManager' has not been declared
418 | std::string RSourceManager::trim(const std::string& str) const
| ^~~~~~~~~~~~~~
rpackagemanager.cc:418:58: error: non-member function 'std::string trim(const std::string&)' cannot have cv-qualifier
418 | std::string RSourceManager::trim(const std::string& str) const
| ^~~~~
rpackagelister.cc:927:19: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
927 | struct bla:public binary_function<RPackage *, RPackage *, bool> {
| ^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_tree.h:65,
from /usr/include/c++/14/map:62,
from rpackagelister.cc:33:
/usr/include/c++/14/bits/stl_function.h:131:12: note: declared here
131 | struct binary_function
| ^~~~~~~~~~~~~~~
rpackagelister.cc: In member function 'bool RPackageLister::isMultiarchSystem()':
rpackagelister.cc:2110:20: error: 'class pkgSystem' has no member named 'MultiArchEnabled'
2110 | return _system->MultiArchEnabled();
| ^~~~~~~~~~~~~~~~
make[2]: *** [Makefile:486: rpackagemanager.o] Error 1
make[2]: *** [Makefile:486: rpackagelister.o] Error 1
make[2]: Leaving directory '/home/asciiwolf/synaptic/common'
make[1]: *** [Makefile:432: all-recursive] Error 1
make[1]: Leaving directory '/home/asciiwolf/synaptic'
make: *** [Makefile:373: all] Error 2

@aybanda

Copy link
Copy Markdown
Author

hey @mvo5 I tried few things, fixed few issues
update me with your status
thanks!

@AsciiWolf

Copy link
Copy Markdown
Contributor

Sadly even more errors now on my system.

$ make -j32
make all-recursive
make[1]: Entering directory '/home/asciiwolf/synaptic'
Making all in data
make[2]: Entering directory '/home/asciiwolf/synaptic/data'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/asciiwolf/synaptic/data'
Making all in common
make[2]: Entering directory '/home/asciiwolf/synaptic/common'
depbase=`echo rpackagelister.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/apt-pkg -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/usr/var"\" -g -O2 -MT rpackagelister.o -MD -MP -MF $depbase.Tpo -c -o rpackagelister.o rpackagelister.cc &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo rsources.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/apt-pkg -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/usr/var"\" -g -O2 -MT rsources.o -MD -MP -MF $depbase.Tpo -c -o rsources.o rsources.cc &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo rsource_deb822.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/apt-pkg -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/usr/var"\" -g -O2 -MT rsource_deb822.o -MD -MP -MF $depbase.Tpo -c -o rsource_deb822.o rsource_deb822.cc &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo rpackagemanager.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/apt-pkg -DSYNAPTICLOCALEDIR=\""/usr/share/locale"\" -DSYNAPTICSTATEDIR=\""/usr/var"\" -g -O2 -MT rpackagemanager.o -MD -MP -MF $depbase.Tpo -c -o rpackagemanager.o rpackagemanager.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from rsource_deb822.cc:6:
rsource_deb822.h:38:65: error: 'pkgSourceList::SourceRecord' has not been declared
38 | static bool ConvertToSourceRecord(const Deb822Entry& entry, pkgSourceList::SourceRecord& record);
| ^~~~~~~~~~~~~
rsource_deb822.h:39:62: error: 'SourceRecord' in 'class pkgSourceList' does not name a type
39 | static bool ConvertFromSourceRecord(const pkgSourceList::SourceRecord& record, Deb822Entry& entry);
| ^~~~~~~~~~~~
In file included from rsources.cc:39:
rsource_deb822.h:38:65: error: 'pkgSourceList::SourceRecord' has not been declared
38 | static bool ConvertToSourceRecord(const Deb822Entry& entry, pkgSourceList::SourceRecord& record);
| ^~~~~~~~~~~~~
rsource_deb822.h:39:62: error: 'SourceRecord' in 'class pkgSourceList' does not name a type
39 | static bool ConvertFromSourceRecord(const pkgSourceList::SourceRecord& record, Deb822Entry& entry);
| ^~~~~~~~~~~~
rsources.cc: In member function 'bool SourcesList::UpdateSources()':
rsources.cc:340:57: error: cannot convert 'SourcesList::SourceRecord' to 'const int&'
340 | if (!RDeb822Source::ConvertFromSourceRecord(*record, entry)) {
| ^~~~~~~
| |
| SourcesList::SourceRecord
rsource_deb822.h:39:76: note: initializing argument 1 of 'static bool RDeb822Source::ConvertFromSourceRecord(const int&, Deb822Entry&)'
39 | static bool ConvertFromSourceRecord(const pkgSourceList::SourceRecord& record, Deb822Entry& entry);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
rsources.cc: In member function 'bool SourcesList::ReadDeb822SourcePart(std::string)':
rsources.cc:600:58: error: cannot convert 'SourcesList::SourceRecord' to 'int&'
600 | if (!RDeb822Source::ConvertToSourceRecord(entry, rec)) {
| ^~~
| |
| SourcesList::SourceRecord
rsource_deb822.h:38:94: note: initializing argument 2 of 'static bool RDeb822Source::ConvertToSourceRecord(const Deb822Entry&, int&)'
38 | static bool ConvertToSourceRecord(const Deb822Entry& entry, pkgSourceList::SourceRecord& record);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
rsources.cc: In member function 'bool SourcesList::WriteDeb822Source(SourceRecord*, std::string)':
rsources.cc:651:49: error: cannot convert 'SourcesList::SourceRecord' to 'const int&'
651 | if (!RDeb822Source::ConvertFromSourceRecord(*record, entry)) {
| ^~~~~~~
| |
| SourcesList::SourceRecord
rsource_deb822.h:39:76: note: initializing argument 1 of 'static bool RDeb822Source::ConvertFromSourceRecord(const int&, Deb822Entry&)'
39 | static bool ConvertFromSourceRecord(const pkgSourceList::SourceRecord& record, Deb822Entry& entry);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
rsource_deb822.cc: In static member function 'static bool RDeb822Source::ParseDeb822File(const std::string&, std::vector<Deb822Entry>&)':
rsource_deb822.cc:33:36: error: 'FromUTF8' is not a member of 'APT::String'
33 | entry.Types = APT::String::FromUTF8(fields[L"Types"]);
| ^~~~~~~~
rsource_deb822.cc:38:35: error: 'FromUTF8' is not a member of 'APT::String'
38 | entry.URIs = APT::String::FromUTF8(fields[L"URIs"]);
| ^~~~~~~~
rsource_deb822.cc:43:37: error: 'FromUTF8' is not a member of 'APT::String'
43 | entry.Suites = APT::String::FromUTF8(fields[L"Suites"]);
| ^~~~~~~~
rsource_deb822.cc:47:45: error: 'FromUTF8' is not a member of 'APT::String'
47 | entry.Components = APT::String::FromUTF8(fields[L"Components"]);
| ^~~~~~~~
rsource_deb822.cc:50:43: error: 'FromUTF8' is not a member of 'APT::String'
50 | entry.SignedBy = APT::String::FromUTF8(fields[L"Signed-By"]);
| ^~~~~~~~
rsource_deb822.cc:53:48: error: 'FromUTF8' is not a member of 'APT::String'
53 | entry.Architectures = APT::String::FromUTF8(fields[L"Architectures"]);
| ^~~~~~~~
rsource_deb822.cc:56:44: error: 'FromUTF8' is not a member of 'APT::String'
56 | entry.Languages = APT::String::FromUTF8(fields[L"Languages"]);
| ^~~~~~~~
rsource_deb822.cc:59:42: error: 'FromUTF8' is not a member of 'APT::String'
59 | entry.Targets = APT::String::FromUTF8(fields[L"Targets"]);
| ^~~~~~~~
rsource_deb822.cc: In static member function 'static bool RDeb822Source::WriteDeb822File(const std::string&, const std::vector<Deb822Entry>&)':
rsource_deb822.cc:81:44: error: 'ToUTF8' is not a member of 'APT::String'
81 | file << L"Types: " << APT::String::ToUTF8(entry.Types) << std::endl;
| ^~~~~~
rsource_deb822.cc:82:43: error: 'ToUTF8' is not a member of 'APT::String'
82 | file << L"URIs: " << APT::String::ToUTF8(entry.URIs) << std::endl;
| ^~~~~~
rsource_deb822.cc:83:45: error: 'ToUTF8' is not a member of 'APT::String'
83 | file << L"Suites: " << APT::String::ToUTF8(entry.Suites) << std::endl;
| ^~~~~~
rsource_deb822.cc:86:53: error: 'ToUTF8' is not a member of 'APT::String'
86 | file << L"Components: " << APT::String::ToUTF8(entry.Components) << std::endl;
| ^~~~~~
rsource_deb822.cc:89:52: error: 'ToUTF8' is not a member of 'APT::String'
89 | file << L"Signed-By: " << APT::String::ToUTF8(entry.SignedBy) << std::endl;
| ^~~~~~
rsource_deb822.cc:92:56: error: 'ToUTF8' is not a member of 'APT::String'
92 | file << L"Architectures: " << APT::String::ToUTF8(entry.Architectures) << std::endl;
| ^~~~~~
rsource_deb822.cc:95:52: error: 'ToUTF8' is not a member of 'APT::String'
95 | file << L"Languages: " << APT::String::ToUTF8(entry.Languages) << std::endl;
| ^~~~~~
rsource_deb822.cc:98:50: error: 'ToUTF8' is not a member of 'APT::String'
98 | file << L"Targets: " << APT::String::ToUTF8(entry.Targets) << std::endl;
| ^~~~~~
rsource_deb822.cc: At global scope:
rsource_deb822.cc:107:69: error: 'pkgSourceList::SourceRecord' has not been declared
107 | bool RDeb822Source::ConvertToSourceRecord(const Deb822Entry& entry, pkgSourceList::SourceRecord& record) {
| ^~~~~~~~~~~~~
rsource_deb822.cc: In static member function 'static bool RDeb822Source::ConvertToSourceRecord(const Deb822Entry&, int&)':
rsource_deb822.cc:119:12: error: request for member 'Type' in 'record', which is of non-class type 'int'
119 | record.Type = 0;
| ^~~~
rsource_deb822.cc:120:25: error: request for member 'Type' in 'record', which is of non-class type 'int'
120 | if (has_deb) record.Type |= pkgSourceList::Deb;
| ^~~~
rsource_deb822.cc:120:48: error: 'Deb' is not a member of 'pkgSourceList'
120 | if (has_deb) record.Type |= pkgSourceList::Deb;
| ^~~
rsource_deb822.cc:121:29: error: request for member 'Type' in 'record', which is of non-class type 'int'
121 | if (has_deb_src) record.Type |= pkgSourceList::DebSrc;
| ^~~~
rsource_deb822.cc:121:52: error: 'DebSrc' is not a member of 'pkgSourceList'
121 | if (has_deb_src) record.Type |= pkgSourceList::DebSrc;
| ^~~~~~
rsource_deb822.cc:122:32: error: request for member 'Type' in 'record', which is of non-class type 'int'
122 | if (!entry.Enabled) record.Type |= pkgSourceList::Disabled;
| ^~~~
rsource_deb822.cc:122:55: error: 'Disabled' is not a member of 'pkgSourceList'
122 | if (!entry.Enabled) record.Type |= pkgSourceList::Disabled;
| ^~~~~~~~
rsource_deb822.cc:130:20: error: request for member 'URI' in 'record', which is of non-class type 'int'
130 | record.URI = uri;
| ^~~
rsource_deb822.cc:141:20: error: request for member 'Dist' in 'record', which is of non-class type 'int'
141 | record.Dist = suite;
| ^~~~
rsource_deb822.cc:152:20: error: request for member 'Comps' in 'record', which is of non-class type 'int'
152 | record.Comps.push_back(comp);
| ^~~~~
rsource_deb822.cc: At global scope:
rsource_deb822.cc:159:66: error: 'SourceRecord' in 'class pkgSourceList' does not name a type
159 | bool RDeb822Source::ConvertFromSourceRecord(const pkgSourceList::SourceRecord& record, Deb822Entry& entry) {
| ^~~~~~~~~~~~
rsource_deb822.cc: In static member function 'static bool RDeb822Source::ConvertFromSourceRecord(const int&, Deb822Entry&)':
rsource_deb822.cc:162:16: error: request for member 'Type' in 'record', which is of non-class type 'const int'
162 | if (record.Type & pkgSourceList::Deb) {
| ^~~~
rsource_deb822.cc:162:38: error: 'Deb' is not a member of 'pkgSourceList'
162 | if (record.Type & pkgSourceList::Deb) {
| ^~~
rsource_deb822.cc:165:16: error: request for member 'Type' in 'record', which is of non-class type 'const int'
165 | if (record.Type & pkgSourceList::DebSrc) {
| ^~~~
rsource_deb822.cc:165:38: error: 'DebSrc' is not a member of 'pkgSourceList'
165 | if (record.Type & pkgSourceList::DebSrc) {
| ^~~~~~
rsource_deb822.cc:172:25: error: request for member 'URI' in 'record', which is of non-class type 'const int'
172 | entry.URIs = record.URI;
| ^~~
rsource_deb822.cc:175:27: error: request for member 'Dist' in 'record', which is of non-class type 'const int'
175 | entry.Suites = record.Dist;
| ^~~~
rsource_deb822.cc:179:36: error: request for member 'Comps' in 'record', which is of non-class type 'const int'
179 | for (const auto& comp : record.Comps) {
| ^~~~~
rsource_deb822.cc:186:30: error: request for member 'Type' in 'record', which is of non-class type 'const int'
186 | entry.Enabled = !(record.Type & pkgSourceList::Disabled);
| ^~~~
rsource_deb822.cc:186:52: error: 'Disabled' is not a member of 'pkgSourceList'
186 | entry.Enabled = !(record.Type & pkgSourceList::Disabled);
| ^~~~~~~~
In file included from rpackagemanager.cc:1:
rpackagemanager.h: In member function 'pkgPackageManager::OrderResult RPackageManager::DoInstallPostFork()':
rpackagemanager.h:72:21: error: no matching function for call to 'pkgPackageManager::Go()'
72 | return (pm->Go() == false) ? pkgPackageManager::Failed : Res;
| ~~~~~~^~
In file included from rpackagemanager.h:46:
/usr/include/apt-pkg/packagemanager.h:91:17: note: candidate: 'virtual bool pkgPackageManager::Go(APT::Progress::PackageManager*)'
91 | virtual bool Go(APT::Progress::PackageManager * /*progress*/) {return true;};
| ^~
/usr/include/apt-pkg/packagemanager.h:91:17: note: candidate expects 1 argument, 0 provided
make[2]: *** [Makefile:486: rsource_deb822.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:486: rsources.o] Error 1
rpackagemanager.cc: At global scope:
rpackagemanager.cc:12:1: error: redefinition of 'RPackageManager::RPackageManager(pkgPackageManager*)'
12 | RPackageManager::RPackageManager(pkgPackageManager *pm) : pm(pm) {}
| ^~~~~~~~~~~~~~~
rpackagemanager.h:76:4: note: 'RPackageManager::RPackageManager(pkgPackageManager*)' previously defined here
76 | RPackageManager(pkgPackageManager *pm) : pm(pm) {}
| ^~~~~~~~~~~~~~~
rpackagemanager.cc:14:32: error: redefinition of 'pkgPackageManager::OrderResult RPackageManager::DoInstallPreFork()'
14 | pkgPackageManager::OrderResult RPackageManager::DoInstallPreFork() {
| ^~~~~~~~~~~~~~~
rpackagemanager.h:62:35: note: 'pkgPackageManager::OrderResult RPackageManager::DoInstallPreFork()' previously defined here
62 | pkgPackageManager::OrderResult DoInstallPreFork() {
| ^~~~~~~~~~~~~~~~
rpackagemanager.cc:24:32: error: redefinition of 'pkgPackageManager::OrderResult RPackageManager::DoInstallPostFork()'
24 | pkgPackageManager::OrderResult RPackageManager::DoInstallPostFork() {
| ^~~~~~~~~~~~~~~
rpackagemanager.h:71:35: note: 'pkgPackageManager::OrderResult RPackageManager::DoInstallPostFork()' previously defined here
71 | pkgPackageManager::OrderResult DoInstallPostFork() {
| ^~~~~~~~~~~~~~~~~
rpackagemanager.cc:30:1: error: 'RDeb822Source' does not name a type
30 | RDeb822Source::RDeb822Source() : enabled(true) {}
| ^~~~~~~~~~~~~
rpackagemanager.cc:32:1: error: 'RDeb822Source' does not name a type
32 | RDeb822Source::RDeb822Source(const std::string& types, const std::string& uris,
| ^~~~~~~~~~~~~
rpackagemanager.cc:36:6: error: 'RDeb822Source' has not been declared
36 | bool RDeb822Source::isValid() const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:36:31: error: non-member function 'bool isValid()' cannot have cv-qualifier
36 | bool RDeb822Source::isValid() const {
| ^~~~~
rpackagemanager.cc: In function 'bool isValid()':
rpackagemanager.cc:38:9: error: 'types' was not declared in this scope; did you mean 'typeof'?
38 | if (types.empty() || uris.empty() || suites.empty()) {
| ^~~~~
| typeof
rpackagemanager.cc:38:26: error: 'uris' was not declared in this scope
38 | if (types.empty() || uris.empty() || suites.empty()) {
| ^~~~
rpackagemanager.cc:38:42: error: 'suites' was not declared in this scope
38 | if (types.empty() || uris.empty() || suites.empty()) {
| ^~~~~~
rpackagemanager.cc:43:9: error: 'types' was not declared in this scope; did you mean 'typeof'?
43 | if (types != "deb" && types != "deb-src") {
| ^~~~~
| typeof
rpackagemanager.cc:48:34: error: 'uris' was not declared in this scope
48 | std::istringstream uriStream(uris);
| ^~~~
rpackagemanager.cc:60:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
60 | if (uri.starts_with("http://") ||
| ^~~~~~~~~~~
rpackagemanager.cc:61:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
61 | uri.starts_with("https://") ||
| ^~~~~~~~~~~
rpackagemanager.cc:62:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
62 | uri.starts_with("ftp://") ||
| ^~~~~~~~~~~
rpackagemanager.cc:63:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
63 | uri.starts_with("file://") ||
| ^~~~~~~~~~~
rpackagemanager.cc:64:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
64 | uri.starts_with("cdrom:")) {
| ^~~~~~~~~~~
rpackagemanager.cc:74:36: error: 'suites' was not declared in this scope
74 | std::istringstream suiteStream(suites);
| ^~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:92:13: error: 'RDeb822Source' has not been declared
92 | std::string RDeb822Source::toString() const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:92:39: error: non-member function 'std::string toString()' cannot have cv-qualifier
92 | std::string RDeb822Source::toString() const {
| ^~~~~
rpackagemanager.cc: In function 'std::string toString()':
rpackagemanager.cc:96:10: error: 'enabled' was not declared in this scope
96 | if (!enabled) {
| ^~~~~~~
rpackagemanager.cc:101:11: error: 'types' was not declared in this scope; did you mean 'typeof'?
101 | ss << types << " " << uris << " " << suites;
| ^~~~~
| typeof
rpackagemanager.cc:101:27: error: 'uris' was not declared in this scope
101 | ss << types << " " << uris << " " << suites;
| ^~~~
rpackagemanager.cc:101:42: error: 'suites' was not declared in this scope
101 | ss << types << " " << uris << " " << suites;
| ^~~~~~
rpackagemanager.cc:102:10: error: 'components' was not declared in this scope
102 | if (!components.empty()) {
| ^~~~~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:110:1: error: 'RDeb822Source' does not name a type
110 | RDeb822Source RDeb822Source::fromString(const std::string& content) {
| ^~~~~~~~~~~~~
rpackagemanager.cc:164:6: error: 'RDeb822Source' has not been declared
164 | bool RDeb822Source::operator==(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:164:38: error: 'RDeb822Source' does not name a type
164 | bool RDeb822Source::operator==(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:164:60: error: non-member function 'bool operator==(const int&)' cannot have cv-qualifier
164 | bool RDeb822Source::operator==(const RDeb822Source& other) const {
| ^~~~~
rpackagemanager.cc:164:6: error: 'bool operator==(const int&)' must have an argument of class or enumerated type
164 | bool RDeb822Source::operator==(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:172:6: error: 'RDeb822Source' has not been declared
172 | bool RDeb822Source::operator!=(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:172:38: error: 'RDeb822Source' does not name a type
172 | bool RDeb822Source::operator!=(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:172:60: error: non-member function 'bool operator!=(const int&)' cannot have cv-qualifier
172 | bool RDeb822Source::operator!=(const RDeb822Source& other) const {
| ^~~~~
rpackagemanager.cc:172:6: error: 'bool operator!=(const int&)' must have an argument of class or enumerated type
172 | bool RDeb822Source::operator!=(const RDeb822Source& other) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:177:1: error: 'RSourceManager' does not name a type
177 | RSourceManager::RSourceManager() : sourcesDir("/etc/apt/sources.list.d") {}
| ^~~~~~~~~~~~~~
rpackagemanager.cc:179:1: error: 'RSourceManager' does not name a type
179 | RSourceManager::RSourceManager(const std::string& sourcesDir) : sourcesDir(sourcesDir) {}
| ^~~~~~~~~~~~~~
rpackagemanager.cc:181:6: error: 'RSourceManager' has not been declared
181 | bool RSourceManager::addSource(const RDeb822Source& source) {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:181:38: error: 'RDeb822Source' does not name a type
181 | bool RSourceManager::addSource(const RDeb822Source& source) {
| ^~~~~~~~~~~~~
rpackagemanager.cc: In function 'bool addSource(const int&)':
rpackagemanager.cc:182:17: error: request for member 'isValid' in 'source', which is of non-class type 'const int'
182 | if (!source.isValid()) {
| ^~~~~~~
rpackagemanager.cc:187:33: error: 'sources' was not declared in this scope; did you mean 'source'?
187 | for (const auto& existing : sources) {
| ^~~~~~~
| source
rpackagemanager.cc:193:5: error: 'sources' was not declared in this scope; did you mean 'source'?
193 | sources.push_back(source);
| ^~~~~~~
| source
rpackagemanager.cc: At global scope:
rpackagemanager.cc:197:6: error: 'RSourceManager' has not been declared
197 | bool RSourceManager::removeSource(const RDeb822Source& source) {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:197:41: error: 'RDeb822Source' does not name a type
197 | bool RSourceManager::removeSource(const RDeb822Source& source) {
| ^~~~~~~~~~~~~
rpackagemanager.cc: In function 'bool removeSource(const int&)':
rpackagemanager.cc:198:25: error: 'sources' was not declared in this scope; did you mean 'source'?
198 | auto it = std::find(sources.begin(), sources.end(), source);
| ^~~~~~~
| source
rpackagemanager.cc: At global scope:
rpackagemanager.cc:207:6: error: 'RSourceManager' has not been declared
207 | bool RSourceManager::updateSource(const RDeb822Source& oldSource, const RDeb822Source& newSource) {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:207:41: error: 'RDeb822Source' does not name a type
207 | bool RSourceManager::updateSource(const RDeb822Source& oldSource, const RDeb822Source& newSource) {
| ^~~~~~~~~~~~~
rpackagemanager.cc:207:73: error: 'RDeb822Source' does not name a type
207 | bool RSourceManager::updateSource(const RDeb822Source& oldSource, const RDeb822Source& newSource) {
| ^~~~~~~~~~~~~
rpackagemanager.cc: In function 'bool updateSource(const int&, const int&)':
rpackagemanager.cc:208:20: error: request for member 'isValid' in 'newSource', which is of non-class type 'const int'
208 | if (!newSource.isValid()) {
| ^~~~~~~
rpackagemanager.cc:212:25: error: 'sources' was not declared in this scope
212 | auto it = std::find(sources.begin(), sources.end(), oldSource);
| ^~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:221:13: error: 'RDeb822Source' was not declared in this scope
221 | std::vector<RDeb822Source> RSourceManager::getSources() const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:221:26: error: template argument 1 is invalid
221 | std::vector<RDeb822Source> RSourceManager::getSources() const {
| ^
rpackagemanager.cc:221:26: error: template argument 2 is invalid
rpackagemanager.cc:221:28: error: 'RSourceManager' has not been declared
221 | std::vector<RDeb822Source> RSourceManager::getSources() const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:221:57: error: non-member function 'int getSources()' cannot have cv-qualifier
221 | std::vector<RDeb822Source> RSourceManager::getSources() const {
| ^~~~~
rpackagemanager.cc: In function 'int getSources()':
rpackagemanager.cc:222:12: error: 'sources' was not declared in this scope; did you mean 'getSources'?
222 | return sources;
| ^~~~~~~
| getSources
rpackagemanager.cc: At global scope:
rpackagemanager.cc:225:6: error: 'RSourceManager' has not been declared
225 | bool RSourceManager::loadSources() {
| ^~~~~~~~~~~~~~
rpackagemanager.cc: In function 'bool loadSources()':
rpackagemanager.cc:226:5: error: 'sources' was not declared in this scope; did you mean 'getSources'?
226 | sources.clear();
| ^~~~~~~
| getSources
rpackagemanager.cc:230:70: error: 'sourcesDir' was not declared in this scope
230 | for (const auto& entry : std::filesystem::directory_iterator(sourcesDir)) {
| ^~~~~~~~~~
rpackagemanager.cc:245:29: error: 'RDeb822Source' was not declared in this scope
245 | std::vector<RDeb822Source> fileSources = parseSources(content);
| ^~~~~~~~~~~~~
rpackagemanager.cc:245:42: error: template argument 1 is invalid
245 | std::vector<RDeb822Source> fileSources = parseSources(content);
| ^
rpackagemanager.cc:245:42: error: template argument 2 is invalid
rpackagemanager.cc:245:58: error: 'parseSources' was not declared in this scope; did you mean 'fileSources'?
245 | std::vector<RDeb822Source> fileSources = parseSources(content);
| ^~~~~~~~~~~~
| fileSources
rpackagemanager.cc:246:59: error: request for member 'begin' in 'fileSources', which is of non-class type 'int'
246 | sources.insert(sources.end(), fileSources.begin(), fileSources.end());
| ^~~~~
rpackagemanager.cc:246:80: error: request for member 'end' in 'fileSources', which is of non-class type 'int'
246 | sources.insert(sources.end(), fileSources.begin(), fileSources.end());
| ^~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:256:13: error: 'RDeb822Source' was not declared in this scope
256 | std::vector<RDeb822Source> RSourceManager::parseSources(const std::string& content)
| ^~~~~~~~~~~~~
rpackagemanager.cc:256:26: error: template argument 1 is invalid
256 | std::vector<RDeb822Source> RSourceManager::parseSources(const std::string& content)
| ^
rpackagemanager.cc:256:26: error: template argument 2 is invalid
rpackagemanager.cc:256:28: error: 'RSourceManager' has not been declared
256 | std::vector<RDeb822Source> RSourceManager::parseSources(const std::string& content)
| ^~~~~~~~~~~~~~
rpackagemanager.cc: In function 'int parseSources(const std::string&)':
rpackagemanager.cc:258:17: error: 'RDeb822Source' was not declared in this scope
258 | std::vector<RDeb822Source> sources;
| ^~~~~~~~~~~~~
rpackagemanager.cc:258:30: error: template argument 1 is invalid
258 | std::vector<RDeb822Source> sources;
| ^
rpackagemanager.cc:258:30: error: template argument 2 is invalid
rpackagemanager.cc:267:16: error: 'trim' was not declared in this scope; did you mean 'tm'?
267 | line = trim(line);
| ^~~~
| tm
rpackagemanager.cc:272:30: error: expected ';' before 'source'
272 | RDeb822Source source = createSourceFromFields(currentFields);
| ^~~~~~~
| ;
rpackagemanager.cc:273:21: error: 'source' was not declared in this scope; did you mean 'sources'?
273 | if (source.isValid()) {
| ^~~~~~
| sources
rpackagemanager.cc:274:29: error: request for member 'push_back' in 'sources', which is of non-class type 'int'
274 | sources.push_back(source);
| ^~~~~~~~~
rpackagemanager.cc:282:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
282 | if (line.starts_with("#") && line.find("Modernized") != std::string::npos) {
| ^~~~~~~~~~~
rpackagemanager.cc:284:30: error: expected ';' before 'source'
284 | RDeb822Source source = createSourceFromFields(currentFields);
| ^~~~~~~
| ;
rpackagemanager.cc:285:21: error: 'source' was not declared in this scope; did you mean 'sources'?
285 | if (source.isValid()) {
| ^~~~~~
| sources
rpackagemanager.cc:286:29: error: request for member 'push_back' in 'sources', which is of non-class type 'int'
286 | sources.push_back(source);
| ^~~~~~~~~
rpackagemanager.cc:295:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
295 | if (line.starts_with("#")) {
| ^~~~~~~~~~~
rpackagemanager.cc:308:42: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
308 | if (line.empty() || line.starts_with("#") || line.find(':') != std::string::npos) {
| ^~~~~~~~~~~
rpackagemanager.cc:322:22: error: expected ';' before 'source'
322 | RDeb822Source source = createSourceFromFields(currentFields);
| ^~~~~~~
| ;
rpackagemanager.cc:323:13: error: 'source' was not declared in this scope; did you mean 'sources'?
323 | if (source.isValid()) {
| ^~~~~~
| sources
rpackagemanager.cc:324:21: error: request for member 'push_back' in 'sources', which is of non-class type 'int'
324 | sources.push_back(source);
| ^~~~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:331:1: error: 'RDeb822Source' does not name a type
331 | RDeb822Source RSourceManager::createSourceFromFields(const std::map<std::string, std::string>& fields)
| ^~~~~~~~~~~~~
rpackagemanager.cc:349:6: error: 'RSourceManager' has not been declared
349 | bool RSourceManager::saveSources() const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:349:36: error: non-member function 'bool saveSources()' cannot have cv-qualifier
349 | bool RSourceManager::saveSources() const {
| ^~~~~
rpackagemanager.cc: In function 'bool saveSources()':
rpackagemanager.cc:351:35: error: 'sources' was not declared in this scope; did you mean 'source'?
351 | for (const auto& source : sources) {
| ^~~~~~~
| source
rpackagemanager.cc:352:36: error: 'getSourceFilename' was not declared in this scope
352 | std::string filename = getSourceFilename(source);
| ^~~~~~~~~~~~~~~~~
rpackagemanager.cc:353:18: error: 'writeSourceFile' was not declared in this scope
353 | if (!writeSourceFile(filename, source)) {
| ^~~~~~~~~~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:363:6: error: 'RSourceManager' has not been declared
363 | bool RSourceManager::writeSourceFile(const std::string& filename, const RDeb822Source& source) const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:363:73: error: 'RDeb822Source' does not name a type
363 | bool RSourceManager::writeSourceFile(const std::string& filename, const RDeb822Source& source) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:363:96: error: non-member function 'bool writeSourceFile(const std::string&, const int&)' cannot have cv-qualifier
363 | bool RSourceManager::writeSourceFile(const std::string& filename, const RDeb822Source& source) const {
| ^~~~~
rpackagemanager.cc: In function 'bool writeSourceFile(const std::string&, const int&)':
rpackagemanager.cc:374:24: error: request for member 'toString' in 'source', which is of non-class type 'const int'
374 | file << source.toString();
| ^~~~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:381:1: error: 'RDeb822Source' does not name a type
381 | RDeb822Source RSourceManager::readSourceFile(const std::string& filename) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:396:6: error: 'RSourceManager' has not been declared
396 | bool RSourceManager::updateAptSources() {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:401:6: error: 'RSourceManager' has not been declared
401 | bool RSourceManager::reloadAptCache() {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:406:6: error: 'RSourceManager' has not been declared
406 | bool RSourceManager::validateSourceFile(const std::string& filename) const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:406:70: error: non-member function 'bool validateSourceFile(const std::string&)' cannot have cv-qualifier
406 | bool RSourceManager::validateSourceFile(const std::string& filename) const {
| ^~~~~
rpackagemanager.cc: In function 'bool validateSourceFile(const std::string&)':
rpackagemanager.cc:407:5: error: 'RDeb822Source' was not declared in this scope
407 | RDeb822Source source = readSourceFile(filename);
| ^~~~~~~~~~~~~
rpackagemanager.cc:408:12: error: 'source' was not declared in this scope
408 | return source.isValid();
| ^~~~~~
rpackagemanager.cc: At global scope:
rpackagemanager.cc:411:13: error: 'RSourceManager' has not been declared
411 | std::string RSourceManager::getSourceFilename(const RDeb822Source& source) const {
| ^~~~~~~~~~~~~~
rpackagemanager.cc:411:53: error: 'RDeb822Source' does not name a type
411 | std::string RSourceManager::getSourceFilename(const RDeb822Source& source) const {
| ^~~~~~~~~~~~~
rpackagemanager.cc:411:76: error: non-member function 'std::string getSourceFilename(const int&)' cannot have cv-qualifier
411 | std::string RSourceManager::getSourceFilename(const RDeb822Source& source) const {
| ^~~~~
rpackagemanager.cc: In function 'std::string getSourceFilename(const int&)':
rpackagemanager.cc:413:35: error: request for member 'getUris' in 'source', which is of non-class type 'const int'
413 | std::string filename = source.getUris();
| ^~~~~~~
rpackagemanager.cc:416:30: error: request for member 'getSuites' in 'source', which is of non-class type 'const int'
416 | filename += "-" + source.getSuites() + ".sources";
| ^~~~~~~~~
rpackagemanager.cc:417:35: error: 'sourcesDir' was not declared in this scope; did you mean 'source'?
417 | return (std::filesystem::path(sourcesDir) / filename).string();
| ^~~~~~~~~~
| source
rpackagemanager.cc: At global scope:
rpackagemanager.cc:420:13: error: 'RSourceManager' has not been declared
420 | std::string RSourceManager::trim(const std::string& str) const
| ^~~~~~~~~~~~~~
rpackagemanager.cc:420:58: error: non-member function 'std::string trim(const std::string&)' cannot have cv-qualifier
420 | std::string RSourceManager::trim(const std::string& str) const
| ^~~~~
rpackagelister.cc:927:19: warning: 'template<class _Arg1, class _Arg2, class _Result> struct std::binary_function' is deprecated [-Wdeprecated-declarations]
927 | struct bla:public binary_function<RPackage *, RPackage *, bool> {
| ^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_tree.h:65,
from /usr/include/c++/14/map:62,
from rpackagelister.cc:33:
/usr/include/c++/14/bits/stl_function.h:131:12: note: declared here
131 | struct binary_function
| ^~~~~~~~~~~~~~~
rpackagelister.cc: In member function 'bool RPackageLister::isMultiarchSystem()':
rpackagelister.cc:2109:20: error: 'class pkgSystem' has no member named 'MultiArchSupport'; did you mean 'MultiArchSupported'?
2109 | return _system->MultiArchSupport();
| ^~~~~~~~~~~~~~~~
| MultiArchSupported
make[2]: *** [Makefile:486: rpackagemanager.o] Error 1
make[2]: *** [Makefile:486: rpackagelister.o] Error 1
make[2]: Leaving directory '/home/asciiwolf/synaptic/common'
make[1]: *** [Makefile:432: all-recursive] Error 1
make[1]: Leaving directory '/home/asciiwolf/synaptic'
make: *** [Makefile:373: all] Error 2

@AsciiWolf

Copy link
Copy Markdown
Contributor

I have also tested the modernized (deb822) source file and it sadly got broken. Synaptic returned a file format error after attempting to disable one of the entries.

Here is a diff of the changes Synaptic has made:

$ git diff /etc/apt/sources.list.d/debian.sources.bak /etc/apt/sources.list.d/debian.sources
diff --git a/etc/apt/sources.list.d/debian.sources.bak b/etc/apt/sources.list.d/debian.sources
index 7ca1619..da9b2f0 100644
--- a/etc/apt/sources.list.d/debian.sources.bak
+++ b/etc/apt/sources.list.d/debian.sources
@@ -1,20 +1,15 @@
-# Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: trixie
Components: main non-free-firmware
-Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
-# Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main non-free-firmware
-Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
-# Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: trixie-updates
Components: main non-free-firmware
-Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+

As you can see, the Signed-By line and the comments got removed, but I believe that this is not the main problem and there were probably other issues detected by the parser and the file was not modified further. (As you can see, even though I disabled the second repo in Synaptic, it is still enabled.)

(By the way, also notice the empty line added at the end of the file - probably the same problem as with classic sources.list.)

@aybanda

Copy link
Copy Markdown
Author

Thanks @AsciiWolf for the quick and detailed review! I’ll go through the points and fix them once I get a bit of time. Appreciate the thorough testing!

@AsciiWolf

Copy link
Copy Markdown
Contributor

Thanks again Ajay for working on this! I have sent you another 40 USD from the bounty via PayPal. :-)

@AsciiWolf

Copy link
Copy Markdown
Contributor

Thanks for the update!

Quick test:

Legacy

  • The sections position still seems to be re-ordered. But it's not a big deal.
  • The new empty lines at the end of the sources.list file are still being added.
  • Other issues are fixed.

Deb822

  • I don't see any "deb-src" entries in the Sources window list. Only "deb" ones. But when I click them, they change to "deb-src". This needs to be fixed. Unlike the legacy format, deb and deb-src are not separate entries in deb822. So maybe change the Sources window UI?
  • The "Modernized from /etc/apt/sources.list" comments are still removed. They should not be.
  • Disabling one of the sources does nothing and Synaptic returns "E: Malformed stanza 2 in source list /etc/apt/sources.list.d/debian.sources (type)".
  • Adding a new source results in the source being written in a legacy format to sources.list instead of deb822 to debian.sources.
  • Editing existing sources and other tasks I tried all seem to work fine, including support for multiple deb822 *.sources files.

@AsciiWolf

AsciiWolf commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

One more problem with legacy sources:

The disabled (cdrom) source seems to have funny colors that change when Synaptic is restarted:

12

…e, preserve comments and fields, and show deb-src entries
@aybanda

Copy link
Copy Markdown
Author

Hi @AsciiWolf
All issues are fixed and tested—please review the latest changes. Thanks!

@AsciiWolf

AsciiWolf commented Jul 14, 2025

Copy link
Copy Markdown
Contributor

The legacy format is sadly still not correct with latest code from your branch. When I opened the Sources window in Synaptic, I got an "Ignoring invalid record(s) in sources.list file!" message (even though there were no invalid records).

When closing the window, the sources list got changed:

$ git diff sources.list.bak sources.list
diff --git a/sources.list.bak b/sources.list
index efd97e4..a297a02 100644
--- a/sources.list.bak
+++ b/sources.list
@@ -1,12 +1,13 @@
-#deb cdrom:[Debian GNU/Linux testing _Trixie_ - Official Snapshot amd64 DVD Binary-1 with firmware 20250512-00:13]/ trixie contrib main non-free-firmware
-
+# deb cdrom:[Debian GNU/Linux testing _Trixie_ - Official Snapshot amd64 DVD Binary-1 with firmware 20250512-00:13]/ trixie contrib main non-free-firmware
+#
deb http://deb.debian.org/debian/ trixie main non-free-firmware
deb-src http://deb.debian.org/debian/ trixie main non-free-firmware
-
+#
deb http://security.debian.org/debian-security trixie-security main non-free-firmware
deb-src http://security.debian.org/debian-security trixie-security main non-free-firmware
-
+#
# trixie-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ trixie-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ trixie-updates main non-free-firmware
+#

Please note the hash characters incorrectly added.

The Deb822 formatted sources are now not working at all. Only an empty Sources window appears:

empty_deb822_sources

@AsciiWolf

Copy link
Copy Markdown
Contributor

Here are the source files I used for testing.

$ cat /etc/apt/sources.list

#deb cdrom:[Debian GNU/Linux testing _Trixie_ - Official Snapshot amd64 DVD Binary-1 with firmware 20250512-00:13]/ trixie contrib main non-free-firmware
deb http://deb.debian.org/debian/ trixie main non-free-firmware
deb-src http://deb.debian.org/debian/ trixie main non-free-firmware
deb http://security.debian.org/debian-security trixie-security main non-free-firmware
deb-src http://security.debian.org/debian-security trixie-security main non-free-firmware
# trixie-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ trixie-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ trixie-updates main non-free-firmware

$ cat /etc/apt/sources.list.d/debian.sources

# Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: trixie
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
# Modernized from /etc/apt/sources.list
Types: deb deb-src
URIs: http://deb.debian.org/debian/
Suites: trixie-updates
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

@AsciiWolf

AsciiWolf commented Jul 24, 2025

Copy link
Copy Markdown
Contributor

I have just repeated the test with latest code:

Legacy:
Still the same "Ignoring invalid record(s) in sources.list file!" message and still the same modifications to the sources file:

$ synaptic-pkexec
DEBUG: Number of source records read into _lst: 13
DEBUG: Adding source to display - URI: cdrom:[Debian GNU/Linux testing _Trixie_ - Official Snapshot amd64 DVD Binary-1 with firmware 20250512-00:13]/, Type: deb
DEBUG: Preparing to append to list store for URI: cdrom:[Debian GNU/Linux testing _Trixie_ - Official Snapshot amd64 DVD Binary-1 with firmware 20250512-00:13]/
DEBUG: Successfully set data for URI: cdrom:[Debian GNU/Linux testing _Trixie_ - Official Snapshot amd64 DVD Binary-1 with firmware 20250512-00:13]/
DEBUG: Adding source to display - URI: http://ftp.cz.debian.org/debian/, Type: deb
DEBUG: Preparing to append to list store for URI: http://ftp.cz.debian.org/debian/
DEBUG: Successfully set data for URI: http://ftp.cz.debian.org/debian/
DEBUG: Adding source to display - URI: http://ftp.cz.debian.org/debian/, Type: deb-src
DEBUG: Preparing to append to list store for URI: http://ftp.cz.debian.org/debian/
DEBUG: Successfully set data for URI: http://ftp.cz.debian.org/debian/
DEBUG: Adding source to display - URI: http://security.debian.org/debian-security, Type: deb
DEBUG: Preparing to append to list store for URI: http://security.debian.org/debian-security
DEBUG: Successfully set data for URI: http://security.debian.org/debian-security
DEBUG: Adding source to display - URI: http://security.debian.org/debian-security, Type: deb-src
DEBUG: Preparing to append to list store for URI: http://security.debian.org/debian-security
DEBUG: Successfully set data for URI: http://security.debian.org/debian-security
DEBUG: Adding source to display - URI: http://ftp.cz.debian.org/debian/, Type: deb
DEBUG: Preparing to append to list store for URI: http://ftp.cz.debian.org/debian/
DEBUG: Successfully set data for URI: http://ftp.cz.debian.org/debian/
DEBUG: Adding source to display - URI: http://ftp.cz.debian.org/debian/, Type: deb-src
DEBUG: Preparing to append to list store for URI: http://ftp.cz.debian.org/debian/
DEBUG: Successfully set data for URI: http://ftp.cz.debian.org/debian/
$ git diff ../sources.list.bak sources.list
diff --git a/../sources.list.bak b/sources.list
index dcce80d..698482b 100644
--- a/../sources.list.bak
+++ b/sources.list
@@ -1,12 +1,13 @@
-#deb cdrom:[Debian GNU/Linux testing _Trixie_ - Official Snapshot amd64 DVD Binary-1 with firmware 20250512-00:13]/ trixie contrib main non-free-firmware
-
+# deb cdrom:[Debian GNU/Linux testing _Trixie_ - Official Snapshot amd64 DVD Binary-1 with firmware 20250512-00:13]/ trixie contrib main non-free-firmware
+#
deb http://ftp.cz.debian.org/debian/ trixie main non-free-firmware
deb-src http://ftp.cz.debian.org/debian/ trixie main non-free-firmware
-
+#
deb http://security.debian.org/debian-security trixie-security main non-free-firmware
deb-src http://security.debian.org/debian-security trixie-security main non-free-firmware
-
+#
# trixie-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://ftp.cz.debian.org/debian/ trixie-updates main non-free-firmware
deb-src http://ftp.cz.debian.org/debian/ trixie-updates main non-free-firmware
+#

Deb822:
All entries are now correctly displayed in the Sources window, however the file gets modified by Synaptic after closing the window:

$ synaptic-pkexec
DEBUG: Number of source records read into _lst: 6
DEBUG: Adding source to display - URI: http://ftp.cz.debian.org/debian/, Type: deb
DEBUG: Preparing to append to list store for URI: http://ftp.cz.debian.org/debian/
DEBUG: Successfully set data for URI: http://ftp.cz.debian.org/debian/
DEBUG: Adding source to display - URI: http://security.debian.org/debian-security/, Type: deb
DEBUG: Preparing to append to list store for URI: http://security.debian.org/debian-security/
DEBUG: Successfully set data for URI: http://security.debian.org/debian-security/
DEBUG: Adding source to display - URI: http://ftp.cz.debian.org/debian/, Type: deb
DEBUG: Preparing to append to list store for URI: http://ftp.cz.debian.org/debian/
DEBUG: Successfully set data for URI: http://ftp.cz.debian.org/debian/
DEBUG: Adding source to display - URI: http://ftp.cz.debian.org/debian/, Type: deb
DEBUG: Preparing to append to list store for URI: http://ftp.cz.debian.org/debian/
DEBUG: Successfully set data for URI: http://ftp.cz.debian.org/debian/
DEBUG: Adding source to display - URI: http://security.debian.org/debian-security/, Type: deb
DEBUG: Preparing to append to list store for URI: http://security.debian.org/debian-security/
DEBUG: Successfully set data for URI: http://security.debian.org/debian-security/
DEBUG: Adding source to display - URI: http://ftp.cz.debian.org/debian/, Type: deb
DEBUG: Preparing to append to list store for URI: http://ftp.cz.debian.org/debian/
DEBUG: Successfully set data for URI: http://ftp.cz.debian.org/debian/
$ git diff ../../debian.sources.bak debian.sources
diff --git a/../../debian.sources.bak b/debian.sources
index 8dc2f0c..0bf8f09 100644
--- a/../../debian.sources.bak
+++ b/debian.sources
@@ -1,18 +1,39 @@
-# Modernized from /etc/apt/sources.list
+Enabled: yes
Types: deb deb-src
URIs: http://ftp.cz.debian.org/debian/
Suites: trixie
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
-# Modernized from /etc/apt/sources.list
+Enabled: yes
Types: deb deb-src
URIs: http://security.debian.org/debian-security/
Suites: trixie-security
Components: main non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
-# Modernized from /etc/apt/sources.list
+Enabled: yes
+Types: deb deb-src
+URIs: http://ftp.cz.debian.org/debian/
+Suites: trixie-updates
+Components: main non-free-firmware
+Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+
+Enabled: yes
+Types: deb deb-src
+URIs: http://ftp.cz.debian.org/debian/
+Suites: trixie
+Components: main non-free-firmware
+Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+
+Enabled: yes
+Types: deb deb-src
+URIs: http://security.debian.org/debian-security/
+Suites: trixie-security
+Components: main non-free-firmware
+Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+
+Enabled: yes
Types: deb deb-src
URIs: http://ftp.cz.debian.org/debian/
Suites: trixie-updates

Not sure why this happens, but it certainly does not look right and indeed apt does not like it:

$ apt update
Hit:1 http://ftp.cz.debian.org/debian trixie InRelease
Hit:2 http://ftp.cz.debian.org/debian trixie-updates InRelease Hit:3 http://security.debian.org/debian-security trixie-security InRelease
All packages are up to date. Warning: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Sources (non-free-firmware/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Translations (main/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Packages (non-free-firmware/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Packages (non-free-firmware/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Translations (non-free-firmware/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Translations (non-free-firmware/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11 (non-free-firmware/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11 (non-free-firmware/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11-icons-small (non-free-firmware/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11-icons (non-free-firmware/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Sources (non-free-firmware/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Translations (main/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Packages (non-free-firmware/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Packages (non-free-firmware/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Translations (non-free-firmware/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Translations (non-free-firmware/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11 (non-free-firmware/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11 (non-free-firmware/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11-icons-small (non-free-firmware/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11-icons (non-free-firmware/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Sources (non-free-firmware/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Translations (main/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Packages (non-free-firmware/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Packages (non-free-firmware/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Translations (non-free-firmware/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Translations (non-free-firmware/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11 (non-free-firmware/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11 (non-free-firmware/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11-icons-small (non-free-firmware/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11-icons (non-free-firmware/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Sources (non-free-firmware/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Translations (main/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Packages (non-free-firmware/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Packages (non-free-firmware/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Translations (non-free-firmware/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Translations (non-free-firmware/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11 (non-free-firmware/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11 (non-free-firmware/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11-icons-small (non-free-firmware/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target DEP-11-icons (non-free-firmware/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:1 and /etc/apt/sources.list.d/debian.sources:4
Warning: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Sources (non-free-firmware/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Translations (main/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Packages (non-free-firmware/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Packages (non-free-firmware/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Translations (non-free-firmware/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Translations (non-free-firmware/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11 (non-free-firmware/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11 (non-free-firmware/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11-icons-small (non-free-firmware/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target DEP-11-icons (non-free-firmware/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:2 and /etc/apt/sources.list.d/debian.sources:5
Warning: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Sources (non-free-firmware/source/Sources) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Translations (main/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Packages (non-free-firmware/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Packages (non-free-firmware/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Translations (non-free-firmware/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target Translations (non-free-firmware/i18n/Translation-cs) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11 (non-free-firmware/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11 (non-free-firmware/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11-icons-small (non-free-firmware/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6
Warning: Target DEP-11-icons (non-free-firmware/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/debian.sources:3 and /etc/apt/sources.list.d/debian.sources:6

@AsciiWolf

Copy link
Copy Markdown
Contributor

@aybanda Any update? :)

@AsciiWolf

AsciiWolf commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

I have found out that some of the small formatting issues that I pointed out before, for example the trailing space added at the end of the line, also happen in older Synaptic builds with legacy sources.list. We can probably ignore these small issues if they cause no real problems.

But we must make sure that there is no invalid deb822 or legacy output generated by Synaptic. Adding, modifying, removing, enabling/disabling etc. the entries must work flawlessly.

edit:This issue also happens with older Synaptic and looks harmless.

@SanchezTheCoder

Copy link
Copy Markdown

I opened a small follow-up against this branch: aybanda#1

It wires the existing Deb822 integration test into make check, fixes the parser gaps that test covers (comments, optional fields, whitespace-only stanza separators), removes leftover repository dialog debug prints, and cleans an autotools warning in common/Makefile.am.

Verified in a Debian testing container with:

./autogen.sh
./configure --prefix=/usr
make -j2
make check -j2

make check now runs and passes test_deb822_integration.

@AtesComp

Copy link
Copy Markdown

Just adding this as I haven't see a reference to using the "X-Repolib-Name" field yet as opposed to using the file's comment to display the repo name. Many apps are automating the repo additions and update the repo file with its own comment overwriting any previous comment (i.e., Google Chrome, MS VSCode, etc.)

Example:

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# Changes to this file will not be preserved.
# This file will not be recreated if removed.
X-Repolib-Name: Google Chrome
Types: deb
URIs: https://dl.google.com/linux/chrome-stable/deb/
Suites: stable
Components: main
Architectures: amd64
Signed-By: /usr/share/keyrings/google-chrome.gpg

See https://repolib.readthedocs.io/en/latest/deb822-format.html

@tzh476

Copy link
Copy Markdown

@AsciiWolf@aybanda — offering to help finish the rebase here, if help is wanted.

I have no claim on this and I am not trying to jump anyone's work. @aybanda did the implementation and was paid for it; @AsciiWolf's split offer above ("both parties will receive 60 USD") is his to make, not mine to assume. So this is a question, not a PR.

What I checked before asking. The branch no longer merges cleanly onto master (8e99020). A trial merge conflicts in exactly six files:

common/Makefile.am
common/rpackagemanager.h
common/rsources.cc
common/rsources.h
gtk/rgrepositorywin.cc
gtk/rgrepositorywin.h

That is a contained rebase — the conflicts are in the files this PR was always touching, not a broad divergence.

What I would do, if you want it:

  1. Rebase onto current master and resolve those six, preserving the Deb822 behaviour as implemented — not redesigning it.
  2. Fold in the formatting fix @AsciiWolf reported (trailing whitespace on rewrite). Noting his 2025-11-11 follow-up that this also happens with legacy sources.list, so it may be pre-existing rather than a Deb822 regression — I would verify which before changing anything.
  3. Wire the Deb822 integration test into make check, which @SanchezTheCoder already started in Improve Deb822 parser coverage aybanda/synaptic#1 — I would build on that PR rather than around it.

Where I would put it. Against @aybanda's fork, the way @SanchezTheCoder did, so the commits land on his branch and this PR updates in place. His authorship and history stay intact; nothing needs to be re-opened elsewhere.

On the bounty: genuinely not why I am asking first — I would rather the rebase happen than argue about the split. Whatever @AsciiWolf and @aybanda decide, including "no thanks, Ajay is picking it back up," is fine and I will drop it.

@aybanda — if you are still on this and just short of time, say so and I will stay out of the way, or do a narrow piece you name.

Disclosure: I work with LLM assistance and take responsibility for what I submit; I can explain any part of a diff I open.

@AsciiWolf

Copy link
Copy Markdown
Contributor

Thanks for offering to finish the Deb822 support! It would be great, but I am afraid I won't be able to provide much help/testing in the next month or two due to my current time schedule.

mvo5 added a commit that referenced this pull request Sep 5, 2026
To read apt's deb822 source records we now use libapt's pkgTagFile
and parse into our own SourceRecords. However we start with read
only support for now to keep the diff smaller.
Thanks to tzh476 and aybanda for the work on this in PR #274 and
PR #150. The test fixtures are taken from tzh476's tests in PR #274.
Co-authored-by: Stephen Smith <tzh476@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@aybanda@mvo5@AsciiWolf@AtesComp@SanchezTheCoder@tzh476