From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 66FCF445320 for ; Thu, 9 Jul 2020 16:24:55 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Thu, 9 Jul 2020 16:24:49 +0300 Message-Id: <479fa36dc1e20278275ff41e1eb4aaf74a69aeb1.1594301034.git.avtikhon@tarantool.org> Subject: [Tarantool-patches] [PATCH v1] update_repo: fix unbound variables List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Yukhin , Alexander Turenko Cc: tarantool-patches@dev.tarantool.org Fixed unbound variables at packaging tool update_repo.sh. Closes #5114 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5114-unbound-vars Issue: https://github.com/tarantool/tarantool/issues/5114 tools/update_repo.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/update_repo.sh b/tools/update_repo.sh index 47eadd189..5a68e3e05 100755 --- a/tools/update_repo.sh +++ b/tools/update_repo.sh @@ -699,7 +699,7 @@ function pack_rpm { for metafile in repodata.base/other \ repodata.base/filelists \ repodata.base/primary ; do - up_lines='' + up_full_lines='' if [ "$metafile" == "repodata.base/primary" ]; then up_full_lines='(\N+\n)*' fi @@ -845,7 +845,7 @@ function remove_rpm { # entry in damaged file, to fix it all found entries # of this file need to be removed for metafile in other filelists primary ; do - up_lines='' + up_full_lines='' if [ "$metafile" == "primary" ]; then up_full_lines='(\N+\n)*' fi @@ -940,6 +940,7 @@ elif [ "$os" == "el" -o "$os" == "fedora" ]; then # script twice with the given format: # pack_rpm + packed_rpms="" # prepare the workspace prepare_ws ${os}_${option_dist} if [ "$remove" != "" ]; then @@ -962,7 +963,7 @@ elif [ "$os" == "el" -o "$os" == "fedora" ]; then $rm_file $ws_lockfile popd 2>/dev/null || true - if [ -z "$packed_rpms" ]; then + if [ "$remove" == "" -a "$packed_rpms" == "" ]; then echo "ERROR: Current '$repo' path doesn't have '*.x86_64.rpm *.noarch.rpm *.src.rpm' packages in path" usage exit 1 -- 2.17.1