A debian package index parser with bazel config generation
# if new versions are available, update snapshots and bazel config
$ make update
$ ./update
# generate new config for current snapshot
$ make generate
$ ./generate
The updater and generator expect these files in the working directory by default but they can be specified with flags
--snapshots <location> (default: ./debian_snapshots.yaml)
--packages <location> (default: ./debian_packages.yaml)
--versions-out <location> (default: ./debian_versions.bzl)
--archives-out <location> (default: ./devian_archives.bzl)
Usually autogenerated if none can be found, the debian snapshot version, usually a timestamp
that can be placed in an url like: https://snapshot.debian.org/archive/debian/20220101T024315Z/
debian: 20220112T093851Z
security: 20220112T153306Z
A list of packages with architecture and debian distro parameters
- distros: ["debian10"]
archs: ["amd64", "arm64", "arm", "s390x", "ppc64le"]
packages:
- "libc6"
- "libc-bin"
- distros: ["debian11"]
archs: ["amd64"]
packages:
- "base-files"
A bazel config of all the parsed packages, packages are http_file
with name <arch>_<distro>_<package_name>
, package
names that contain special characters like +
will be converted into bazel valid names.
This file can be imported into bazel config by adding the following to WORKSPACE
load(":debian_archives.bzl", debian_repositories = "repositories")
debian_repositories()
a debian file can be referenced by the name of the http_file
"@amd64_debian10_base-files//file"
A bazel config file containing a map of packages to their versions. Useful when trying apply a string value of a version to a rule attribute.
DEBIAN_PACKAGE_VERSIONS = {
"amd64": {
"debian10": {
"base-files": "10.3+deb10u11",
"ca-certificates": "20200601~deb10u2",
...
This config can be imported in .bzl or BUILD files with
load("//:debian_versions.bzl", VERSIONS = "DEBIAN_PACKAGE_VERSIONS")
VERSIONS["amd64"]["debian10"]["base-files"]