Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #62: the v2
APKINDEX.tar.gzside. v3Packages.adbdecoding waits on an ADB decoder shared with git-pkgs/archives#30 and a fixture generated withapk mkndx.Adds an
apkregistry with no default URL, so a missing URL gets the existing "no registry URL configured" error. The URL is one architecture directory such ashttps://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64, or an exact index URL in one. Nothing is inferred from a mirror root. For a directory the client asks forPackages.adbfirst and falls back toAPKINDEX.tar.gzonly on a 404, as apk-tools does. If aPackages.adbis served, it returnsErrV3IndexUnsupportedrather than reading the other index, so v3 support can later turn that error into a result without changing what any repository resolves to today. The index is fetched once per registry instance.The parser reads the
APKINDEXmember across the signature and index gzip streams and maps the fields from apk-tools'apk_adb.c: name, version, description, URL, license, arch, build time (PublishedAt), maintainer, file and installed size, origin, commit, provider priority, depends, provides, replaces and install-if. Malformed lines, records with noPorV, bad numbers, truncated archives and archives with noAPKINDEXmember returnErrMalformedIndex. Versions sort with theapkscheme fromvers, so-r10sorts above-r9, and lookups match the exact version including the revision.FetchDependenciesreturnsDentries as runtime dependencies with the operator kept inRequirements(libcurl/=8.22.0-r0), and leaves out!conflicts. Everything is also in version metadata. Maintainers inName <email>form are split; anything else is kept whole as the name. Names may carry the PURL vendor namespace:alpine/curllooks upcurlandFetchPackagereturnsNamespace: "alpine".The
C:checksum is not used as integrity. Oncurl-8.22.0-r0.apk, theQ1value25ef42c2…8161is the SHA-1 of the package's second gzip stream (the control section), while the whole file's SHA-1 isb9119fc5…1e73. Putting it inIntegritywould make a consumer that verifies downloads, such as git-pkgs/proxy, reject every package. It's exposed in metadata aschecksum(raw),checksum_algorithm(sha1, ormd5for legacy hex),checksum_hexandchecksum_covers: control.Each version has one artifact,
<name>-<version>.apkbeside the index, withS:as its size andarchin its metadata.URLs().Downloadbuilds the same URL without loading the index, sofetch.Resolverresolves APKs with no request.The test fixture is four records trimmed from the live v3.23
main/x86_64index, packed into the same two-stream layout in the test. Againstdl-cdn.alpinelinux.org,v3.23/main/x86_64andv3.23/main/aarch64/APKINDEX.tar.gzresolvecurl8.22.0-r0 with sizes matching the files, andedge/community/x86_64(about 2.5 MB compressed) loads in under a second.https://claude.ai/code/session_01NxsA75HBjdWQKcdx7FDTDc