From 5615d94474c869dd70d8037d127de6fe08dc3834 Mon Sep 17 00:00:00 2001 From: Kevin Mittman Date: Mon, 12 Apr 2021 19:20:23 -0700 Subject: [PATCH] Save RPMs to location Signed-off-by: Kevin Mittman --- build.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 7e40e31..7c102ce 100755 --- a/build.sh +++ b/build.sh @@ -5,6 +5,9 @@ distro="$2" topdir="$HOME/dkms-nvidia" epoch="3" +[[ -n $OUTPUT ]] || +OUTPUT="$HOME/rpm-nvidia" + [[ -n $distro ]] || distro=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) [[ $distro == "main" ]] && distro="rhel8" @@ -119,4 +122,9 @@ else fi echo "---" -find "$topdir/RPMS" -mindepth 2 -maxdepth 2 -type f -name "*${version}*" +found=$(find "$topdir/RPMS" -mindepth 2 -maxdepth 2 -type f -name "*${version}*" 2>/dev/null) +for rpm in $found; do + echo "-> $(basename "$rpm")" + mkdir -p "$OUTPUT" + rsync -a "$rpm" "$OUTPUT" +done