Krikri::PluginHelpers::AptPpa
AptPpa - pure logic for expanding a ppa:owner/name repo: shorthand
into a real deb ... source line and the Launchpad API/keyfile
naming that go with it. No I/O - plugins/apt_repository.cr does the
actual HTTP fetch, GPG key export, and file writes.
All formulas here verified against real Ansible's own
UbuntuSourcesList class source (apt_repository.py), not assumed:
the expanded line shape, the Launchpad API URL, and the filename-
suggestion input (the pre-expansion "ppa:owner/name_codename"
string, not the expanded deb line - real Ansible's own
_suggest_filename('%s_%s' % (line, self.codename)) call passes
the raw ppa: string, which happens to already produce the right
shape when run through the exact same generic
AptRepositoryLine.suggested_filename transform every other repo:
line already goes through - verified by tracing both languages'
logic side by side, not by guessing a special case was needed).
Constants
Real Ansible tries these in order and uses the first that already exists on the target - verified against its own APT_KEY_DIRS constant.
Class methods
The string real Ansible's own _suggest_filename is actually
called with for a ppa: line - not the expanded deb line (see the
class doc above).
The exact (slightly quirky) keyfile name real Ansible's own
add_source builds: os.path.basename(source) on the expanded
deb https://.../owner/name/ubuntu codename main line just takes
everything after its last "/" - "ubuntu codename main" - with
spaces turned into hyphens, verified by tracing the Python source
rather than assumed. keydir is the caller's own choice of
KEY_DIRS entry (whichever one actually exists).