vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Publish package paths without a dot segment
58ac37e09659ddf240a40229ca02ece02c7b1aca · Keenan Nemetz · 15d ago · parent 73e98b74
Publish package paths without a dot segment dpkg-scanpackages prefixes Filename with ./, which makes apt request a path with a dot segment. The base name is relative to the repository root either way, and the server does not need to normalise the URL.
scripts/build-package-repos.py +13
| @@ -85,6 +85,19 @@ def write_apt(apt: Path, debs: list[tuple[Path, str]], epoch: int) -> None: | |||
| 85 | 85 | f"but {len(debs)} were copied" | |
| 86 | 86 | ) | |
| 87 | 87 | stanzas.sort(key=stanza_key) | |
| 88 | # dpkg-scanpackages writes the path relative to the repository root as | ||
| 89 | # "./name.deb". A client concatenates it to the source URL, so the leading | ||
| 90 | # dot segment only asks the server to normalise the path; the base name is | ||
| 91 | # the same file and resolves without a redirect. | ||
| 92 | stanzas = [ | ||
| 93 | "\n".join( | ||
| 94 | "Filename: " + line[len("Filename: ./"):] | ||
| 95 | if line.startswith("Filename: ./") | ||
| 96 | else line | ||
| 97 | for line in stanza.splitlines() | ||
| 98 | ) | ||
| 99 | for stanza in stanzas | ||
| 100 | ] | ||
| 88 | 101 | packages = ("\n\n".join(stanzas) + "\n").encode() | |
| 89 | 102 | (apt / "Packages").write_bytes(packages) | |
| 90 | 103 | # mtime=0 keeps the clock (and the filename) out of the gzip header. | |