Skip to content

feat: add support for Deb822 (.sources files)#1823

Open
silentJET85 wants to merge 1 commit intowimpysworld:mainfrom
silentJET85:Deb822-support
Open

feat: add support for Deb822 (.sources files)#1823
silentJET85 wants to merge 1 commit intowimpysworld:mainfrom
silentJET85:Deb822-support

Conversation

@silentJET85
Copy link
Copy Markdown
Contributor

@silentJET85 silentJET85 commented Mar 26, 2026

closes #1816
EDIT: (I reworked this. See latest posts down below.)

This adds optional support for the newer Deb822 .sources files. Existing support for .list files is not affected.

These new variables are used in a package to create a .sources file:
* APT_SOURCES_URL This contains the URL to the repository. This variable being set is also what tells deb-get to use the new format.
* APT_SUITES This contains the suite(s). Equivalent to the "word" after the URL in the old format.
* APT_COMPONENTS The component(s). In the old format, this would usually be the remainder of the line after the "suite." If the suite ends with a /, this is unused.

These existing variables are also used:

  • APT_LIST_NAME This variable is still used to create the name of the file, but with the .sources extension.
    * APT_REPO_OPTIONS This still contains the options, but you need to specify them in the new format.
    For example "Architectures: amd64" instead of "arch=amd64"
  • ASC_KEY_URL, GPG_KEY_URL and GPG_KEY_ID work exactly the same as normal.

For some examples of how these would be used, here are some modified versions of existing packages that I used for testing:

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Confidence score: 3/5

  • There is a concrete behavior risk: deb-get parsing of Deb822 APT_REPO_OPTIONS truncates values at the first space, which can silently rewrite multi-value fields like Architectures into incorrect .sources output.
  • Given the issue is severity 4/10, this is not likely catastrophic, but it is user-facing configuration drift and can lead to wrong repository behavior, so merge risk is moderate rather than minimal.
  • Pay close attention to deb-get - Deb822 option parsing needs to preserve full field values (including spaces) to avoid malformed .sources entries.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="deb-get">

<violation number="1" location="deb-get:1305">
P2: Deb822 APT_REPO_OPTIONS parsing truncates field values at the first space, so multi-value fields (e.g., Architectures) are silently rewritten and produce incorrect .sources configuration.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Requires human review: This PR adds a new feature for Deb822 support, involving complex string parsing and modifications to core system configuration logic for APT repositories.

@silentJET85
Copy link
Copy Markdown
Contributor Author

silentJET85 commented Mar 27, 2026

Actually, now I'm reconsidering if this is the best approach. Parsing the existing APT_REPO_URL and APT_REPO_OPTIONS variables for the same information seems like it would be pretty easy. And then the package definition files wouldn't need to change at all.
I think we could make it so that new installs of apps would use the new format by default, while already installed apps would keep using .list files.
The safest option is probably to keep using .list files by default, and only switch to the new format if an environment variable is set. I'll make another commit that uses this method. I've got it mostly completed.

@silentJET85 silentJET85 marked this pull request as draft March 27, 2026 09:33
@silentJET85
Copy link
Copy Markdown
Contributor Author

silentJET85 commented Mar 28, 2026

I've updated it to check an environment variable called DEBGET_SOURCES. If set to sources, the .sources format will be used for all packages that use the apt method. Otherwise, a .list file will be used. In the future, we could easily swap this to make the new format default.
This seems to work fine for apt packages. But I haven't tested PPAs yet. I'll leave this as a draft until I do.
EDIT: Yes, PPAs are working.

@silentJET85 silentJET85 marked this pull request as ready for review March 28, 2026 22:26
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: This PR modifies core repository management logic and introduces string parsing/manipulation for system configuration files, which could impact package manager stability.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Requires human review: This PR modifies core logic for managing system APT repositories, including parsing and file system operations in /etc/apt/. Such changes carry high risk and require human validation.

@silentJET85 silentJET85 marked this pull request as draft April 9, 2026 18:05
@silentJET85 silentJET85 marked this pull request as ready for review April 9, 2026 18:13
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Modifies core repository management and file handling logic for APT sources, which involves complex string transformations that require human review.

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.

Feature Request: Support .sources files

1 participant