-
-
Notifications
You must be signed in to change notification settings - Fork 428
Manage deb822 format and apt-key removal in trixie #1437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.x
Are you sure you want to change the base?
Manage deb822 format and apt-key removal in trixie #1437
Conversation
Just to let know you I am working on, comments are welcome |
863a9f1
to
5d70a6b
Compare
5d70a6b
to
5c4cebf
Compare
@@ -1,13 +1,13 @@ | |||
from __future__ import annotations | |||
|
|||
import re | |||
from typing import List |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't actually need to import this, as it's deprecated. You should use list
now as type annotation
@@ -60,44 +60,176 @@ def parse_apt_repo(name): | |||
} | |||
|
|||
|
|||
class AptSources(FactBase): | |||
def parse_deb822_stanza(lines: list[str]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add return type annotation.
return repos | ||
|
||
|
||
def parse_apt_list_file(lines: List[str]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add return type annotation, use list[str]
for lines
return repos | ||
|
||
|
||
def parse_deb822_sources_file(lines: List[str]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add return type annotation, use list[str]
for lines
stanza. Returns a combined list of repo dicts for all stanzas. | ||
""" | ||
repos = [] | ||
stanza: List[str] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stanza: List[str] = [] | |
stanza: list[str] = [] |
# then export and dearmor to the APT keyring destination. | ||
yield ( | ||
"sh -c 'set -e;" | ||
" install -d -m 0755 /etc/apt/keyrings;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use a fact to check if that dir already exists and only emit a files.directory
command if it doesn't?
Hey @maisim, I hope you don't mind me leaving some comments. I agreed with @Fizzadar to help him out a bit with reviewing PRs. This is great work! Support for the new DEB822-style apt sources and a replacement for I have a couple of general suggestions, and I'll leave it to @Fizzadar if he agrees:
|
WIP
3.x
at this time)scripts/dev-test.sh
)scripts/dev-lint.sh
)