Skip to content

Conversation

@SunilMohanAdapa
Copy link

  • Currently, only two options with keys arch= or trusted= are allowed. However, as documented in apt manual page[1], there are many different options possible. Apt itself parses these options in a much more generic way[2][3].

  • This patches allows parsing all the different options allowed by apt. A practical example (accepted by apt) is also provided as a test case.

Link: https://manpages.debian.org/trixie/apt/sources.list.5.en.html
Link: https://salsa.debian.org/apt-team/apt/-/blob/3c9399e643a07074d47c9bceca88e8d43ff55d36/apt-pkg/sourcelist.cc#L215
Link: https://salsa.debian.org/apt-team/apt/-/blob/3c9399e643a07074d47c9bceca88e8d43ff55d36/apt-pkg/contrib/strutl.cc#L245

- Currently, only two options with keys arch= or trusted= are allowed. However,
as documented in apt manual page[1], there are many different options possible.
Apt itself parses these options in a much more generic way[2][3].

- This patches allows parsing all the different options allowed by apt. A
practical example (accepted by apt) is also provided as a test case.

Link: https://manpages.debian.org/trixie/apt/sources.list.5.en.html
Link: https://salsa.debian.org/apt-team/apt/-/blob/3c9399e643a07074d47c9bceca88e8d43ff55d36/apt-pkg/sourcelist.cc#L215
Link: https://salsa.debian.org/apt-team/apt/-/blob/3c9399e643a07074d47c9bceca88e8d43ff55d36/apt-pkg/contrib/strutl.cc#L245
Signed-off-by: Sunil Mohan Adapa <[email protected]>
@SunilMohanAdapa SunilMohanAdapa force-pushed the aptsources-allow-all-options branch from 176c7a8 to 2a14986 Compare September 10, 2025 00:03
jvalleroy pushed a commit to freedombox/FreedomBox that referenced this pull request Sep 21, 2025
Fixes: #2251
Fixes: #2426

- Temporarily add a bug fix for the one-line style apt sources format. Upstream
submission: hercules-team/augeas#865 .

- Currently, only two options with keys arch= or trusted= are allowed. However,
as documented in apt manual page[1], there are many different options possible.
Apt itself parses these options in a much more generic way[2][3].

- Fixes allow parsing all the different options allowed by apt. A practical
example (accepted by apt) is also provided as a test case.

Tests:

- Add the following line to one of the apt sources file in
/etc/apt/sources.list.d: "deb
[signed-by=/usr/share/keyrings/debian-archive-trixie-stable.gpg]
https://deb.debian.org/debian trixie main". In augtool, print
/augeas/files/etc/apt/sources.list.d//error.

- With the patch, run 'make build install' and errors in augtool disappear.

- In tor proxy app, enabling/disabling apt through tor works. The files in
/etc/apt/ are updated as expected.

Link: https://manpages.debian.org/trixie/apt/sources.list.5.en.html
Link: https://salsa.debian.org/apt-team/apt/-/blob/3c9399e643a07074d47c9bceca88e8d43ff55d36/apt-pkg/sourcelist.cc#L215
Link: https://salsa.debian.org/apt-team/apt/-/blob/3c9399e643a07074d47c9bceca88e8d43ff55d36/apt-pkg/contrib/strutl.cc#L245
Signed-off-by: Sunil Mohan Adapa <[email protected]>
Reviewed-by: James Valleroy <[email protected]>
Sign up for free to 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.

1 participant