changeset 33:1537aff795c5

FIX: Quote all variables used for labels because they can contain a '?' character and thus is influenced by the shell's automatic filename expansion. If a file with a one character name exists in the current directory then the output of check-ports was as if the version label was this filename.
author Franz Glasner <hg@dom66.de>
date Sat, 18 Nov 2017 12:30:52 +0100
parents 37f003c9f4e2
children 36a10ff20355
files bin/check-ports
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/bin/check-ports	Sat Nov 18 11:53:41 2017 +0100
+++ b/bin/check-ports	Sat Nov 18 12:30:52 2017 +0100
@@ -49,7 +49,7 @@
     eval _rversions=\"\${remote_${_repo}_versions}\"
     while read _rfqp _rl _rdescr ; do
         if [ ${_rfqp%-*} = ${_name} ] ; then
-            eval remote_${_repo}_label=\${_rl}
+            eval remote_${_repo}_label=\"\${_rl}\"
             eval remote_${_repo}_descr=\"\${_rdescr}\"
             return 0
         fi
@@ -167,14 +167,14 @@
     get_remote_repo_data ${LOCAL_REPO} ${_installed_name}
     get_remote_repo_data ${LOCALBSDPORTS_REPO} ${_installed_name}
     get_remote_repo_data ${FREEBSD_REPO} ${_installed_name}
-    if [ \( -n "${alldata_flag}" \) -o \( ${llabel} != '?' -a ${llabel} != '=' \) -o \( ${remote_FreeBSD_label} != '?' -a ${remote_FreeBSD_label} != '=' \) -o \( ${remote_LocalBSDPorts_label} != '?' -a ${remote_LocalBSDPorts_label} != '=' \) -o \( ${remote_LocalRepo_label} != '?' -a ${remote_LocalRepo_label} != '=' \) ] ; then
+    if [ \( -n "${alldata_flag}" \) -o \( "${llabel}" != '?' -a "${llabel}" != '=' \) -o \( "${remote_FreeBSD_label}" != '?' -a "${remote_FreeBSD_label}" != '=' \) -o \( "${remote_LocalBSDPorts_label}" != '?' -a "${remote_LocalBSDPorts_label}" != '=' \) -o \( "${remote_LocalRepo_label}" != '?' -a "${remote_LocalRepo_label}" != '=' \) ] ; then
         print_title "${lfqp}" "${repository}"
         echo "   INDEX: ${llabel} ${ldescr}"
         echo "   FreeBSD: ${remote_FreeBSD_label} ${remote_FreeBSD_descr}"
-        if [ \( -n "${alldata_LocalBSDPorts_flag}" \) -o \( ${remote_LocalBSDPorts_label} != '?' \) ] ; then
+        if [ \( -n "${alldata_LocalBSDPorts_flag}" \) -o \( "${remote_LocalBSDPorts_label}" != '?' \) ] ; then
             echo "   LocalBSDPorts: ${remote_LocalBSDPorts_label} ${remote_LocalBSDPorts_descr}"
         fi
-        if [ \( -n "${alldata_LocalRepo_flag}" \) -o \( ${remote_LocalRepo_label} != '?' \) ] ; then
+        if [ \( -n "${alldata_LocalRepo_flag}" \) -o \( "${remote_LocalRepo_label}" != '?' \) ] ; then
             echo "   LocalRepo: ${remote_LocalRepo_label} ${remote_LocalRepo_descr}"
         fi
     fi