From 9c5e09bdc5cba9aeace8021961260f4fd65767c6 Mon Sep 17 00:00:00 2001 From: sreepuramsudheer Date: Tue, 24 Sep 2024 12:55:07 +0530 Subject: [PATCH] added script to edit plan.sh files. Signed-off-by: sreepuramsudheer --- .expeditor/automate_build.sh | 2 +- .expeditor/replace.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.expeditor/automate_build.sh b/.expeditor/automate_build.sh index d41c69bc14..a21a0c42de 100755 --- a/.expeditor/automate_build.sh +++ b/.expeditor/automate_build.sh @@ -6,7 +6,7 @@ git checkout vikas/cs-changes-for-pipeline # buildkite-agent artifact download "*.hart" ./results -./replace.sh +../.expeditor/replace.sh # echo "results directory contents" `ls -l results` export HAB_NONINTERACTIVE=true diff --git a/.expeditor/replace.sh b/.expeditor/replace.sh index 6d306c5010..8b3696a57e 100755 --- a/.expeditor/replace.sh +++ b/.expeditor/replace.sh @@ -6,7 +6,7 @@ check_hart() { formated=` echo $1 | awk -F'-' -v b=2 -v e=7 '{printf "%s %s ", $(NF-2), $(NF-3); for (i=b;i<= (NF - 4);i++) printf "%s%s", $i, (i< (NF -4) ? "-" : "\n")}'` IFS=' ' read -r timestamp version component <<< "${formated}" echo "timestamp $timestamp, version $version, component $component" - component1=`echo $component | tr -d "_-\""` + component1=`echo $component | tr -d "_\-\""` export ${component1}="$component/$version/$timestamp" } @@ -39,7 +39,7 @@ do while read dep do echo "processing $dep in $plan_file" - dep_component=`echo $dep | awk -F'/' '{print $2}' | tr -d "_-\""` + dep_component=`echo $dep | awk -F'/' '{print $2}' | tr -d "_\-\""` echo "dep_component = ${dep_component}, value = ${!dep_component}" if [[ -n "${!dep_component}" ]] then @@ -47,7 +47,7 @@ do echo "timestamp $timestamp, version $version, component $CScomponent" CScomponent1=`escape_char $CScomponent` echo "sed \"/\/$CScomponent1/ s|\/$CScomponent1.*|$CScomponent1/$version/$timestamp|\"" - sed -i "/pkg_deps/,/)/ s|\/$CScomponent1.*|/$CScomponent1/$version/$timestamp|" "${tmp_file}" + sed -i "/pkg_deps/,/)/ s|\/$CScomponent1.*|/$CScomponent1/$version/$timestamp\"|" "${tmp_file}" fi done cp $tmp_file $plan_file