Skip to content

Commit

Permalink
reprepro: consider $ARCH
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Oct 17, 2024
1 parent d1709a8 commit 77f7274
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
17 changes: 10 additions & 7 deletions reprepro-import.sh → reprepro/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,29 +27,31 @@ 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)

# 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

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)
5 changes: 3 additions & 2 deletions reprepro-stage.sh → reprepro/stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 77f7274

Please sign in to comment.