From 77f72745306c953a89d33df4da5d73dccb773c91 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Thu, 17 Oct 2024 21:47:39 +0200 Subject: [PATCH] reprepro: consider $ARCH --- reprepro-import.sh => reprepro/import.sh | 17 ++++++++++------- reprepro-stage.sh => reprepro/stage.sh | 5 +++-- 2 files changed, 13 insertions(+), 9 deletions(-) rename reprepro-import.sh => reprepro/import.sh (75%) rename reprepro-stage.sh => reprepro/stage.sh (68%) diff --git a/reprepro-import.sh b/reprepro/import.sh similarity index 75% rename from reprepro-import.sh rename to reprepro/import.sh index 47c5f33b..aba5900d 100755 --- a/reprepro-import.sh +++ b/reprepro/import.sh @@ -8,6 +8,7 @@ fi # Sanity checks [ ! -d "$INCOMING_DIR" ] && echo "Invalid incoming directory" && exit 1 [ -z "$DISTRO" ] && echo "Distribution undefined" && exit 1 +[ -z "$ARCH" ] && echo "ARCH undefined" && exit 1 [ -z "$REPO" ] && echo "github repo undefined" && exit 1 # Operate on the -build distro @@ -26,13 +27,15 @@ function filter { } # Import sources -for f in "$INCOMING_DIR"/*.dsc; do - echo "$f" - reprepro includedsc "$DISTRO" "$f" | filter -done +if [ "$ARCH" == "amd64" ]; then + for f in "$INCOMING_DIR"/*.dsc; do + echo "$f" + reprepro includedsc "$DISTRO" "$f" | filter + done +fi # Import packages -reprepro includedeb "$DISTRO" "$INCOMING_DIR"/*.deb | filter +reprepro -A "$ARCH" includedeb "$DISTRO" "$INCOMING_DIR"/*.deb | filter # Cleanup files (cd "$INCOMING_DIR" || exit 1; rm -f ./*.log ./*.deb ./*.dsc ./*.tar.gz ./*.tar.xz ./*.changes ./*.buildinfo) @@ -40,7 +43,7 @@ reprepro includedeb "$DISTRO" "$INCOMING_DIR"/*.deb | filter # Rename, Import, and Cleanup ddeb files (if existing) if [ -n "$(ls -A "$INCOMING_DIR"/*.ddeb 2>/dev/null)" ]; then mmv "$INCOMING_DIR/*.ddeb" "$INCOMING_DIR/#1.deb" - reprepro -C main-dbg includedeb "$DISTRO" "$INCOMING_DIR"/*.deb | filter + reprepro -A "$ARCH" -C main-dbg includedeb "$DISTRO" "$INCOMING_DIR"/*.deb | filter (cd "$INCOMING_DIR" || exit 1; rm ./*.deb) fi @@ -48,7 +51,7 @@ reprepro export "$DISTRO" # Merge local.yaml into ros-one.yaml cat "$INCOMING_DIR/local.yaml" >> "ros-one.yaml" -"$(dirname "${BASH_SOURCE[0]}")/src/scripts/yaml_remove_duplicates.py" ros-one.yaml +"$(dirname "${BASH_SOURCE[0]}")/../src/scripts/yaml_remove_duplicates.py" ros-one.yaml # Remove remaining files (cd "$INCOMING_DIR" || exit 1; rm -f ./Packages ./Release ./README.md.in ./local.yaml) diff --git a/reprepro-stage.sh b/reprepro/stage.sh similarity index 68% rename from reprepro-stage.sh rename to reprepro/stage.sh index 09bd77b8..b0dd0851 100755 --- a/reprepro-stage.sh +++ b/reprepro/stage.sh @@ -8,11 +8,12 @@ fi # Sanity checks [ ! -d "$INCOMING_DIR" ] && echo "Invalid incoming directory" && exit 1 [ -z "$DISTRO" ] && echo "Distribution undefined" && exit 1 +[ -z "$ARCH" ] && echo "ARCH undefined" && exit 1 [ -z "$REPO" ] && echo "github repo undefined" && exit 1 # Move packages from build to production stage -pkgs=$(reprepro list "$DISTRO-build" | grep -v "|source" | cut -s -d " " -f 2) +pkgs=$(reprepro -A "$ARCH" list "$DISTRO-build" | grep -v "|source" | cut -s -d " " -f 2) # shellcheck disable=SC2086 -reprepro copy "$DISTRO" "$DISTRO-build" $pkgs +reprepro -A "$ARCH" copy "$DISTRO" "$DISTRO-build" $pkgs # reprepro remove "$DISTRO-build" "$pkgs"