diff --git a/apt/private/resolve.bzl b/apt/private/resolve.bzl index 78503cd..7fa93b1 100644 --- a/apt/private/resolve.bzl +++ b/apt/private/resolve.bzl @@ -39,16 +39,14 @@ def internal_resolve(rctx, yq_toolchain_prefix, manifest, include_transitive): sources = [] - dist = None for src in manifest["sources"]: - (distr, _, comp) = src["channel"].partition(" ") - if not dist: - dist = distr - sources.append(( - src["url"], - distr, - comp, - )) + distr, components = src["channel"].split(" ", 1) + for comp in components.split(" "): + sources.append(( + src["url"], + distr, + comp, + )) pkgindex = package_index.new(rctx, sources = sources, archs = manifest["archs"]) pkgresolution = package_resolution.new(index = pkgindex) diff --git a/e2e/smoke/BUILD b/e2e/smoke/BUILD index 58ab2a8..30e734d 100644 --- a/e2e/smoke/BUILD +++ b/e2e/smoke/BUILD @@ -63,6 +63,7 @@ PACKAGES = [ "@bullseye//dpkg", "@bullseye//apt", "@bullseye//perl", + "@bullseye//nvidia-kernel-common", ] # Creates /var/lib/dpkg/status with installed package information. diff --git a/e2e/smoke/bullseye.lock.json b/e2e/smoke/bullseye.lock.json index f5379f4..5d8640e 100644 --- a/e2e/smoke/bullseye.lock.json +++ b/e2e/smoke/bullseye.lock.json @@ -1190,6 +1190,15 @@ "url": "https://snapshot.debian.org/archive/debian/20240210T223313Z/pool/main/o/openssl/openssl_1.1.1w-0+deb11u1_amd64.deb", "version": "1.1.1w-0+deb11u1" }, + { + "arch": "amd64", + "dependencies": [], + "key": "nvidia-kernel-common_20151021-p-13_amd64", + "name": "nvidia-kernel-common", + "sha256": "fa4b007bf64cf8cf0e9b3aaae5dd388fcec3a589ce2475f16d64347945691533", + "url": "https://snapshot.debian.org/archive/debian/20240210T223313Z/pool/contrib/n/nvidia-support/nvidia-kernel-common_20151021+13_amd64.deb", + "version": "20151021+13" + }, { "arch": "arm64", "dependencies": [], @@ -2379,6 +2388,15 @@ "sha256": "d9159af073e95641e7eda440fa1d7623873b8c0034c9826a353f890bed107f3c", "url": "https://snapshot.debian.org/archive/debian/20240210T223313Z/pool/main/o/openssl/openssl_1.1.1w-0+deb11u1_arm64.deb", "version": "1.1.1w-0+deb11u1" + }, + { + "arch": "arm64", + "dependencies": [], + "key": "nvidia-kernel-common_20151021-p-13_arm64", + "name": "nvidia-kernel-common", + "sha256": "5a1f10cffc5407a6b63dcdf3f72af842ad9e39a808bb9418a4805aa0be345c65", + "url": "https://snapshot.debian.org/archive/debian/20240210T223313Z/pool/contrib/n/nvidia-support/nvidia-kernel-common_20151021+13_arm64.deb", + "version": "20151021+13" } ], "version": 1 diff --git a/e2e/smoke/bullseye.yaml b/e2e/smoke/bullseye.yaml index 345750a..833e860 100644 --- a/e2e/smoke/bullseye.yaml +++ b/e2e/smoke/bullseye.yaml @@ -10,7 +10,7 @@ version: 1 sources: - - channel: bullseye main + - channel: bullseye main contrib url: https://snapshot.debian.org/archive/debian/20240210T223313Z - channel: bullseye-security main url: https://snapshot.debian.org/archive/debian-security/20240210T223313Z @@ -33,3 +33,5 @@ packages: - "perl" # test cacerts() compatibility - "ca-certificates" + # test multiple components: contrib + - "nvidia-kernel-common" diff --git a/e2e/smoke/test_linux_amd64.yaml b/e2e/smoke/test_linux_amd64.yaml index cd1fd5c..6b5738f 100644 --- a/e2e/smoke/test_linux_amd64.yaml +++ b/e2e/smoke/test_linux_amd64.yaml @@ -18,6 +18,7 @@ commandTests: - ncurses-base/now 6\.2\+20201114-2\+deb11u2 all \[installed,local\] - perl/now 5\.32\.1-4\+deb11u3 amd64 \[installed,local\] - tzdata/now 2024a-0\+deb11u1 all \[installed,local\] + - nvidia-kernel-common/now 20151021\+13 amd64 \[installed,local\] - name: "whoami" command: "whoami" expectedOutput: [r00t] diff --git a/e2e/smoke/test_linux_arm64.yaml b/e2e/smoke/test_linux_arm64.yaml index d0208bb..dd57dcd 100644 --- a/e2e/smoke/test_linux_arm64.yaml +++ b/e2e/smoke/test_linux_arm64.yaml @@ -18,6 +18,7 @@ commandTests: - ncurses-base/now 6\.2\+20201114-2\+deb11u2 all \[installed,local\] - perl/now 5\.32\.1-4\+deb11u3 arm64 \[installed,local\] - tzdata/now 2024a-0\+deb11u1 all \[installed,local\] + - nvidia-kernel-common/now 20151021\+13 arm64 \[installed,local\] - name: "whoami" command: "whoami" expectedOutput: [r00t] diff --git a/examples/debian_snapshot/BUILD.bazel b/examples/debian_snapshot/BUILD.bazel index 01d5bed..cb2bd98 100644 --- a/examples/debian_snapshot/BUILD.bazel +++ b/examples/debian_snapshot/BUILD.bazel @@ -64,6 +64,7 @@ PACKAGES = [ "@bullseye//apt", "@bullseye//perl", "@bullseye//openssl", + "@bullseye//nvidia-kernel-common", ] # Creates /var/lib/dpkg/status with installed package information. diff --git a/examples/debian_snapshot/bullseye.lock.json b/examples/debian_snapshot/bullseye.lock.json index 76ca2f5..18bceea 100644 --- a/examples/debian_snapshot/bullseye.lock.json +++ b/examples/debian_snapshot/bullseye.lock.json @@ -1190,6 +1190,15 @@ "url": "https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z/pool/main/o/openssl/openssl_1.1.1w-0+deb11u1_amd64.deb", "version": "1.1.1w-0+deb11u1" }, + { + "arch": "amd64", + "dependencies": [], + "key": "nvidia-kernel-common_20151021-p-13_amd64", + "name": "nvidia-kernel-common", + "sha256": "fa4b007bf64cf8cf0e9b3aaae5dd388fcec3a589ce2475f16d64347945691533", + "url": "https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z/pool/contrib/n/nvidia-support/nvidia-kernel-common_20151021+13_amd64.deb", + "version": "20151021+13" + }, { "arch": "arm64", "dependencies": [], @@ -2379,6 +2388,15 @@ "sha256": "d9159af073e95641e7eda440fa1d7623873b8c0034c9826a353f890bed107f3c", "url": "https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z/pool/main/o/openssl/openssl_1.1.1w-0+deb11u1_arm64.deb", "version": "1.1.1w-0+deb11u1" + }, + { + "arch": "arm64", + "dependencies": [], + "key": "nvidia-kernel-common_20151021-p-13_arm64", + "name": "nvidia-kernel-common", + "sha256": "5a1f10cffc5407a6b63dcdf3f72af842ad9e39a808bb9418a4805aa0be345c65", + "url": "https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z/pool/contrib/n/nvidia-support/nvidia-kernel-common_20151021+13_arm64.deb", + "version": "20151021+13" } ], "version": 1 diff --git a/examples/debian_snapshot/bullseye.yaml b/examples/debian_snapshot/bullseye.yaml index 3869e48..a429916 100644 --- a/examples/debian_snapshot/bullseye.yaml +++ b/examples/debian_snapshot/bullseye.yaml @@ -10,7 +10,7 @@ version: 1 sources: - - channel: bullseye main + - channel: bullseye main contrib url: https://snapshot-cloudflare.debian.org/archive/debian/20240210T223313Z - channel: bullseye-security main url: https://snapshot-cloudflare.debian.org/archive/debian-security/20240210T223313Z @@ -33,3 +33,5 @@ packages: - "perl" # test cacerts() compatibility - "ca-certificates" + # test multiple components: contrib + - "nvidia-kernel-common" diff --git a/examples/debian_snapshot/test_linux_amd64.yaml b/examples/debian_snapshot/test_linux_amd64.yaml index e7eef05..4e515a5 100644 --- a/examples/debian_snapshot/test_linux_amd64.yaml +++ b/examples/debian_snapshot/test_linux_amd64.yaml @@ -18,6 +18,7 @@ commandTests: - ncurses-base/now 6\.2\+20201114-2\+deb11u2 all \[installed,local\] - perl/now 5\.32\.1-4\+deb11u3 amd64 \[installed,local\] - tzdata/now 2024a-0\+deb11u1 all \[installed,local\] + - nvidia-kernel-common/now 20151021\+13 amd64 \[installed,local\] - name: "whoami" command: "whoami" expectedOutput: [r00t] diff --git a/examples/debian_snapshot/test_linux_arm64.yaml b/examples/debian_snapshot/test_linux_arm64.yaml index 74ef73b..ae644ad 100644 --- a/examples/debian_snapshot/test_linux_arm64.yaml +++ b/examples/debian_snapshot/test_linux_arm64.yaml @@ -18,6 +18,7 @@ commandTests: - ncurses-base/now 6\.2\+20201114-2\+deb11u2 all \[installed,local\] - perl/now 5\.32\.1-4\+deb11u3 arm64 \[installed,local\] - tzdata/now 2024a-0\+deb11u1 all \[installed,local\] + - nvidia-kernel-common/now 20151021\+13 arm64 \[installed,local\] - name: "whoami" command: "whoami" expectedOutput: [r00t]