added another way to download scratch build

This commit is contained in:
Andrei Radchenko 2025-01-13 16:46:46 +01:00
commit 3caf8cddfa

View file

@ -1,5 +1,5 @@
#!/bin/bash
#KOJI_TASK_ID=2596437
#KOJI_TASK_ID=127827211
KOJI_TASK_ID=${KOJI_TASK_ID:-} # Use the environment variable, or an empty string if not set
# Check if KOJI_TASK_ID is set
@ -15,9 +15,9 @@ KOJI_TASK_ID=${KOJI_TASK_ID:-} # Use the environment variable, or an empty stri
ARCH=$(uname -m)
# Download the build for the current architecture
koji download-build $KOJI_TASK_ID --arch=$ARCH || {
echo "Failed to download build $KOJI_TASK_ID for architecture $ARCH using koji" >&2
exit 1
( koji download-build --debuginfo --task-id --arch $ARCH $KOJI_TASK_ID || koji download-task --arch $ARCH $KOJI_TASK_ID ) | egrep Downloading | cut -d " " -f 3 | tee rpms-list-$KOJI_TASK_ID || {
echo "WARN: Failed to download rpms from task $KOJI_TASK_ID for architecture $ARCH using koji" >&2
exit 0
}
@ -31,15 +31,17 @@ koji download-build $KOJI_TASK_ID --arch=$ARCH || {
MAIN_RPM=$(ls nodejs-*.$ARCH.rpm 2>/dev/null | head -n 1)
DEPENDENCY_RPM=$(ls nodejs-libs-*.$ARCH.rpm 2>/dev/null | head -n 1)
NPM_RPM=$(ls nodejs-npm-*.$ARCH.rpm 2>/dev/null | head -n 1)
DEVEL_RPM=$(ls nodejs-devel-*.$ARCH.rpm 2>/dev/null | head -n 1)
# Check if all necessary RPMs are found
if [ -z "$MAIN_RPM" ] || [ -z "$DEPENDENCY_RPM" ] || [ -z "$NPM_RPM" ]; then
if [ -z "$MAIN_RPM" ] || [ -z "$DEVEL_RPM" ] || [ -z "$DEPENDENCY_RPM" ] || [ -z "$NPM_RPM" ]; then
echo "Required RPMs not found for x86_64 architecture." >&2
exit 1
fi
# Install the main package, its dependency, and npm package
rpm -ivh "$MAIN_RPM" "$DEPENDENCY_RPM" "$NPM_RPM" || {
rpm -ivh "$MAIN_RPM" "$DEPENDENCY_RPM" "$NPM_RPM" "$DEVEL_RPM" || {
echo "Failed to install RPMs" >&2
exit 1
}