[Tarantool-patches] [PATCH v1] update_repo: fix unbound variables

Alexander V. Tikhonov avtikhon at tarantool.org
Thu Jul 9 16:24:49 MSK 2020


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 <packages store subpath> <patterns of the packages to register>
 
+    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



More information about the Tarantool-patches mailing list