This is an automated email from the ASF dual-hosted git repository.

shamrick pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/7.0.x by this push:
     new ffcd4b2652 Fix Pkg to Only Add Weasel if Already Exists (#6977)
ffcd4b2652 is described below

commit ffcd4b26521b711996eaab1b415893251b7c4392
Author: Steve Hamrick <[email protected]>
AuthorDate: Thu Jul 21 09:14:26 2022 -0600

    Fix Pkg to Only Add Weasel if Already Exists (#6977)
    
    * Only add weasel if exists
    
    * Simplify
---
 pkg | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pkg b/pkg
index e7c2d4141e..a9efc2b4af 100755
--- a/pkg
+++ b/pkg
@@ -155,9 +155,10 @@ while getopts h78abdf:lopqvsSL opt; do
        esac
 done
 
+CMD=$("${COMPOSECMD[@]}" -f $COMPOSE_FILE config --services)
 # Weasel must be built first otherwise it will fail from build artifacts/cache 
in an environment that doesn't have git
 # e.g. the environment produced by `./pkg source`.
-PROJECTS="weasel"$'\n'"$("${COMPOSECMD[@]}" -f $COMPOSE_FILE config --services 
| sed '/^weasel$/d')"
+PROJECTS=$(grep -E "^weasel$" <<<"$CMD"; grep -Ev "^weasel$"<<<"$CMD")
 HELP_TEXT="$(cat <<HELP_TEXT
 Usage: $SELF [options] [projects]
   -7           Build RPMs targeting CentOS 7

Reply via email to