Skip to content

Commit

Permalink
add package excludes
Browse files Browse the repository at this point in the history
  • Loading branch information
nkraetzschmar committed Feb 8, 2024
1 parent 18422ca commit 8acb311
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
podman pull --arch amd64 "$container"
podman build -t build --build-arg base="$container" .
mkdir repo
podman run --rm -v "$PWD/repo:/repo" -v "$PWD/package-releases:/package-releases" -v "$PWD/package-imports:/package-imports" -e GH_TOKEN build /download_pkgs /repo /package-releases /package-imports
podman run --rm -v "$PWD/repo:/repo" -v "$PWD/package-releases:/package-releases" -v "$PWD/package-imports:/package-imports" -v "$PWD/package-exclude:/package-exclude" -e GH_TOKEN build /download_pkgs /repo /package-releases /package-imports /package-exclude
- name: download arm64 packages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -55,7 +55,7 @@ jobs:
podman pull --arch arm64 "$container"
podman build -t build --build-arg base="$container" .
mkdir repo_arm64
podman run --rm -v "$PWD/repo_arm64:/repo" -v "$PWD/package-releases:/package-releases" -v "$PWD/package-imports:/package-imports" -e GH_TOKEN build /download_pkgs /repo /package-releases /package-imports
podman run --rm -v "$PWD/repo_arm64:/repo" -v "$PWD/package-releases:/package-releases" -v "$PWD/package-imports:/package-imports" -v "$PWD/package-exclude:/package-exclude" -e GH_TOKEN build /download_pkgs /repo /package-releases /package-imports /package-exclude
cp -r --no-clobber repo_arm64/. repo/.
rm -rf repo_arm64
- name: build kms signing container
Expand Down
3 changes: 2 additions & 1 deletion download_pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -exufo pipefail
target="$(realpath "$1")"
releases="$(realpath "$2")"
import_list="$(realpath "$3")"
exclude_patterns="$(realpath "$4")"

dir="$(mktemp -d)"
trap 'cd / && rm -rf "$dir"' EXIT
Expand Down Expand Up @@ -39,7 +40,7 @@ sort -o depends -u depends
join -v 1 depends pkgs > needed

xargs apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances < needed | grep '^\w' | cut -d : -f 1 | sort | uniq > recursive_depends
join -v 1 recursive_depends pkgs > recursive_needed
join -v 1 recursive_depends pkgs | { grep -v -x -f "$exclude_patterns" || true; } > recursive_needed

mkdir apt_download
(cd apt_download && xargs apt-get download) < recursive_needed
Expand Down
4 changes: 4 additions & 0 deletions package-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apt-utils
db-util
libdb-dev
libdb5\.3.*

0 comments on commit 8acb311

Please sign in to comment.