From 91560f7ff52253f0cc8271f30ca2872de3f1d2e0 Mon Sep 17 00:00:00 2001 From: Jesus Alvarez Date: Sun, 16 Mar 2014 11:02:41 -0700 Subject: [PATCH] repo.sh: Fixed missing package list bug If the either the i686 or x86_64 packages are missing, an attempt was still made to copy the packages using the cp_list string to the non existent destination repo. This caused the script to terminate on error of cp with no destination repository. The fix was to check cp_list for "". If cp_list is empty, there are no packages to copy and the for loop is continued to the next architecture. --- repo.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/repo.sh b/repo.sh index 33788e9..38a7f47 100755 --- a/repo.sh +++ b/repo.sh @@ -116,9 +116,9 @@ if [[ $AZB_REPO != "" ]]; then # Use a specific version incase of archiso if [[ $AZB_REPO == "demz-repo-archiso" ]]; then - REQUIRED_VERSION="$AZB_LINUX_ARCHISO_FULL_VERSION" + REQUIRED_VERSION="$AZB_LINUX_ARCHISO_FULL_VERSION" elif [[ $AZB_REPO == "demz-repo-core" ]]; then - REQUIRED_VERSION="$AZB_LINUX_FULL_VERSION" + REQUIRED_VERSION="$AZB_LINUX_FULL_VERSION" fi if [[ $vers != $REQUIRED_VERSION ]]; then @@ -206,9 +206,9 @@ if [[ $AZB_REPO != "" ]]; then msg "Copying the new $arch packages and adding to repo..." - cp_list="" - ra_list="" - repo="" + cp_list="" # The packages to copy in one string + ra_list="" # The packages to add to the repo in one string + repo="" # The destination repo # Create the command file lists from the arrays for pkg in "${pkg_cp_list[@]}"; do @@ -221,6 +221,10 @@ if [[ $AZB_REPO != "" ]]; then fi done + if [[ $cp_list == "" ]]; then + warning "No packages to copy!" + continue + fi run_cmd "cp $cp_list $repo/" run_cmd "repo-add -k $AZB_GPG_SIGN_KEY -s -v -f $repo/${AZB_REPO}.db.tar.xz $ra_list"