From e5b918dc6d5ddef1462b22a81392017fb1d1e761 Mon Sep 17 00:00:00 2001 From: wangchong1995924 <15229716099@163.com> Date: Mon, 9 Aug 2021 10:46:51 +0800 Subject: [PATCH] fix string matching problem --- script/tools/pkg_rpm_update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/tools/pkg_rpm_update.sh b/script/tools/pkg_rpm_update.sh index cdafdd4..2c28199 100755 --- a/script/tools/pkg_rpm_update.sh +++ b/script/tools/pkg_rpm_update.sh @@ -238,7 +238,7 @@ fi if [[ ${flag} == 0 ]];then src_rpm=`cat binrpmlist | grep "src.rpm"` src_rpm_name=`echo ${src_rpm%%-[0-9]*}` - result=`ssh -i ${update_key} -o StrictHostKeyChecking=no root@${update_ip} "cd ${update_dir}/source/Packages/ && ls | grep ${src_rpm_name}-[0-9]*.rpm"` + result=`ssh -i ${update_key} -o StrictHostKeyChecking=no root@${update_ip} "cd ${update_dir}/source/Packages/ && ls | grep ^${src_rpm_name} | grep ${src_rpm_name}-[0-9]*.rpm"` if [[ "x${result}" == "x" ]];then echo "$src_rpm_name-xxx.oe1.src.rpm" >> NOT_FOUND flag=1 @@ -254,7 +254,7 @@ fi for line in `cat binrpmlist` do name=`echo ${line%%-[0-9]*}` - result=`ssh -i ${update_key} -o StrictHostKeyChecking=no root@${update_ip} "cd ${update_dir}/${arch}/Packages/ && ls | grep ${name}-[0-9]*.rpm"` + result=`ssh -i ${update_key} -o StrictHostKeyChecking=no root@${update_ip} "cd ${update_dir}/${arch}/Packages/ && ls | grep ^${name} | grep ${name}-[0-9]*.rpm"` if [[ "x${result}" == "x" ]];then echo "${name}-xxx.oe1.${arch}.rpm" >> NOT_FOUND else -- Gitee