From patchwork Wed Jun 14 03:44:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25545 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21C86C001DC for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) by mx.groups.io with SMTP id smtpd.web10.3700.1686714313751333922 for ; Tue, 13 Jun 2023 20:45:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=fK28rwMx; spf=pass (domain: gmail.com, ip: 209.85.160.51, mailfrom: res.sapp@gmail.com) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1a670ac3650so3095692fac.1 for ; Tue, 13 Jun 2023 20:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714313; x=1689306313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dmxd66jqDVCZ3NXk/DY+86MnsaqlVTK1RjUaimdBSn4=; b=fK28rwMxHRXD17mDNnmTJI1YExPQzMWMCSXFT0/5YUynI9Q3uDrgUinM0gfgXj4s7t XnJEdFvuD5Vid5tBRUBXEOHqbU+vuUWfioAcmAQxmAjED4DMkV9OISwi/82zsDQBa2Ch jz9WBv0exUCUxO/qWpfOPtqxmeoSxhhLVKMUpNso1bTMzGcDHUdltCj12y+H6LLovhhW 2D8DUw9GAcCOkdPJG2Dtssj4Yfww3A+7ReI0wFUoENl7J223/mAZ1/LEL1pPJ8wpXhIO c6aC2eDabCSkoFPHtcPK6goUG/Oe0LlQaSIA0OZ51Pmp4ejduDYFT1hfYv4xejMeta9L fwfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714313; x=1689306313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dmxd66jqDVCZ3NXk/DY+86MnsaqlVTK1RjUaimdBSn4=; b=DfhlsZMBSTb/AyrqIG+AHN2r7UZ2iF4rJTbqXAOofyWASVDL1ajfKA80Fzl/FtsEOR MOamTgBBhGy7gGV90iMrGt/pSIE3W08gpjCnSJ6A/Y13NlWrB8H/2W9T/7W9HsYmn4Yd WGWEdXhjo1SGpR20iCcUYr65vhyh/4BtoSjGP1HMEMEfP5kJeVq5oD191xuyjLXHx/m0 vkRFjaSDxXlCtXi6jvSocF94dRchnJed4BiFd8Zx/IL3kPHYjdgMTR3rmSb+1etGO8Jg 78Ah5de0e6bmBETx6iX4s8j2Z7yWxXxTWFmI2MBGg+x/hm5qBqWVlhUCzH/9eZS6KVeB jSZw== X-Gm-Message-State: AC+VfDzWO+JPmhML/5PIQzQ9Ey2Pv3q3/fFVXv1UNn2aCCanbWg4AF5s a3hJWD3PJGWQzJD+wJu5coA= X-Google-Smtp-Source: ACHHUZ6Bb/RC4LKvS6HQ6O8qvPP5JnpOqC7+OC8A7adjA5UH/LmN0rW8nt725tn87VT7QwcEozXbhg== X-Received: by 2002:a05:6870:441:b0:19f:20db:a4d8 with SMTP id i1-20020a056870044100b0019f20dba4d8mr10624682oak.29.1686714313066; Tue, 13 Jun 2023 20:45:13 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:12 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 01/16] oe-layertool-setup: split logic and/or expressions Date: Tue, 13 Jun 2023 22:44:52 -0500 Message-ID: <20230614034507.598391-2-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14606 Shellcheck: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index 1fca272..ef25ca0 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -126,7 +126,7 @@ exit 1 check_input() { # Check that at least -i or -f was used - if [ "$interactive" = "n" -a "x$inputfile" = "x" ] + if [ "$interactive" = "n" ] && [ "x$inputfile" = "x" ] then echo "ERROR: You must either use this script with the -i or -f options" usage @@ -1000,7 +1000,7 @@ fi if [ "x$interactive" = "xy" ] then cont="y" - while [ "x$cont" = "xy" -o "x$cont" = "xY" ] + while [ "x$cont" = "xy" ] || [ "x$cont" = "xY" ] do # clean up the variables for each repo name="" From patchwork Wed Jun 14 03:44:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25547 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39498C001DE for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) by mx.groups.io with SMTP id smtpd.web10.3702.1686714314408225678 for ; Tue, 13 Jun 2023 20:45:14 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=hKL5EYG4; spf=pass (domain: gmail.com, ip: 209.85.210.47, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6b2d9ea4901so3281126a34.1 for ; Tue, 13 Jun 2023 20:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714313; x=1689306313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hK0eIjYl0PsgEfvNEqt/SDejCbk/rpBf/0VtsOGEYBw=; b=hKL5EYG4heT8mhrRdONzIaVgk+YKmmppGS8T9wEMCZf4ApXtwjBmyWlfxvTGkjCMeR zQ/5BoQGxk8Kd3/Nf6FINSQffj1w22HjAMLFVPTOckL1+j+P8/JgArZFfEDpI/DokgRN AcI+ZLfce00lBSXnPo15ClNBo/6KfisEDjOTQMjsDybcZAphTVbkDNboK3sJxYLEc+GL DTtiZYQZQ4XSRi1jr//3ty7J/4g01dST1qvfRwh8rHiwyci2GZ0ZK4I58E0oJ+oWObxI 0izHdjUA4sfISJYQoi4QOi/RdbL24dCyoWYPMA++E1kztLI0GMxG/ZdyfgdvIRXTc8cl rXow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714313; x=1689306313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hK0eIjYl0PsgEfvNEqt/SDejCbk/rpBf/0VtsOGEYBw=; b=S0zjq8IzIsw9cQVP28RDfpB6RrdAkGgm8Fl4v2v84pb8jFL0ahVMXc7Qf/fbNJ3P75 gcKSZO4guibrEwAc8smcAC94AX8BGxEjsEaWaWAs7VQwLE1kyEazT5jsyBH9Bm/FEyG7 KEAfofH4MM2qljjVwry03lvwgd72nBRN5S0i4RNftRiIOwtMED4nvili2kHW66kTwVQN 7xRfa2nULbB89oSbDj+DUxcTL4O2CWtbVRozEt8MWMupqev6kmm9/MsctHpLocGDxwjJ umpsFbEIkbg7DwQwHiUnxdVl6uVTJUFDAM23X50Si0ZvkN9UUngWTlLSB00zz60KR9zW QJGg== X-Gm-Message-State: AC+VfDzNx73R0+l+ZO/oGMmncR/SwKEjFEX/NKffyw1yOO3bghLGql2m dvzUOpFtrLfem44BAC88CHGLLkXnU/XRe0Uo X-Google-Smtp-Source: ACHHUZ7wnpUP9rHZ8intFEL8qKZJarDD4tjiqsnCMb8rO2kBsVcp+HjSiY1/jgRnHHuha2zXl5GbAw== X-Received: by 2002:a9d:730a:0:b0:6ab:31ed:85ef with SMTP id e10-20020a9d730a000000b006ab31ed85efmr11642728otk.27.1686714313674; Tue, 13 Jun 2023 20:45:13 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:13 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 02/16] oe-layertool-setup: prefer use of $() notation Date: Tue, 13 Jun 2023 22:44:53 -0500 Message-ID: <20230614034507.598391-3-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14607 Shellcheck: Use $(...) notation instead of legacy backticked `...`. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index ef25ca0..cd4e242 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -45,8 +45,8 @@ interactive="n" # flag for interactive mode. Default is n resethead="n" # flag for reset head mode. Default is n layers="" # variable holding the layers to add to bblayers.conf output="" # variable holding the output to write to outputfile -scriptdir=`pwd` # directory of this calling script -oebase=`pwd` # variable to hold base directory +scriptdir=$(pwd) # directory of this calling script +oebase=$(pwd) # variable to hold base directory sourcedir="" # directory where repos will be cloned builddir="" # directory for builds confdir="" # directory for build configuration files @@ -154,27 +154,27 @@ check_input() { # Input is a line of the form OECORE.*=value parse_oecore_line() { - var=`echo $1 | cut -d= -f1` - val=`echo $1 | cut -d= -f2` + var=$(echo $1 | cut -d= -f1) + val=$(echo $1 | cut -d= -f2) eval $var=$val } # Input is a line of the form BITBAKE.*=value parse_bitbake_line() { - var=`echo $1 | cut -d= -f1` - val=`echo $1 | cut -d= -f2` + var=$(echo $1 | cut -d= -f1) + val=$(echo $1 | cut -d= -f2) eval $var=$val } # Input is a line of the form LOCALCONF:.*=value parse_localconf_line() { - localconf=`echo "$1" | cut -d: -f2-100` + localconf=$(echo "$1" | cut -d: -f2-100) echo "$localconf" >> $oebase/tmp_append_local.conf } # Input is a line of the form MOTD: parse_motd_line() { - motd=`echo "$1" | cut -d: -f2-100` + motd=$(echo "$1" | cut -d: -f2-100) echo "$motd" >> $oebase/tmp_motd echo "$motd" } @@ -197,11 +197,11 @@ parse_repo_line() { # split the line on the comma separators # use the prefix if it was set. - eval $prefix"name"=`echo $1 | cut -d, -f1` - eval $prefix"uri"=`echo $1 | cut -d, -f2` - eval $prefix"branch"=`echo $1 | cut -d, -f3` - eval $prefix"commit"=`echo $1 | cut -d, -f4` - parsed_layers=`echo $1 | cut -d, -f5-` + eval $prefix"name"=$(echo $1 | cut -d, -f1) + eval $prefix"uri"=$(echo $1 | cut -d, -f2) + eval $prefix"branch"=$(echo $1 | cut -d, -f3) + eval $prefix"commit"=$(echo $1 | cut -d, -f4) + parsed_layers=$(echo $1 | cut -d, -f5-) # If no layers= was used, then don't add any layers temp_layers="none" @@ -210,9 +210,9 @@ parse_repo_line() { if [ "x$parsed_layers" != "x" ] then temp_layers="" - temp=`echo $parsed_layers | cut -d= -f2` + temp=$(echo $parsed_layers | cut -d= -f2) # temporarily reset the IFS value to : to split the layers - for x in `IFS=":";echo $temp` + for x in $(IFS=":";echo $temp) do # Add the $name value to each layer so that we have consistency # with how the layers are represented between the saved value @@ -319,7 +319,7 @@ parse_input_file() { # Create the repository line corresponding to the selections given. # In the case that no layers= option was passed then this will # create the layers= option corresponding to all layers being selected. - repo_line=`build_repo_line` + repo_line=$(build_repo_line) # Save the line in the output variable for if we create an output file output="$output""$repo_line\n" @@ -338,7 +338,7 @@ configure_repo() { # Check if the repo with $name was already seen. Use the , at the end # of the grep to avoid matching similar named repos. - temp=`printf '%s\n' $output | grep -e "^$name,"` + temp=$(printf '%s\n' $output | grep -e "^$name,") if [ "x$temp" != "x" ] then @@ -417,12 +417,12 @@ get_repo_branch() { # Get a unique list of branches for the user to chose from # Also delete the origin/HEAD line that the -r option returns - t_branches=`git branch -r | sed '/origin\/HEAD/d'` + t_branches=$(git branch -r | sed '/origin\/HEAD/d') for b in $t_branches do - branches="$branches"`echo $b | sed 's:.*origin/::g'`"\n" + branches="$branches"$(echo $b | sed 's:.*origin/::g')"\n" done - branches=`printf "$branches\n" | sort | uniq` + branches=$(printf "$branches\n" | sort | uniq) cat << EOM @@ -500,7 +500,7 @@ cat << EOM The $name repository has the following tags available: EOM - tags=`git tag` + tags=$(git tag) if [ "x$tags" = "x" ] then printf "\tNo tags found\n" @@ -566,7 +566,7 @@ select_layers() { cd $sourcedir # Get a count of how many layers there are - count=`find $name -name "layer.conf" | grep -c layer.conf` + count=$(find $name -name "layer.conf" | grep -c layer.conf) case $count in 0 ) @@ -581,7 +581,7 @@ select_layers() { ;; esac - t_layers=`find $name -name "layer.conf" | sed 's:\/conf\/layer.conf::'` + t_layers=$(find $name -name "layer.conf" | sed 's:\/conf\/layer.conf::') if [ "x$arg1" != "xall" ] then @@ -597,7 +597,7 @@ EOM for l in $t_layers do - printf "\t"`echo $l | sed "s:${name}\/::"`"\n" + printf "\t"$(echo $l | sed "s:${name}\/::")"\n" done cat << EOM @@ -656,7 +656,7 @@ get_oecorelayerconf() { fi cd $sourcedir - confs=`find . -name "bblayers.conf.sample"` + confs=$(find . -name "bblayers.conf.sample") done="n" @@ -711,7 +711,7 @@ get_oecorelocalconf() { fi cd $sourcedir - confs=`find . -name "local.conf.sample"` + confs=$(find . -name "local.conf.sample") done="n" @@ -813,7 +813,7 @@ EOM # Find if old DL_DIR was set if [ -e $confdir/local.conf.bak ] then - old_dldir=`cat $confdir/local.conf.bak | grep -e "^DL_DIR =" | sed 's|DL_DIR = ||' | sed 's/"//g'` + old_dldir=$(cat $confdir/local.conf.bak | grep -e "^DL_DIR =" | sed 's|DL_DIR = ||' | sed 's/"//g') else old_dldir="$oebase/downloads" fi @@ -854,7 +854,7 @@ print_motd() { print_image_names() { SOURCES="${1}" - FOLDERS=`find "${SOURCES}" -type d -a -iname images|grep recipes-core|sed -e "s/.*sources\///g"|cut -d '/' -f1|sort -u -r` + FOLDERS=$(find "${SOURCES}" -type d -a -iname images|grep recipes-core|sed -e "s/.*sources\///g"|cut -d '/' -f1|sort -u -r) IMAGES="" for FOLDER in ${FOLDERS} do @@ -863,15 +863,15 @@ print_image_names() { RECO="[recommended]" fi echo "From ${FOLDER}${RECO}:" - F_IMAGE_FOLDERS=`find "${SOURCES}/${FOLDER}" -type d -a -iname images|grep recipes-core` + F_IMAGE_FOLDERS=$(find "${SOURCES}/${FOLDER}" -type d -a -iname images|grep recipes-core) for IMG_FOLDER in ${F_IMAGE_FOLDERS} do - F_IMAGES=`find "${IMG_FOLDER}" -iname *.bb` + F_IMAGES=$(find "${IMG_FOLDER}" -iname *.bb) if [ -n "${F_IMAGES}" ]; then for img in ${F_IMAGES} do - name=`basename "${img}"|sed 's/\.bb$//g'` - summary=`grep SUMMARY "${img}"|cut -d '=' -f2| sed 's/["/]//g'|xargs echo` + name=$(basename "${img}"|sed 's/\.bb$//g') + summary=$(grep SUMMARY "${img}"|cut -d '=' -f2| sed 's/["/]//g'|xargs echo) if [ -z "${summary}" ]; then summary="No Summary available" fi @@ -911,7 +911,7 @@ cat > $confdir/setenv << EOM export OEBASE=${oebase} # try to find out bitbake directory -BITBAKEDIR=\`find \${OEBASE}/sources -name "*bitbake*"\` +BITBAKEDIR=\$(find \${OEBASE}/sources -name "*bitbake*") for f in \${BITBAKEDIR} do if [ -d \${f}/bin ] @@ -922,7 +922,7 @@ done # check for any scripts directories in the top-level of the repos and add those # to the PATH -SCRIPTS=\`find \${OEBASE}/sources -maxdepth 2 -name "scripts" -type d\` +SCRIPTS=\$(find \${OEBASE}/sources -maxdepth 2 -name "scripts" -type d) for s in \${SCRIPTS} do PATH="\${s}:\$PATH" @@ -945,13 +945,13 @@ EOM build_repo_line() { # clean up the layers to remove the repository name and add : divider temp_layers="" - for l in `echo $repo_layers | sed "s:${name}::" | sed -e 's:^\/::'` + for l in $(echo $repo_layers | sed "s:${name}::" | sed -e 's:^\/::') do - temp_layers="$temp_layers""`echo $l | sed "s:${name}\/::"`:" + temp_layers="$temp_layers""$(echo $l | sed "s:${name}\/::"):" done # Lastly clean off any trailing : - temp_layers=`echo $temp_layers | sed 's/:$//'` + temp_layers=$(echo $temp_layers | sed 's/:$//') echo "$name,$uri,$branch,$commit,layers=$temp_layers" } @@ -980,7 +980,7 @@ mkdir -p $oebase # retrive the absolute path to the oebase directory incase # a relative path is passed in cd $oebase -oebase=`pwd` +oebase=$(pwd) cd - # Populate the following variables depending on the value of oebase @@ -1019,7 +1019,7 @@ then # Create the repository line corresponding to the selections given. # In the case that no layers= option was passed then this will # create the layers= option corresponding to all layers being selected. - repo_line=`build_repo_line` + repo_line=$(build_repo_line) # Save the line in the output variable for if we create an output file output="$output""$repo_line\n" @@ -1043,7 +1043,7 @@ if [ "x$outputfile" != "x" ] then # make sure that the directory for the output file exists cd $oebase - dir=`dirname $outputfile` + dir=$(dirname $outputfile) if [ ! -d $dir ] then mkdir -p $dir From patchwork Wed Jun 14 03:44:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25549 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3789BC001DD for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) by mx.groups.io with SMTP id smtpd.web11.3789.1686714315154491302 for ; Tue, 13 Jun 2023 20:45:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=HIAkTrTR; spf=pass (domain: gmail.com, ip: 209.85.160.48, mailfrom: res.sapp@gmail.com) Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-19f8af9aa34so4693792fac.1 for ; Tue, 13 Jun 2023 20:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714314; x=1689306314; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2S6vJaaj+4qN6ckfzV7jrae73OZb4qEBQEeGuhmDtsg=; b=HIAkTrTRnixOI1CjBSGiCTT66Es0yvxuFOpzbRtuFOOo5lDIckk5DVAOpQyS578viv vyUdBGmH4qMpIXWgkh9bm9STQqGUI1UrxJTyB6AP+z0cWtptzmjT3K7dB1ei/lSNxv7p s1y5mD821dieFxW4KyWT1xIrhHH2kyLPoMr1308CSS8BQduMnK/UpeiJetbXRoNGJTw/ LnLdBl4bSSAWdEThQIkwBJLCGS8T9Ec8mktwB/BrPimkgGmOLkULoWxL/rJ47YKIxgUU Hu5r9I2xc+BLuWAHA5ZXDwS9qXaMTouH/ywLWcal47qGnWNXA+DeppUdvTRY4dM+Chvu uUCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714314; x=1689306314; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2S6vJaaj+4qN6ckfzV7jrae73OZb4qEBQEeGuhmDtsg=; b=X+I0pyD5d8/+oaJXtVljNSQ75Fz125eRIzGKSnDN/bN5LjTVLsIY7gW3smA3QAr951 1FXRXr5wW8kJql5iaTJx4Csp+TTE6R7YE1tBqLgqdWNfKLdAOCdOJB0yumvfRUNepPhE NP1/6sBEvPKDtKyghEWfOPd1eJUQoeMMEX0fim2lsSaZxTXqgVC+aD1Mfs9RhkZJc35e pR4s3FN8GMUekm0boS3Se4LWwTYqv17dXfoT1elTdkPj5bX+e3PNdKALtuAzFxdl7iRV 9KFBFzMMIE8MeGuMxkKrTtewu0oJG1/XMHdvyX40BkRg+HZyKThMnM3HOU5ZEoKbxf0+ LQng== X-Gm-Message-State: AC+VfDwen1sydHacOFsDEecN43wAIhY1CQIvBDqw//OITWyBFK5m4s4k bGPi8MQVRX0d4+lJuPZUdejaew6kNRphigkF X-Google-Smtp-Source: ACHHUZ5Sz/U9zKDahL+7YLJI981o+MV93lIlMKroqflKH7SeDjHKgo/srB2cF74fIvqI3i7kj4h4cw== X-Received: by 2002:a05:6870:3e4:b0:19a:6061:7e8d with SMTP id h36-20020a05687003e400b0019a60617e8dmr10511270oaf.24.1686714314407; Tue, 13 Jun 2023 20:45:14 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:14 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 03/16] oe-layertool-setup: replace all x comparisons with -n/-z Date: Tue, 13 Jun 2023 22:44:54 -0500 Message-ID: <20230614034507.598391-4-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14608 Replace all the stray x$var comparisons with the proper -n/-z equivalent. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index cd4e242..3faf00c 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -126,7 +126,7 @@ exit 1 check_input() { # Check that at least -i or -f was used - if [ "$interactive" = "n" ] && [ "x$inputfile" = "x" ] + if [ "$interactive" = "n" ] && [ -z "$inputfile" ] then echo "ERROR: You must either use this script with the -i or -f options" usage @@ -207,7 +207,7 @@ parse_repo_line() { temp_layers="none" # If layers= was used then set the layers variable, empty list would add all found layers - if [ "x$parsed_layers" != "x" ] + if [ -n "$parsed_layers" ] then temp_layers="" temp=$(echo $parsed_layers | cut -d= -f2) @@ -223,10 +223,10 @@ parse_repo_line() { # Assign the layers. If the temp_layers is empty then set the layers # to all and we will fill in the actual layers in the later steps. - if [ "x$temp_layers" = "x" ] + if [ -z "$temp_layers" ] then eval $prefix"repo_layers"="all" - elif [ "x$temp_layers" = "xnone" ] + elif [ "$temp_layers" = "none" ] then eval $prefix"repo_layers"="none" else @@ -256,7 +256,7 @@ parse_input_file() { repo_layers="" # Skip empty lines - if [ "x$line" = "x" ] + if [ -z "$line" ] then continue fi @@ -331,7 +331,7 @@ parse_input_file() { configure_repo() { - if [ "x$name" = "x" ] + if [ -z "$name" ] then get_repo_name fi @@ -340,7 +340,7 @@ configure_repo() { # of the grep to avoid matching similar named repos. temp=$(printf '%s\n' $output | grep -e "^$name,") - if [ "x$temp" != "x" ] + if [ -n "$temp" ] then echo "This repository ($name) has already been configured with the following values:" printf '\t%s\n' $temp @@ -348,7 +348,7 @@ configure_repo() { return 1 fi - if [ "x$uri" = "x" ] + if [ -z "$uri" ] then get_repo_uri fi @@ -360,28 +360,28 @@ configure_repo() { clone_repo - if [ "x$branch" = "x" ] + if [ -z "$branch" ] then get_repo_branch fi checkout_branch - if [ "x$commit" = "x" ] + if [ -z "$commit" ] then get_repo_commit fi checkout_commit - if [ "x$repo_layers" = "xall" ] + if [ "$repo_layers" = "all" ] then # Call select layers with the all option to select all layers select_layers "all" - elif [ "x$repo_layers" = "x" ] + elif [ -z "$repo_layers" ] then select_layers - elif [ "x$repo_layers" = "xnone" ] + elif [ "$repo_layers" = "none" ] then # Call select layers with the none option to not select any layers select_layers "none" @@ -473,7 +473,7 @@ checkout_branch() { # any. In the case of a clean checkout this should be already up to date, # but for an existing checkout this should be the changes that were # fetched earlier. - if [ "x$resethead" = "xy" ] + if [ "$resethead" = "y" ] then # Instead of merging, reset to remote branch to avoid conflicts due to rebase git reset --hard origin/$branch @@ -484,7 +484,7 @@ checkout_branch() { checkout_commit() { cd $sourcedir/$name - if [ "x$commit" != "xHEAD" ] + if [ "$commit" != "HEAD" ] then git checkout $commit fi @@ -501,7 +501,7 @@ The $name repository has the following tags available: EOM tags=$(git tag) - if [ "x$tags" = "x" ] + if [ -z "$tags" ] then printf "\tNo tags found\n" else @@ -519,7 +519,7 @@ EOM read input - if [ "x$input" = "x" ] + if [ -z "$input" ] then commit="HEAD" fi @@ -558,7 +558,7 @@ select_layers() { #If so prompt for which layers to configure #If there is only one then just configure that layer and don't prompt - if [ "x$arg1" = "xnone" ] + if [ "$arg1" = "none" ] then repo_layers="" return @@ -583,7 +583,7 @@ select_layers() { t_layers=$(find $name -name "layer.conf" | sed 's:\/conf\/layer.conf::') - if [ "x$arg1" != "xall" ] + if [ "$arg1" != "all" ] then echo "arg1 = $arg1" # Prompt for which layers to configure @@ -609,7 +609,7 @@ EOM read input fi - if [ "x$input" = "x" ] + if [ -z "$input" ] then repo_layers=$t_layers else @@ -643,7 +643,7 @@ EOM get_oecorelayerconf() { # Check if the variable is already set. - if [ "x$OECORELAYERCONF" != "x" ] + if [ -n "$OECORELAYERCONF" ] then OECORELAYERCONFPATH=$scriptdir/$OECORELAYERCONF @@ -697,7 +697,7 @@ EOM get_oecorelocalconf() { # Check if the variable is already set. - if [ "x$OECORELOCALCONF" != "x" ] + if [ -n "$OECORELOCALCONF" ] then OECORELOCALCONFPATH=$scriptdir/$OECORELOCALCONF @@ -819,7 +819,7 @@ EOM fi # If command line option was not set use the old dldir - if [ "x$dldir" = "x" ] + if [ -z "$dldir" ] then dldir=$old_dldir fi @@ -990,17 +990,17 @@ confdir="$builddir/conf" check_input -if [ "x$inputfile" != "x" ] +if [ -n "$inputfile" ] then parse_input_file print_motd fi -if [ "x$interactive" = "xy" ] +if [ "$interactive" = "y" ] then cont="y" - while [ "x$cont" = "xy" ] || [ "x$cont" = "xY" ] + while [ "$cont" = "y" ] || [ "$cont" = "Y" ] do # clean up the variables for each repo name="" @@ -1039,7 +1039,7 @@ config_oecorelayerconf get_oecorelocalconf config_oecorelocalconf -if [ "x$outputfile" != "x" ] +if [ -n "$outputfile" ] then # make sure that the directory for the output file exists cd $oebase From patchwork Wed Jun 14 03:44:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25548 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AB75EB64DD for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by mx.groups.io with SMTP id smtpd.web11.3790.1686714315795627347 for ; Tue, 13 Jun 2023 20:45:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aoL0NGHp; spf=pass (domain: gmail.com, ip: 209.85.160.50, mailfrom: res.sapp@gmail.com) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-1a28de15c8aso4798736fac.2 for ; Tue, 13 Jun 2023 20:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714315; x=1689306315; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8pprTbdaLxuH1f76QesohSY17vxyOnJYejTbQz33yJg=; b=aoL0NGHpFWLcbzJCHm7925UBjznMopdKWIG+6Tx4QXw2aWiEchgU8EQ44cbBYnB1Dh Od5jLzLLAWZ2kyBqZ+1r+QCmLHqvAahSc1rVjxCnqwQcG9jCTUnXT5yEdt7mbtUVLorx zsZLKK0f9wTxBFg92zwGESMzBOWVZ4wpKQTCdK+jo6Yhdf2YjFJE+0K+e4LEpFGxRqDh OvKkuqqsxwrvOhcrf08+dxaOZ4rOZzty8/ukD3WPOVDVGojyWuO+XGjo2JehAa4KWblf 9h+5faEMa7Hf0yU3Q9O3F+noVVw4kTBdpywOhoWYk8ia6RoPQjhtj2Fw4W0wW7zT8LPp nQrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714315; x=1689306315; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8pprTbdaLxuH1f76QesohSY17vxyOnJYejTbQz33yJg=; b=YQQzeJrioEyBbXK2czk5YTYSR+vnHmz22k3HH5izCKg7ER6H63IWjCZvP5kpL4/xHp xugPZIlXtuwypcjjfyBv5NzutQ+R1cn2OdlddW0dx6HANFssyUzwe0Sh3V1kzFO9h+Fr OS3MsVIFxGR5sj6B9QnPVBHCw3m1IgdSQi7hEJTheVmq+0VEOyXEEtwu3MeLVP+lC74t iBgbhqJIaIQ1mZRcHG25tQbUWbq0AUHJyBRQ8EAr2y79nBO6VH9kW6clABxNcX+LVFUo WHnaQpL7rY1bhIDFdMF6IUNZwqY1RC9TlAvL02DPThBivmoOPhxyVMUpZsYfSRw3EynU kWFg== X-Gm-Message-State: AC+VfDyx5QvE1cLHlvf9dorBP6x3J+C+7+vt4lsCqF/zTkaaO+rP8znU P9/l6pxo/JV+PliGyVNbAQY= X-Google-Smtp-Source: ACHHUZ57A2HoXirk3jpdhpinfoM6e64GBbQmwDrsxvrDux/RoOUaBXuXsCMl/rNW4pD1ahYgm2Cw5w== X-Received: by 2002:a05:6870:e743:b0:18f:1113:c6be with SMTP id t3-20020a056870e74300b0018f1113c6bemr10166647oak.11.1686714315097; Tue, 13 Jun 2023 20:45:15 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:14 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 04/16] oe-layertool-setup: fix all the printf calls Date: Tue, 13 Jun 2023 22:44:55 -0500 Message-ID: <20230614034507.598391-5-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14609 You aren't supposed to use a variable in the printf format definition. It kinda defeats the purpose of using printf. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index 3faf00c..3e6ac4e 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -338,12 +338,12 @@ configure_repo() { # Check if the repo with $name was already seen. Use the , at the end # of the grep to avoid matching similar named repos. - temp=$(printf '%s\n' $output | grep -e "^$name,") + temp=$(printf '%s\n' "$output" | grep -e "^$name,") if [ -n "$temp" ] then echo "This repository ($name) has already been configured with the following values:" - printf '\t%s\n' $temp + printf '\t%s\n' "$temp" echo "Skipping configuring duplicate repository" return 1 fi @@ -422,7 +422,7 @@ get_repo_branch() { do branches="$branches"$(echo $b | sed 's:.*origin/::g')"\n" done - branches=$(printf "$branches\n" | sort | uniq) + branches=$(printf '%s\n' "$branches" | sort | uniq) cat << EOM @@ -503,12 +503,12 @@ EOM tags=$(git tag) if [ -z "$tags" ] then - printf "\tNo tags found\n" + printf '\t%s\n' "No tags found" else # Format the tags nicely for t in $tags do - printf "\t* $t\n" + printf '\t%s\n' "* $t" done fi cat << EOM @@ -597,7 +597,7 @@ EOM for l in $t_layers do - printf "\t"$(echo $l | sed "s:${name}\/::")"\n" + printf '\t%s\n' "$(echo $l | sed "s:${name}\/::")" done cat << EOM @@ -673,7 +673,7 @@ EOM for f in $confs do - printf "\t$f\n" + printf '\t%s\n' "$f" done cat << EOM @@ -728,7 +728,7 @@ EOM for f in $confs do - printf "\t$f\n" + printf '\t%s\n' "$f" done cat << EOM @@ -777,7 +777,7 @@ BBLAYERS += " \\ EOM for l in $layers do - printf "\t$l \\%b" "\n" >> $confdir/bblayers.conf + printf '\t%s \\\n' "$l" >> $confdir/bblayers.conf done echo "\"" >> $confdir/bblayers.conf } @@ -1048,7 +1048,7 @@ then then mkdir -p $dir fi - printf '%s\n' $output > $outputfile + printf '%s\n' "$output" > $outputfile echo "Output file is $outputfile" fi From patchwork Wed Jun 14 03:44:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25551 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F252C001E0 for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by mx.groups.io with SMTP id smtpd.web11.3791.1686714316585859615 for ; Tue, 13 Jun 2023 20:45:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=bbr6tvVj; spf=pass (domain: gmail.com, ip: 209.85.210.54, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6b296cadbffso3521282a34.2 for ; Tue, 13 Jun 2023 20:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714316; x=1689306316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ybfEqt8U2y7w1Uht7sTK3x41iVoqpJNsDvbVXuUf5h4=; b=bbr6tvVj/pdEDg7TIBXUWq37KbSW0Lb+O3nyQSTcWHB/RUJuToTxfOKgm7w4gbVTLk doI9wtFy1UoSHcTXzIoETOuq+J7/A5jfGeN7IvGWUeXp/tGM3ZZSiUu+Se+uxQJy7wjP xsh1lQ1y7rEIOiNfoEmCkjUqLo9I3Y1ZvkQBVZOHo0+ACa9qOeEiOULa3BBnKgL9QDVG 5iUhbS5eTAvIoK0HTy5BqUn3BuXNkHZxx7CrncU760b90knLcwt9SRLAu6QNX4uNv5VA 1M9QuSMUgrZIlwL212BtMGFirjCNcR5O4XEfP2d2GB062r3g1+j04gV5zpgPxq29rxlo HiEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714316; x=1689306316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ybfEqt8U2y7w1Uht7sTK3x41iVoqpJNsDvbVXuUf5h4=; b=gKONhffiMtqGl1V0JMZY2yiuMkblSU2afMTAQx8EazazY334KkB/M4QhxybdcSu5lL tVvKGLcldymchOPeS/WPBm2T2mYOZ7fvUpzxu37hKiaCGL27ymFRpz9COLktBxKeFtEk BM0ZFQVRev9po4bkddhrITrCxEuL7DzL2yyyxtH4PrCuYawxHNIFBvVVRDeNUEgEjI7I oVaU9J1ONOCqAWWLfnmeb6GJDVrD196vQLK3eiO+5CWUS6uiX6ZSmfONqYs6tU5kX1XT NUl92YuQac/HnrKMpPwHYB2B7w5upc4C8XiV87QRkLEy4dvbdWJ/BIe07l6sO35aO1ln nL7w== X-Gm-Message-State: AC+VfDza5UybAiNbuxI1YjCIYQSI/Ce6Hm/rfYj59W3TRpuHfE8bihuk gwFJj86075p3IN8fWermb+M= X-Google-Smtp-Source: ACHHUZ707wkU3J4uzziDwsLQKndGF91qoUIRzNWKp9qsupw/U+60hpN+3CLKkD0kgMuVxNMyqamF7A== X-Received: by 2002:a05:6830:5a:b0:6b2:a9f0:9fc2 with SMTP id d26-20020a056830005a00b006b2a9f09fc2mr11082633otp.10.1686714315721; Tue, 13 Jun 2023 20:45:15 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:15 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 05/16] oe-layertool-setup: fix all quoting, switch eval to export Date: Tue, 13 Jun 2023 22:44:56 -0500 Message-ID: <20230614034507.598391-6-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14610 Quote everything to prevent unexpected splitting and globbing. Also switch out eval for export where we can. Export is capable of much less runtime shenanigans than eval is. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 222 +++++++++++++++++++++--------------------- 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index 3e6ac4e..abe3f12 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -133,7 +133,7 @@ check_input() { fi # If an input file was given make sure it exists - if [ ! -f $inputfile ] + if [ ! -f "$inputfile" ] then echo "ERROR: the file \"$inputfile\" given for inputfile does not exist" usage @@ -142,10 +142,10 @@ check_input() { # If directories do not exist then create them for f in sourcedir builddir confdir do - eval t="$"$f - if [ ! -d $t ] + eval t="\$${f}" + if [ ! -d "$t" ] then - mkdir -p $t + mkdir -p "$t" fi done @@ -154,28 +154,28 @@ check_input() { # Input is a line of the form OECORE.*=value parse_oecore_line() { - var=$(echo $1 | cut -d= -f1) - val=$(echo $1 | cut -d= -f2) - eval $var=$val + var=$(echo "$1" | cut -d= -f1) + val=$(echo "$1" | cut -d= -f2) + export "$var"="$val" } # Input is a line of the form BITBAKE.*=value parse_bitbake_line() { - var=$(echo $1 | cut -d= -f1) - val=$(echo $1 | cut -d= -f2) - eval $var=$val + var=$(echo "$1" | cut -d= -f1) + val=$(echo "$1" | cut -d= -f2) + export "$var"="$val" } # Input is a line of the form LOCALCONF:.*=value parse_localconf_line() { localconf=$(echo "$1" | cut -d: -f2-100) - echo "$localconf" >> $oebase/tmp_append_local.conf + echo "$localconf" >> "$oebase/tmp_append_local.conf" } # Input is a line of the form MOTD: parse_motd_line() { motd=$(echo "$1" | cut -d: -f2-100) - echo "$motd" >> $oebase/tmp_motd + echo "$motd" >> "$oebase/tmp_motd" echo "$motd" } @@ -197,11 +197,11 @@ parse_repo_line() { # split the line on the comma separators # use the prefix if it was set. - eval $prefix"name"=$(echo $1 | cut -d, -f1) - eval $prefix"uri"=$(echo $1 | cut -d, -f2) - eval $prefix"branch"=$(echo $1 | cut -d, -f3) - eval $prefix"commit"=$(echo $1 | cut -d, -f4) - parsed_layers=$(echo $1 | cut -d, -f5-) + export "${prefix}name"="$(echo "$1" | cut -d, -f1)" + export "${prefix}uri"="$(echo "$1" | cut -d, -f2)" + export "${prefix}branch"="$(echo "$1" | cut -d, -f3)" + export "${prefix}commit"="$(echo "$1" | cut -d, -f4)" + parsed_layers=$(echo "$1" | cut -d, -f5-) # If no layers= was used, then don't add any layers temp_layers="none" @@ -210,14 +210,14 @@ parse_repo_line() { if [ -n "$parsed_layers" ] then temp_layers="" - temp=$(echo $parsed_layers | cut -d= -f2) + temp=$(echo "$parsed_layers" | cut -d= -f2) # temporarily reset the IFS value to : to split the layers - for x in $(IFS=":";echo $temp) + for x in $(IFS=":"; echo "$temp") do # Add the $name value to each layer so that we have consistency # with how the layers are represented between the saved value # and the dynamically parsed values - temp_layers="$temp_layers""$name/$x " + temp_layers="${temp_layers}${name}/${x} " done fi @@ -225,25 +225,25 @@ parse_repo_line() { # to all and we will fill in the actual layers in the later steps. if [ -z "$temp_layers" ] then - eval $prefix"repo_layers"="all" + export "${prefix}repo_layers"="all" elif [ "$temp_layers" = "none" ] then - eval $prefix"repo_layers"="none" + export "${prefix}repo_layers"="none" else - eval $prefix"repo_layers"='$temp_layers' + export "${prefix}repo_layers"="$temp_layers" fi } parse_input_file() { - if [ -e $oebase/tmp_append_local.conf ] + if [ -e "$oebase/tmp_append_local.conf" ] then - rm $oebase/tmp_append_local.conf + rm "$oebase/tmp_append_local.conf" fi - if [ -e $oebase/tmp_motd ] + if [ -e "$oebase/tmp_motd" ] then - rm $oebase/tmp_motd + rm "$oebase/tmp_motd" fi while read line @@ -262,41 +262,41 @@ parse_input_file() { fi # Skip comment lines - echo $line | grep -e "^#" > /dev/null + echo "$line" | grep -e "^#" > /dev/null if [ "$?" = "0" ] then continue fi # If the line starts with OECORE then parse the OECORE setting - echo $line | grep -e "^OECORE.*=" > /dev/null + echo "$line" | grep -e "^OECORE.*=" > /dev/null if [ "$?" = "0" ] then - parse_oecore_line $line - output="$output""$line\n" + parse_oecore_line "$line" + output="${output}${line}\n" continue fi # If the line starts with BITBAKE then parse the BITBAKE setting - echo $line | grep -e "^BITBAKE.*=" > /dev/null + echo "$line" | grep -e "^BITBAKE.*=" > /dev/null if [ "$?" = "0" ] then - parse_bitbake_line $line - output="$output""$line\n" + parse_bitbake_line "$line" + output="${output}${line}\n" continue fi # If the line starts with LOCALCONF: then parse the LOCALCONF: setting - echo $line | grep -e "^LOCALCONF:.*" > /dev/null + echo "$line" | grep -e "^LOCALCONF:.*" > /dev/null if [ "$?" = "0" ] then parse_localconf_line "$line" - output="$output""$line\n" + output="${output}${line}\n" continue fi # If the line starts with MOTD: then parse the MOTD: setting - echo $line | grep -e "^MOTD:.*" > /dev/null + echo "$line" | grep -e "^MOTD:.*" > /dev/null if [ "$?" = "0" ] then parse_motd_line "$line" @@ -305,7 +305,7 @@ parse_input_file() { # Since the line is not a comment or an OECORE setting let's assume # it is a repository information line and parse it - parse_repo_line $line + parse_repo_line "$line" configure_repo @@ -322,11 +322,11 @@ parse_input_file() { repo_line=$(build_repo_line) # Save the line in the output variable for if we create an output file - output="$output""$repo_line\n" + output="${output}${repo_line}\n" save_layers - done < $inputfile + done < "$inputfile" } @@ -393,12 +393,12 @@ configure_repo() { clone_repo() { # check if the repo already exists. if so then fetch the latest updates, # else clone it - if [ -d $sourcedir/$name ] + if [ -d "$sourcedir/$name" ] then - cd $sourcedir/$name - $scriptdir/git_retry.sh fetch --all + cd "$sourcedir/$name" + "$scriptdir/git_retry.sh" fetch --all else - $scriptdir/git_retry.sh clone $uri $sourcedir/$name + "$scriptdir/git_retry.sh" clone "$uri" "$sourcedir/$name" if [ "$?" != "0" ] then echo "ERROR: Could not clone repository at $uri" @@ -413,14 +413,14 @@ get_repo_branch() { while [ "$found" = "0" ] do - cd $sourcedir/$name + cd "$sourcedir/$name" # Get a unique list of branches for the user to chose from # Also delete the origin/HEAD line that the -r option returns t_branches=$(git branch -r | sed '/origin\/HEAD/d') for b in $t_branches do - branches="$branches"$(echo $b | sed 's:.*origin/::g')"\n" + branches="${branches}$(echo "$b" | sed 's:.*origin/::g')\n" done branches=$(printf '%s\n' "$branches" | sort | uniq) @@ -456,17 +456,17 @@ EOM } checkout_branch() { - cd $sourcedir/$name + cd "$sourcedir/$name" # Check if a local branch already exists to track the remote branch. # If not then create a tracking branch and checkout the branch # else just checkout the existing branch - git branch | grep $branch > /dev/null + git branch | grep "$branch" > /dev/null if [ "$?" != "0" ] then - git checkout origin/$branch -b $branch --track + git checkout "origin/$branch" -b "$branch" --track else - git checkout $branch + git checkout "$branch" fi # Now that we are on the proper branch pull the remote branch changes if @@ -476,14 +476,14 @@ checkout_branch() { if [ "$resethead" = "y" ] then # Instead of merging, reset to remote branch to avoid conflicts due to rebase - git reset --hard origin/$branch + git reset --hard "origin/$branch" else - git merge origin/$branch + git merge "origin/$branch" fi } checkout_commit() { - cd $sourcedir/$name + cd "$sourcedir/$name" if [ "$commit" != "HEAD" ] then git checkout $commit @@ -492,7 +492,7 @@ checkout_commit() { get_repo_commit() { # prompt for what commit to use with HEAD as default - cd $sourcedir/$name + cd "$sourcedir/$name" cat << EOM @@ -526,10 +526,10 @@ EOM } verify_layers() { - cd $sourcedir + cd "$sourcedir" for l in $repo_layers do - if [ ! -f $sourcedir/$l/conf/layer.conf ] + if [ ! -f "$sourcedir/$l/conf/layer.conf" ] then echo "ERROR: the $l layer in the $name repository could not be" echo " found. Bailing out." @@ -543,7 +543,7 @@ save_layers() { # Add the repo layers to the layers list for l in $repo_layers do - layers="$layers""$sourcedir/$l " + layers="${layers}${sourcedir}/$l " done } @@ -564,9 +564,9 @@ select_layers() { return fi - cd $sourcedir + cd "$sourcedir" # Get a count of how many layers there are - count=$(find $name -name "layer.conf" | grep -c layer.conf) + count=$(find "$name" -name "layer.conf" | grep -c layer.conf) case $count in 0 ) @@ -581,7 +581,7 @@ select_layers() { ;; esac - t_layers=$(find $name -name "layer.conf" | sed 's:\/conf\/layer.conf::') + t_layers=$(find "$name" -name "layer.conf" | sed 's:\/conf\/layer.conf::') if [ "$arg1" != "all" ] then @@ -597,7 +597,7 @@ EOM for l in $t_layers do - printf '\t%s\n' "$(echo $l | sed "s:${name}\/::")" + printf '\t%s\n' "$(echo "$l" | sed "s:${name}\/::")" done cat << EOM @@ -647,7 +647,7 @@ get_oecorelayerconf() { then OECORELAYERCONFPATH=$scriptdir/$OECORELAYERCONF - if [ ! -e $OECORELAYERCONFPATH ] + if [ ! -e "$OECORELAYERCONFPATH" ] then echo "ERROR: Could not find the specified layer conf file $OECORELAYERCONFPATH" fi @@ -655,7 +655,7 @@ get_oecorelayerconf() { return fi - cd $sourcedir + cd "$sourcedir" confs=$(find . -name "bblayers.conf.sample") done="n" @@ -683,7 +683,7 @@ EOM read input - if [ -e $input ] + if [ -e "$input" ] then done="y" OECORELAYERCONF=$input @@ -701,7 +701,7 @@ get_oecorelocalconf() { then OECORELOCALCONFPATH=$scriptdir/$OECORELOCALCONF - if [ ! -e $OECORELOCALCONFPATH ] + if [ ! -e "$OECORELOCALCONFPATH" ] then echo "ERROR: Could not find the specified local conf file $OECORELOCALCONFPATH" exit 1 @@ -710,7 +710,7 @@ get_oecorelocalconf() { return fi - cd $sourcedir + cd "$sourcedir" confs=$(find . -name "local.conf.sample") done="n" @@ -738,7 +738,7 @@ EOM read input - if [ -e $input ] + if [ -e "$input" ] then done="y" OECORELOCALCONF=$input @@ -767,19 +767,19 @@ NOTE: Any additional entries to this file will be lost if the $0 EOM # First copy the template file - cp -f $OECORELAYERCONFPATH $confdir/bblayers.conf + cp -f "$OECORELAYERCONFPATH" "$confdir/bblayers.conf" # Now add the layers we have configured to the BBLAYERS variable -cat >> $confdir/bblayers.conf << EOM +cat >> "$confdir/bblayers.conf" << EOM # Layers configured by oe-core-setup script BBLAYERS += " \\ EOM for l in $layers do - printf '\t%s \\\n' "$l" >> $confdir/bblayers.conf + printf '\t%s \\\n' "$l" >> "$confdir/bblayers.conf" done - echo "\"" >> $confdir/bblayers.conf + echo "\"" >> "$confdir/bblayers.conf" } @@ -800,20 +800,20 @@ NOTE: You will probably want to change the default MACHINE setting in the EOM - if [ -e $confdir/local.conf ] + if [ -e "$confdir/local.conf" ] then echo "WARNING: Found existing $confdir/local.conf" echo "Saving a backup to $confdir/local.conf.bak" - cp -f $confdir/local.conf $confdir/local.conf.bak + cp -f "$confdir/local.conf" "$confdir/local.conf.bak" fi # First copy the template file - cp -f $OECORELOCALCONFPATH $confdir/local.conf + cp -f "$OECORELOCALCONFPATH" "$confdir/local.conf" # Find if old DL_DIR was set - if [ -e $confdir/local.conf.bak ] + if [ -e "$confdir/local.conf.bak" ] then - old_dldir=$(cat $confdir/local.conf.bak | grep -e "^DL_DIR =" | sed 's|DL_DIR = ||' | sed 's/"//g') + old_dldir=$(cat "$confdir/local.conf.bak" | grep -e "^DL_DIR =" | sed 's|DL_DIR = ||' | sed 's/"//g') else old_dldir="$oebase/downloads" fi @@ -824,30 +824,30 @@ EOM dldir=$old_dldir fi - sed -i "s|^DL_DIR.*|DL_DIR = \"${dldir}\"|" $confdir/local.conf + sed -i "s|^DL_DIR.*|DL_DIR = \"${dldir}\"|" "$confdir/local.conf" - if [ -e $oebase/tmp_append_local.conf ] + if [ -e "$oebase/tmp_append_local.conf" ] then - echo "" >> $confdir/local.conf - echo "#====================================================================" >> $confdir/local.conf - echo "# LOCALCONF: settings from config file:" >> $confdir/local.conf - echo "# $inputfile" >> $confdir/local.conf - echo "#" >> $confdir/local.conf - echo "# Do not remove." >> $confdir/local.conf - echo "#--------------------------------------------------------------------" >> $confdir/local.conf - cat $oebase/tmp_append_local.conf >> $confdir/local.conf - echo "#====================================================================" >> $confdir/local.conf - echo "" >> $confdir/local.conf - rm $oebase/tmp_append_local.conf + echo "" >> "$confdir/local.conf" + echo "#====================================================================" >> "$confdir/local.conf" + echo "# LOCALCONF: settings from config file:" >> "$confdir/local.conf" + echo "# $inputfile" >> "$confdir/local.conf" + echo "#" >> "$confdir/local.conf" + echo "# Do not remove." >> "$confdir/local.conf" + echo "#--------------------------------------------------------------------" >> "$confdir/local.conf" + cat "$oebase/tmp_append_local.conf" >> "$confdir/local.conf" + echo "#====================================================================" >> "$confdir/local.conf" + echo "" >> "$confdir/local.conf" + rm "$oebase/tmp_append_local.conf" fi } print_motd() { - if [ -e $oebase/tmp_motd ] + if [ -e "$oebase/tmp_motd" ] then echo "" - cat $oebase/tmp_motd + cat "$oebase/tmp_motd" echo "" fi } @@ -866,7 +866,7 @@ print_image_names() { F_IMAGE_FOLDERS=$(find "${SOURCES}/${FOLDER}" -type d -a -iname images|grep recipes-core) for IMG_FOLDER in ${F_IMAGE_FOLDERS} do - F_IMAGES=$(find "${IMG_FOLDER}" -iname *.bb) + F_IMAGES=$(find "${IMG_FOLDER}" -iname '*.bb') if [ -n "${F_IMAGES}" ]; then for img in ${F_IMAGES} do @@ -901,17 +901,17 @@ For example: Common targets are: EOM -print_image_names ${sourcedir} +print_image_names "${sourcedir}" # Write the setenv file -cat > $confdir/setenv << EOM +cat > "$confdir/setenv" << EOM # Set OEBASE to where the build and source directories reside # NOTE: Do NOT place a trailing / on the end of OEBASE. -export OEBASE=${oebase} +export OEBASE="${oebase}" # try to find out bitbake directory -BITBAKEDIR=\$(find \${OEBASE}/sources -name "*bitbake*") +BITBAKEDIR=\$(find "\${OEBASE}/sources" -name "*bitbake*") for f in \${BITBAKEDIR} do if [ -d \${f}/bin ] @@ -922,7 +922,7 @@ done # check for any scripts directories in the top-level of the repos and add those # to the PATH -SCRIPTS=\$(find \${OEBASE}/sources -maxdepth 2 -name "scripts" -type d) +SCRIPTS=\$(find "\${OEBASE}/sources" -maxdepth 2 -name "scripts" -type d) for s in \${SCRIPTS} do PATH="\${s}:\$PATH" @@ -931,13 +931,13 @@ done unset BITBAKEDIR unset SCRIPTS export PATH -export BUILDDIR=${builddir} +export BUILDDIR="${builddir}" EOM if [ "$BITBAKE_INCLUSIVE_VARS" = "no" ]; then - echo "export BB_ENV_EXTRAWHITE=\"MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER OEBASE META_SDK_PATH TOOLCHAIN_TYPE TOOLCHAIN_BRAND TOOLCHAIN_BASE TOOLCHAIN_PATH TOOLCHAIN_PATH_ARMV5 TOOLCHAIN_PATH_ARMV7 TOOLCHAIN_PATH_ARMV8 EXTRA_TISDK_FILES TISDK_VERSION ARAGO_BRAND ARAGO_RT_ENABLE ARAGO_SYSTEST_ENABLE ARAGO_KERNEL_SUFFIX TI_SECURE_DEV_PKG_CAT TI_SECURE_DEV_PKG_AUTO TI_SECURE_DEV_PKG_K3 ARAGO_SYSVINIT SYSFW_FILE ARAGO_JAILHOUSE_ENABLE\"" >> $confdir/setenv + echo "export BB_ENV_EXTRAWHITE=\"MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER OEBASE META_SDK_PATH TOOLCHAIN_TYPE TOOLCHAIN_BRAND TOOLCHAIN_BASE TOOLCHAIN_PATH TOOLCHAIN_PATH_ARMV5 TOOLCHAIN_PATH_ARMV7 TOOLCHAIN_PATH_ARMV8 EXTRA_TISDK_FILES TISDK_VERSION ARAGO_BRAND ARAGO_RT_ENABLE ARAGO_SYSTEST_ENABLE ARAGO_KERNEL_SUFFIX TI_SECURE_DEV_PKG_CAT TI_SECURE_DEV_PKG_AUTO TI_SECURE_DEV_PKG_K3 ARAGO_SYSVINIT SYSFW_FILE ARAGO_JAILHOUSE_ENABLE\"" >> "$confdir/setenv" else - echo "export BB_ENV_PASSTHROUGH_ADDITIONS=\"MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER OEBASE META_SDK_PATH TOOLCHAIN_TYPE TOOLCHAIN_BRAND TOOLCHAIN_BASE TOOLCHAIN_PATH TOOLCHAIN_PATH_ARMV5 TOOLCHAIN_PATH_ARMV7 TOOLCHAIN_PATH_ARMV8 EXTRA_TISDK_FILES TISDK_VERSION ARAGO_BRAND ARAGO_RT_ENABLE ARAGO_SYSTEST_ENABLE ARAGO_KERNEL_SUFFIX TI_SECURE_DEV_PKG_CAT TI_SECURE_DEV_PKG_AUTO TI_SECURE_DEV_PKG_K3 ARAGO_SYSVINIT SYSFW_FILE ARAGO_JAILHOUSE_ENABLE\"" >> $confdir/setenv + echo "export BB_ENV_PASSTHROUGH_ADDITIONS=\"MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER OEBASE META_SDK_PATH TOOLCHAIN_TYPE TOOLCHAIN_BRAND TOOLCHAIN_BASE TOOLCHAIN_PATH TOOLCHAIN_PATH_ARMV5 TOOLCHAIN_PATH_ARMV7 TOOLCHAIN_PATH_ARMV8 EXTRA_TISDK_FILES TISDK_VERSION ARAGO_BRAND ARAGO_RT_ENABLE ARAGO_SYSTEST_ENABLE ARAGO_KERNEL_SUFFIX TI_SECURE_DEV_PKG_CAT TI_SECURE_DEV_PKG_AUTO TI_SECURE_DEV_PKG_K3 ARAGO_SYSVINIT SYSFW_FILE ARAGO_JAILHOUSE_ENABLE\"" >> "$confdir/setenv" fi } @@ -945,13 +945,13 @@ EOM build_repo_line() { # clean up the layers to remove the repository name and add : divider temp_layers="" - for l in $(echo $repo_layers | sed "s:${name}::" | sed -e 's:^\/::') + for l in $(echo "$repo_layers" | sed "s:${name}::" | sed -e 's:^\/::') do - temp_layers="$temp_layers""$(echo $l | sed "s:${name}\/::"):" + temp_layers="${temp_layers}$(echo "$l" | sed "s:${name}\/::"):" done # Lastly clean off any trailing : - temp_layers=$(echo $temp_layers | sed 's/:$//') + temp_layers=$(echo "$temp_layers" | sed 's/:$//') echo "$name,$uri,$branch,$commit,layers=$temp_layers" } @@ -975,11 +975,11 @@ do done # create passed in directory if it doesn't exist -mkdir -p $oebase +mkdir -p "$oebase" # retrive the absolute path to the oebase directory incase # a relative path is passed in -cd $oebase +cd "$oebase" oebase=$(pwd) cd - @@ -1022,7 +1022,7 @@ then repo_line=$(build_repo_line) # Save the line in the output variable for if we create an output file - output="$output""$repo_line\n" + output="${output}${repo_line}\n" save_layers @@ -1042,13 +1042,13 @@ config_oecorelocalconf if [ -n "$outputfile" ] then # make sure that the directory for the output file exists - cd $oebase - dir=$(dirname $outputfile) - if [ ! -d $dir ] + cd "$oebase" + dir=$(dirname "$outputfile") + if [ ! -d "$dir" ] then - mkdir -p $dir + mkdir -p "$dir" fi - printf '%s\n' "$output" > $outputfile + printf '%s\n' "$output" > "$outputfile" echo "Output file is $outputfile" fi From patchwork Wed Jun 14 03:44:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25541 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11048C001B0 for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by mx.groups.io with SMTP id smtpd.web10.3703.1686714317173463617 for ; Tue, 13 Jun 2023 20:45:17 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=lPBUNnye; spf=pass (domain: gmail.com, ip: 209.85.210.41, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6b29b9f5a94so4233068a34.2 for ; Tue, 13 Jun 2023 20:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714316; x=1689306316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ww0sienGkMKH4ApvrPSXmy+4sB+LHQYuCyomRGj/I6E=; b=lPBUNnye9rWASH80KldxQwAiM6Ql0uIha5TH/pFsGItgWSvoTV3r62CavsV5iaYh4a RunEino9eS40zjx6ysO1yxN8mfwHGGRmdX6ULQDn5yz5XigFgJ7WZMyZNTrvUuwc1p0i zpu2yHwiG8FK3YMon1OdKHLm+lSecLHQgE2u4nlwoeym+wHm4f1G5Nck6QCVaE2oVlJG ouQfTRsHxOiWE/r6K5Puj81fzdK06Km+QjVEOYYWPulxSF42EEk8NRZCiStGgAH3NPYi VShbFv1laoIDAZJ5IkChM6L4kD/U1ldpC9ow3tjmyD9gWZWmIPtcOj9I72S1R+8mhgYq mVtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714316; x=1689306316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ww0sienGkMKH4ApvrPSXmy+4sB+LHQYuCyomRGj/I6E=; b=IQcYDhOocmo5zbv1IcfTWbsF1YhrzqxLohfKR8ZmixjsMYvwOhIJxgSf2BI478mLB7 6kQj16JVPFtZHc62BuBcXiIg4pFpN5OBjmplC4vvRU2EgX4NvrATHRuY275pKcrhkWM0 X5HxivfXqPNfQuD61j5RYfj85gHHHRpnajutxl1ng7OuADYNxMw8/M/okmmJJCqMzrtX JPq59lmoZwNcCE60yJspz9orn//qlLYOlGxgD9OZJZATsm87lTmtxSAa/fqusrxKjlaE 6sPjh7CSSK9I1oOaVPtM+OpY2fQbnJTksuC16WA719jdwWhfwwjEJ0NPjJLtONVYqlPt Zq8Q== X-Gm-Message-State: AC+VfDww9m3D5P2Wy77iGLg150LGaldnXJOTLN2TxOOjoL/J9Y/9hhae oFzXPKCR2pXU5NkF+kOmOTQ= X-Google-Smtp-Source: ACHHUZ6TwF65n76lQXD/1Hyzn0iKX6qodUKoVfj5etgUvL9cn2iCdDmOOqWBiYnswvmn2Ke4tqU1IA== X-Received: by 2002:a05:6830:13c4:b0:6b2:cdba:5ea3 with SMTP id e4-20020a05683013c400b006b2cdba5ea3mr11238137otq.23.1686714316463; Tue, 13 Jun 2023 20:45:16 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:16 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 06/16] oe-layertool-setup: only invoke read with -r Date: Tue, 13 Jun 2023 22:44:57 -0500 Message-ID: <20230614034507.598391-7-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14611 Shellcheck: read without -r will mangle backslashes. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index abe3f12..ee93ec9 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -246,7 +246,7 @@ parse_input_file() { rm "$oebase/tmp_motd" fi - while read line + while read -r line do # clean the parsing variables for each run name="" @@ -434,7 +434,7 @@ $branches What branch would you like to checkout for the $name repository? EOM - read input + read -r input # check that the branch is in the list of branches # NOTE: using a for loop here because I want exact matches. @@ -517,7 +517,7 @@ You can either select one of these tags or specify your own commit SHA sum, or press ENTER to use the HEAD of the current branch. EOM - read input + read -r input if [ -z "$input" ] then @@ -606,7 +606,7 @@ Please provide the list of layers you wish to use as a space separated list, or press enter to use all of the layers. EOM - read input + read -r input fi if [ -z "$input" ] @@ -625,7 +625,7 @@ cat << EOM What is the name of the repository you want to configure? EOM - read name + read -r name } @@ -637,7 +637,7 @@ cat << EOM What is the git clone uri of the $name repository? EOM - read uri + read -r uri } @@ -681,7 +681,7 @@ Please select one of the above sample files to use as a template for configuring your build environment. EOM - read input + read -r input if [ -e "$input" ] then @@ -736,7 +736,7 @@ Please select one of the above sample files to use as a template for configuring your build environment. EOM - read input + read -r input if [ -e "$input" ] then @@ -1029,7 +1029,7 @@ then echo "" echo "" echo "Would you like to configure another repository? [y/n] " - read cont + read -r cont done fi From patchwork Wed Jun 14 03:44:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25539 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10D26EB64DA for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) by mx.groups.io with SMTP id smtpd.web11.3792.1686714317753976455 for ; Tue, 13 Jun 2023 20:45:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=h3hJWdEx; spf=pass (domain: gmail.com, ip: 209.85.210.44, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6b2f0a140b7so2360865a34.3 for ; Tue, 13 Jun 2023 20:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714317; x=1689306317; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uyXWl1ACQlBNTPecPcVfIXUd7L0fkbRkVxZC9wSFzxE=; b=h3hJWdExR2iBGGriugPvo1QxPDENb5e18kKKJ7tNcI/gz2R/pjC6j4X4FRmHyax2cN PGTaxONtS1ejIP6k5x2VUNIP7hdH0k5zI0rwathDf9g56xQEkMz71K5tPt/LiAVrvnVw x1fKvDnymKUtmTRX2/DO/FfvK+7r42NgFhxIWeqy+7OdOGSn7IN+dy2AWwmb7PS6PVkz 2eHpnI4Xtiq1r/Dk98l+mgvVSHGj42EvT+VBki33Ih0EyqZvPFahWeaUgDH97p2WIvJG iYVFAC+uOglNTyOhNH9d08yatSQr/+kqCamA3FgkkGx4PWo/c9nji0EMK4axEyaO2dsL 28ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714317; x=1689306317; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uyXWl1ACQlBNTPecPcVfIXUd7L0fkbRkVxZC9wSFzxE=; b=IJeo1TRroL/6qItML99nwCQ5k0xlcuDs2XIm1jvujAXtctwpTwHd3ofITjG7EE4Tkt CgNCUMlIRAcHCfkq9Q+lmYffIfu7zQ8gZSOrTLkWzhzZ08mbFPLz5BHTFzFWBAuAKz3h s4nBOMzmDWP6WpDlTK/4DB9Bhv6zEpv2w1ubRzQLRWcLSGdoXt6JHigOBSa3rWwxDVGI pmEDWKshGUbpFkw6Ovr7WK5UoeOrrSbdPtfxlWBbIRFZS+2tHUvqSE2gelG23PQ/sVs0 1YM94ASJ7VTZjRcO/oe4aDB9p2DJnm2EUCmMB5SJx1nSB+zIrj7+J/VrqamHHFfexfh/ q4Mg== X-Gm-Message-State: AC+VfDwKPn8iY5XcYqgtHxFfLuoBQQvp+cCBTwlTQyn5OgMcgwEStQna Djfy3pYzkjPfiyUsy/cbwFM= X-Google-Smtp-Source: ACHHUZ7AjjC2jrkjWLW4zySNDn0Jxzu77RyBtBrf4AO0q99GlH0dYun0L45Eaq6seq0cZ5Lk4ez3jg== X-Received: by 2002:a05:6830:1e47:b0:6b0:cfce:6d24 with SMTP id e7-20020a0568301e4700b006b0cfce6d24mr10799747otj.0.1686714317065; Tue, 13 Jun 2023 20:45:17 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:16 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 07/16] oe-layertool-setup: check exit code directly Date: Tue, 13 Jun 2023 22:44:58 -0500 Message-ID: <20230614034507.598391-8-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14612 Shellcheck: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index ee93ec9..a87a423 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -262,15 +262,13 @@ parse_input_file() { fi # Skip comment lines - echo "$line" | grep -e "^#" > /dev/null - if [ "$?" = "0" ] + if echo "$line" | grep -q -e "^#" then continue fi # If the line starts with OECORE then parse the OECORE setting - echo "$line" | grep -e "^OECORE.*=" > /dev/null - if [ "$?" = "0" ] + if echo "$line" | grep -q -e "^OECORE.*=" then parse_oecore_line "$line" output="${output}${line}\n" @@ -278,8 +276,7 @@ parse_input_file() { fi # If the line starts with BITBAKE then parse the BITBAKE setting - echo "$line" | grep -e "^BITBAKE.*=" > /dev/null - if [ "$?" = "0" ] + if echo "$line" | grep -q -e "^BITBAKE.*=" then parse_bitbake_line "$line" output="${output}${line}\n" @@ -287,8 +284,7 @@ parse_input_file() { fi # If the line starts with LOCALCONF: then parse the LOCALCONF: setting - echo "$line" | grep -e "^LOCALCONF:.*" > /dev/null - if [ "$?" = "0" ] + if echo "$line" | grep -q -e "^LOCALCONF:.*" then parse_localconf_line "$line" output="${output}${line}\n" @@ -296,8 +292,7 @@ parse_input_file() { fi # If the line starts with MOTD: then parse the MOTD: setting - echo "$line" | grep -e "^MOTD:.*" > /dev/null - if [ "$?" = "0" ] + if echo "$line" | grep -q -e "^MOTD:.*" then parse_motd_line "$line" continue @@ -307,11 +302,9 @@ parse_input_file() { # it is a repository information line and parse it parse_repo_line "$line" - configure_repo - # if the return from configure repo was non-zero then do not save # the output - if [ "$?" != "0" ] + if ! configure_repo then continue fi @@ -398,8 +391,7 @@ clone_repo() { cd "$sourcedir/$name" "$scriptdir/git_retry.sh" fetch --all else - "$scriptdir/git_retry.sh" clone "$uri" "$sourcedir/$name" - if [ "$?" != "0" ] + if ! "$scriptdir/git_retry.sh" clone "$uri" "$sourcedir/$name" then echo "ERROR: Could not clone repository at $uri" exit 1 @@ -461,8 +453,7 @@ checkout_branch() { # Check if a local branch already exists to track the remote branch. # If not then create a tracking branch and checkout the branch # else just checkout the existing branch - git branch | grep "$branch" > /dev/null - if [ "$?" != "0" ] + if git branch | grep -q "$branch" then git checkout "origin/$branch" -b "$branch" --track else @@ -1009,9 +1000,7 @@ then commit="" repo_layers="" - configure_repo - - if [ "$?" != "0" ] + if ! configure_repo then continue fi From patchwork Wed Jun 14 03:44:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25544 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13A94C3DA40 for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by mx.groups.io with SMTP id smtpd.web10.3704.1686714318384829340 for ; Tue, 13 Jun 2023 20:45:18 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=M4gC/Cc3; spf=pass (domain: gmail.com, ip: 209.85.210.54, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6b160f3f384so3859741a34.3 for ; Tue, 13 Jun 2023 20:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714317; x=1689306317; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xrZFUyPF39feiLJU0iStt3yG+Lb91ZJJpcuH6ua6kBw=; b=M4gC/Cc3/RIBB37KlUPB+X6HMoTi5WnIpx0Bkm1OUfnkT/tmVHLgp2XvkqOYliaPBx shYkwl3eT822DjGJbV5STLQl4k3qVXwAnwxbJmeP15JdrSc0vkKxhqZ2+M8o3zIrxkyb J5EeXUX6SW47VXXjjT8lJDVuqnoNEaOLXuMvHu4sulJD/pBPlBRdK6tLjJNTHW6vSlMa DHORukjgmJ52sVuaZtGgiTSeHx06cbrlmFGKe0X8IqU2vNbblWW2so8VXcvBo0XyyoNX BhEHjSl6u/uj3M+TlCjo71JzbXZqhq/jXSb9MFyj5racDaiJJR7fuakupjyxivJvyqvx xOrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714317; x=1689306317; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xrZFUyPF39feiLJU0iStt3yG+Lb91ZJJpcuH6ua6kBw=; b=LffwMcDaXUkAdKs4ab1Liypzfg+OijmyV/w9SfvYwBkUOdnrSHs6ikOMoYYjJY7z8K 5WqkaGYmPgypLij0OuKFOASDTnaH5QH0sqRWRGrgOTHT2ZZweVM8cSyiiyRjGQNqskIE yqnjCbqnjQp4xMzKvMFM8UvSRZ7st2K6GhEMCVzuHvo80Eb71WzDfWAXmhpJMbiIwm/q q8xS27sPGeiCEkkZyUzq1ioutHNhLxLCq0q7W2OpGlltHPu2OOHVUYPwbDdx+3dEVh4H YTHniRJq5qeXs3RoTah0KyV801sFxIipPYtqZEJofmPg4O8DkGtJfKM6uB3Yu6ZQ8GMm JqXg== X-Gm-Message-State: AC+VfDxHCZYPYE6BxA431cqoUqb7vN0fr4WpQRfEV5P0JlPunWc6ZpWf hx/db4/2pdYpB+pJlMV5joRsg3w6uUENVtxY X-Google-Smtp-Source: ACHHUZ7ughOEy8YOVx2l9oA3dAdCD2t567NZP6J1LL0gvCGnhoJnE42iiAaAzYnq0n/bYjIUc1A2NQ== X-Received: by 2002:a05:6830:1119:b0:6af:870c:b71d with SMTP id w25-20020a056830111900b006af870cb71dmr11271154otq.30.1686714317690; Tue, 13 Jun 2023 20:45:17 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:17 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 08/16] oe-layertool-setup: guard all cd calls Date: Tue, 13 Jun 2023 22:44:59 -0500 Message-ID: <20230614034507.598391-9-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14613 Make the scrip exit early if any cd calls fail in the main process. Return 1 in the case a function fails to cd. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index a87a423..6908fe2 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -386,9 +386,8 @@ configure_repo() { clone_repo() { # check if the repo already exists. if so then fetch the latest updates, # else clone it - if [ -d "$sourcedir/$name" ] + if cd "$sourcedir/$name" 2> /dev/null then - cd "$sourcedir/$name" "$scriptdir/git_retry.sh" fetch --all else if ! "$scriptdir/git_retry.sh" clone "$uri" "$sourcedir/$name" @@ -405,7 +404,7 @@ get_repo_branch() { while [ "$found" = "0" ] do - cd "$sourcedir/$name" + cd "$sourcedir/$name" || return 1 # Get a unique list of branches for the user to chose from # Also delete the origin/HEAD line that the -r option returns @@ -448,7 +447,7 @@ EOM } checkout_branch() { - cd "$sourcedir/$name" + cd "$sourcedir/$name" || return 1 # Check if a local branch already exists to track the remote branch. # If not then create a tracking branch and checkout the branch @@ -474,7 +473,7 @@ checkout_branch() { } checkout_commit() { - cd "$sourcedir/$name" + cd "$sourcedir/$name" || return 1 if [ "$commit" != "HEAD" ] then git checkout $commit @@ -483,7 +482,7 @@ checkout_commit() { get_repo_commit() { # prompt for what commit to use with HEAD as default - cd "$sourcedir/$name" + cd "$sourcedir/$name" || return 1 cat << EOM @@ -517,7 +516,7 @@ EOM } verify_layers() { - cd "$sourcedir" + cd "$sourcedir" || return 1 for l in $repo_layers do if [ ! -f "$sourcedir/$l/conf/layer.conf" ] @@ -555,7 +554,7 @@ select_layers() { return fi - cd "$sourcedir" + cd "$sourcedir" || return 1 # Get a count of how many layers there are count=$(find "$name" -name "layer.conf" | grep -c layer.conf) @@ -646,7 +645,7 @@ get_oecorelayerconf() { return fi - cd "$sourcedir" + cd "$sourcedir" || return 1 confs=$(find . -name "bblayers.conf.sample") done="n" @@ -701,7 +700,7 @@ get_oecorelocalconf() { return fi - cd "$sourcedir" + cd "$sourcedir" || return 1 confs=$(find . -name "local.conf.sample") done="n" @@ -970,9 +969,9 @@ mkdir -p "$oebase" # retrive the absolute path to the oebase directory incase # a relative path is passed in -cd "$oebase" +cd "$oebase" || exit 1 oebase=$(pwd) -cd - +cd - || exit 1 # Populate the following variables depending on the value of oebase sourcedir="$oebase/sources" @@ -1031,7 +1030,7 @@ config_oecorelocalconf if [ -n "$outputfile" ] then # make sure that the directory for the output file exists - cd "$oebase" + cd "$oebase" || exit 1 dir=$(dirname "$outputfile") if [ ! -d "$dir" ] then From patchwork Wed Jun 14 03:45:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25543 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21A74C001B3 for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by mx.groups.io with SMTP id smtpd.web11.3793.1686714319017862616 for ; Tue, 13 Jun 2023 20:45:19 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=YZud8ISi; spf=pass (domain: gmail.com, ip: 209.85.210.43, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-6b2f0a140b7so2360880a34.3 for ; Tue, 13 Jun 2023 20:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714318; x=1689306318; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L6RKq2rTCCKhsHsi6VHHO6fLVR5AWSgR0Cv4FkaqqeA=; b=YZud8ISiMTJoM34yNdyb7PDlEKt76m9Cs44gJs0bQ6ZsvPBlp/alFttafwRJ45mpEP YDJ+AthBJEIWqev3LKrmEAvaznCIE9mRW0MB2mCuwFWNr2pPF0AFVi9DBOc3cWCCTT+A qC3BGSIonVVpjyc+pyVQ4v24ObUqcTpineGjE6oVmbiAHQnJJm2bvTUm/+zKlIa9bqiQ SMKlvUi0KVevT+O4cKNpdM4TKAyLoP/A121sUaZj5URxxNmEQMLD3/Jx9ytABcAvGfSJ 1WWwjNyX53hoojaGx0A0Zgebcec2lFWZzAFamX1snbX8wAwlMgaPSJq1wAktwJhofJkP 7wJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714318; x=1689306318; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L6RKq2rTCCKhsHsi6VHHO6fLVR5AWSgR0Cv4FkaqqeA=; b=BvM4TxzEeaqF6erDzh0qLIRzWR1r39YVY/IgQwdt8cURSfB/USY8dhxDhB1dg3n1I3 1nHNqyZsJSnAQfpyYq5Z6ShXQmCKHw3uDVNTWZMMwWAExTTlAh+LMVE3wTX8eJrENO/I JYYD+KneGc/FkrVheK1UmvZscMzKsOBM0oRXaZiri5orAYgJfMkA3XH+kbDg7W0ZyYdL XZbV5AaBl7fiSSRYahefmuPxrRYdeJ8mjl3l0pMHOpM2U0ZzIrz+kMxDgdf3dBToaXxF YXhvfS7UJtXAkT5qQ65kCWlxvr65mkSuxxyf4NQEiKn5jw08QyiAQUVhWbI3LmFUzv5t pNLg== X-Gm-Message-State: AC+VfDyiu51UT3njo2vY4Hi5Nszvmwuf71cJYd8cXHEibrXpRO2KTmRh qGGnGeQ5pZ8giB+1p7ma+WQ= X-Google-Smtp-Source: ACHHUZ4FxumzUUAXYbGJcObXCZHLOTwZFLrtJynEDM3Pb1EGbmSup02TmKGYSoV9SS9QtiVJgEXrJQ== X-Received: by 2002:a05:6830:1188:b0:6a5:f786:d763 with SMTP id u8-20020a056830118800b006a5f786d763mr11392694otq.5.1686714318313; Tue, 13 Jun 2023 20:45:18 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:18 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 09/16] oe-layertool-setup: eliminate useless cat Date: Tue, 13 Jun 2023 22:45:00 -0500 Message-ID: <20230614034507.598391-10-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14614 Eliminate useless cat into grep. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index 6908fe2..b824114 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -803,7 +803,7 @@ EOM # Find if old DL_DIR was set if [ -e "$confdir/local.conf.bak" ] then - old_dldir=$(cat "$confdir/local.conf.bak" | grep -e "^DL_DIR =" | sed 's|DL_DIR = ||' | sed 's/"//g') + old_dldir=$(grep -e "^DL_DIR =" "$confdir/local.conf.bak" | sed 's|DL_DIR = ||' | sed 's/"//g') else old_dldir="$oebase/downloads" fi From patchwork Wed Jun 14 03:45:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25542 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04384EB64DC for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by mx.groups.io with SMTP id smtpd.web11.3794.1686714319609294502 for ; Tue, 13 Jun 2023 20:45:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kUG/WT+b; spf=pass (domain: gmail.com, ip: 209.85.210.53, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6b28eefb49cso3875847a34.0 for ; Tue, 13 Jun 2023 20:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714319; x=1689306319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tXYb+HiT5KMH/MULc1TKk1+9jPNEXBy7fwLlLnDmO60=; b=kUG/WT+bhPk/4uK8H2dY0wyFEcgz8HhoYpFPY17yaWSqrLBCYbugOVhLsf8hp85E0T QVDIFKzep6v2CVCqwICc7cy8OIrLYB6oM1qSUF401eL5NQVkqb0HknyOnM7sKssF9Ayq 0dmiiKcbCwVt6TVrxkdp38LWm34c8y0SkP/+G2BojzavXIGLya5BQt4qPYHcpt+cfZGw nRC5WPfk6BHMdSj+EJ8U2Bl1No25j6C1SMnEdL3rfF0gXqeKvNelCYavOzA574d5/axm I2yQtWkduPd7LBbgx/Za5BfDgxtVpcHUUh6GFadEh/KCKRHSqxo1Yg2rqs5Vy23nhq8z kUaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714319; x=1689306319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tXYb+HiT5KMH/MULc1TKk1+9jPNEXBy7fwLlLnDmO60=; b=kkGwp41rO+W5EOvsISPFXdtCyE6n3buZkky++c2rzzA02z5TBgihRsbjvs2fBq5EuE xP+lqHYGQaykCp3BE41Z16H4R9qDq51UeiDohAR5/XJCmCX5KSgyBw5msH3UHig6aIOV xRQBSXyFyiJ8pgihIvSKIqvSXt9bzZvfTWms3DBN7b3K/n/ZO1KL+w1RVXOGixMa75Bn O6GKpLJrLDqlUsvcUqhbrAPM6Tflc6SYkGE/HS6iKnPglsP2jyhjlGnGRS5yvjeAlHiX 5RqBiuZRdR2jJKA3dOv8+1QUrwsc3DL9G7mhMtFoBQM26XB4ph+tLmRbSv4R56mWP47c Rv4g== X-Gm-Message-State: AC+VfDzSSdjbrnUvYKbOLKpD/8fwUPus4HL+6mx0zLzdfHOMEKMPaZw+ P6r7+I9avOBzEd2bjbXsi4M= X-Google-Smtp-Source: ACHHUZ6ya4mTFLp+vB7VMua4bl6Vo1Odt7zgLfy5PbB5udma0gQ7cBEJYBOSBb0BfH3kRLsim7nzCA== X-Received: by 2002:a05:6830:11cd:b0:6af:9d30:4ba8 with SMTP id v13-20020a05683011cd00b006af9d304ba8mr11387339otq.26.1686714318917; Tue, 13 Jun 2023 20:45:18 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:18 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 10/16] oe-layertool-setup: use subshell execution with redirect Date: Tue, 13 Jun 2023 22:45:01 -0500 Message-ID: <20230614034507.598391-11-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:21 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14615 Shellcheck: Consider using { cmd1; cmd2; } >> file instead of individual redirects. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index b824114..8e29f9a 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -818,16 +818,18 @@ EOM if [ -e "$oebase/tmp_append_local.conf" ] then - echo "" >> "$confdir/local.conf" - echo "#====================================================================" >> "$confdir/local.conf" - echo "# LOCALCONF: settings from config file:" >> "$confdir/local.conf" - echo "# $inputfile" >> "$confdir/local.conf" - echo "#" >> "$confdir/local.conf" - echo "# Do not remove." >> "$confdir/local.conf" - echo "#--------------------------------------------------------------------" >> "$confdir/local.conf" - cat "$oebase/tmp_append_local.conf" >> "$confdir/local.conf" - echo "#====================================================================" >> "$confdir/local.conf" - echo "" >> "$confdir/local.conf" + { + echo ""; + echo "#===================================================================="; + echo "# LOCALCONF: settings from config file:"; + echo "# $inputfile"; + echo "#"; + echo "# Do not remove."; + echo "#--------------------------------------------------------------------"; + cat "$oebase/tmp_append_local.conf"; + echo "#===================================================================="; + echo ""; + } >> "$confdir/local.conf" rm "$oebase/tmp_append_local.conf" fi } From patchwork Wed Jun 14 03:45:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25546 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 228F2C3DA41 for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) by mx.groups.io with SMTP id smtpd.web10.3706.1686714320323256926 for ; Tue, 13 Jun 2023 20:45:20 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=hgg219tj; spf=pass (domain: gmail.com, ip: 209.85.210.47, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6b2c6238cf3so3403402a34.3 for ; Tue, 13 Jun 2023 20:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714319; x=1689306319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r1ar81No7R0tYh6SXtYtcr/HyVs/GUQFauT/xovrGsY=; b=hgg219tjWul6n30btYEOi2AdbyIZAnFLuc42VCgT+wZnFlZwn3qsGPtQf43zexBX0/ Egb9p1xWtCrGGCoXELJfOagffZGYFAItBuqjuT6E7fvU2c49IaYO/+opnVDEw7/gkd+1 IbXuN/i7KxAwvyTQB7i5/gfzLF7LC66h7BnFC7PTjlCCuuTE/bcMizRf2ACzWMsnibG7 Y862NFHckiGYQ0I3MGtMaxLQWkEreb8KVvhxqR/9i4dA0ammKyr9nwFzxvtLA/ixSX8Q 5eBqVi9f8OCTwmOEa+wrfyI+UuS4OzLj7Uqx/W6Xl303D9rQj0sAvcRYdNdqRX6tOh3S IBig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714319; x=1689306319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r1ar81No7R0tYh6SXtYtcr/HyVs/GUQFauT/xovrGsY=; b=ghQOc0FdE7rj2ism1ewPFjjIJWuJFprWiH8g2dlVhFVbuS+C2+DFOJv5msCHYhJQRh jBqqyzb9zPrNSxBjIyjb2vkf+xiVyERTlu67X72Y3ca9ztVgUE1nXvq9ZmQFIc/g7FjG e2KPEjgo1/c5Rg6CdG7rzKWE8axh+roec0u9P4M7n+mrE9vwa4aXXDlF+ntA3OaKha6a Ivz04ScgHUin9fynENHtgZ3CltLFsOMVYex8V5ZOst2DAUmd/K4BrWiAAE6gPnbiF9sB VN21Rayp56+eON/xtS4FFuEf9fOIG6EMnTfydLqg6eQDEnS0cn/467rZN923DnNrmzZ3 A5wg== X-Gm-Message-State: AC+VfDyWlYW1OWXSI70vkxAN3AqTL2S+KFgzA708z41l9rioSdZaiqTO C/XnDE0iL+WEDRxKkYzF4pE= X-Google-Smtp-Source: ACHHUZ5RPDAzD0IdJ4Gd25yFVGYbPpGwK6TnrTmbeOXMFukn0RX2HVOLlAeoAoCajwMLawA/jjseWQ== X-Received: by 2002:a05:6830:1d97:b0:6aa:ef9c:cb80 with SMTP id y23-20020a0568301d9700b006aaef9ccb80mr11802053oti.33.1686714319643; Tue, 13 Jun 2023 20:45:19 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:19 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 11/16] oe-layertool-setup: guard against invalid expression in case Date: Tue, 13 Jun 2023 22:45:02 -0500 Message-ID: <20230614034507.598391-12-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14616 Guard against and invalid expression in the main option case statement. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index 8e29f9a..e427393 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -962,7 +962,7 @@ do o ) outputfile="$OPTARG";; d ) dldir="$OPTARG";; b ) oebase="$OPTARG";; - h ) usage;; + * ) usage;; esac done From patchwork Wed Jun 14 03:45:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25540 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0028CEB64D8 for ; Wed, 14 Jun 2023 03:45:21 +0000 (UTC) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by mx.groups.io with SMTP id smtpd.web11.3795.1686714321071740665 for ; Tue, 13 Jun 2023 20:45:21 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=MDPBLtB+; spf=pass (domain: gmail.com, ip: 209.85.210.41, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6b2d356530eso3007243a34.0 for ; Tue, 13 Jun 2023 20:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714320; x=1689306320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=prCIqU9rSkVqSfvhS4+Jbe49K4Tv67iGHAFtukAworQ=; b=MDPBLtB+XtUbf/nXPDogJ57aMGk3C7uZIk2ZtDwivtBnKgHIHL2UPtJLTq+uJ9tGwR jslNG3vik6afWw9QPOL6I7vCAFtF5B9U0mp6AyXzIxC7GvzR2CwOlN4i63XzjBhkfWxR +t6oERF1zo6ZizqjUS2cvTJgAzHpqOsQ+Z3elvgd/8exCgl92dD2ISalWp+UfdE8W/Ew TWLd9Hp4hg0Mqz0QCQ9nDkUuTeyEQJbNpagz5oyothqhKr4kMvsA0MGk8SmZPxSxwLuB 4+QXKQy6Sh8syiS7WV305O/+c48/0kPZEBRAd8crXoz4PeE7B7XbgSuDtt/mzp4MGcQ+ 4Oaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714320; x=1689306320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=prCIqU9rSkVqSfvhS4+Jbe49K4Tv67iGHAFtukAworQ=; b=Cv70XwJCdNBdsizI/Hcb7KdaowfsK9imVFtsZQ6/1KbvcYLadFFtSG7p4MAay8670M EIszXUTNotLr4Hq6z6nhcZ12RWrJ5Si+gZzrBDa0MISQOTWTDc8s5+FmHGPKQr+oonko a00BeSNaE1Jd8Wwmivav807fdR5WJly5iGQEv2TNSAjg708W1Dd1Lla5h1sBId4A3jR3 kLNL/kr6+fjTa6y3KlLVAK2mw0ZA3YiqxRr2LiZZtpM4USqvYeRxYQWVNeNB0o8f7euL IG1/LhTyqIt3m7CFW6R0LJxCqUTGEycW/k/pKH215mf7YXYgv/tcLvytGKbxDqo1T8oe 9IvQ== X-Gm-Message-State: AC+VfDwwB1bf9w2gUylit/0j32kWVTVCpWs01q9Tj90VKjRE/SKz8781 SjXTNF7TXHsS3y1IOrGyPiE= X-Google-Smtp-Source: ACHHUZ6wQNhBJZC4OUmOKQG6poEXah5irnhx7yKNQav0Aw+WsIEfo11MK/kkYrPZ0UtuMfxgvs4gFg== X-Received: by 2002:a9d:6c1a:0:b0:6af:7856:5d55 with SMTP id f26-20020a9d6c1a000000b006af78565d55mr10054776otq.22.1686714320294; Tue, 13 Jun 2023 20:45:20 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:20 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 12/16] oe-layertool-setup: replace all calls to echo with printf Date: Tue, 13 Jun 2023 22:45:03 -0500 Message-ID: <20230614034507.598391-13-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:21 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14617 Replace all echo calls with `printf '%s\n'` since that handles arbitrary string input much more reliably. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 137 +++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 68 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index e427393..e0cfe4e 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -128,14 +128,14 @@ check_input() { # Check that at least -i or -f was used if [ "$interactive" = "n" ] && [ -z "$inputfile" ] then - echo "ERROR: You must either use this script with the -i or -f options" + printf '%s\n' "ERROR: You must either use this script with the -i or -f options" usage fi # If an input file was given make sure it exists if [ ! -f "$inputfile" ] then - echo "ERROR: the file \"$inputfile\" given for inputfile does not exist" + printf '%s\n' "ERROR: the file \"$inputfile\" given for inputfile does not exist" usage fi @@ -154,29 +154,29 @@ check_input() { # Input is a line of the form OECORE.*=value parse_oecore_line() { - var=$(echo "$1" | cut -d= -f1) - val=$(echo "$1" | cut -d= -f2) + var=$(printf '%s\n' "$1" | cut -d= -f1) + val=$(printf '%s\n' "$1" | cut -d= -f2) export "$var"="$val" } # Input is a line of the form BITBAKE.*=value parse_bitbake_line() { - var=$(echo "$1" | cut -d= -f1) - val=$(echo "$1" | cut -d= -f2) + var=$(printf '%s\n' "$1" | cut -d= -f1) + val=$(printf '%s\n' "$1" | cut -d= -f2) export "$var"="$val" } # Input is a line of the form LOCALCONF:.*=value parse_localconf_line() { - localconf=$(echo "$1" | cut -d: -f2-100) - echo "$localconf" >> "$oebase/tmp_append_local.conf" + localconf=$(printf '%s\n' "$1" | cut -d: -f2-100) + printf '%s\n' "$localconf" >> "$oebase/tmp_append_local.conf" } # Input is a line of the form MOTD: parse_motd_line() { - motd=$(echo "$1" | cut -d: -f2-100) - echo "$motd" >> "$oebase/tmp_motd" - echo "$motd" + motd=$(printf '%s\n' "$1" | cut -d: -f2-100) + printf '%s\n' "$motd" >> "$oebase/tmp_motd" + printf '%s\n' "$motd" } @@ -197,11 +197,11 @@ parse_repo_line() { # split the line on the comma separators # use the prefix if it was set. - export "${prefix}name"="$(echo "$1" | cut -d, -f1)" - export "${prefix}uri"="$(echo "$1" | cut -d, -f2)" - export "${prefix}branch"="$(echo "$1" | cut -d, -f3)" - export "${prefix}commit"="$(echo "$1" | cut -d, -f4)" - parsed_layers=$(echo "$1" | cut -d, -f5-) + export "${prefix}name"="$(printf '%s\n' "$1" | cut -d, -f1)" + export "${prefix}uri"="$(printf '%s\n' "$1" | cut -d, -f2)" + export "${prefix}branch"="$(printf '%s\n' "$1" | cut -d, -f3)" + export "${prefix}commit"="$(printf '%s\n' "$1" | cut -d, -f4)" + parsed_layers=$(printf '%s\n' "$1" | cut -d, -f5-) # If no layers= was used, then don't add any layers temp_layers="none" @@ -210,9 +210,10 @@ parse_repo_line() { if [ -n "$parsed_layers" ] then temp_layers="" - temp=$(echo "$parsed_layers" | cut -d= -f2) - # temporarily reset the IFS value to : to split the layers - for x in $(IFS=":"; echo "$temp") + temp=$(printf '%s\n' "$parsed_layers" | cut -d= -f2) + # use tr to split the layers since we assume layer names don't have + # whitespace characters later anyway + for x in $(printf '%s\n' "$temp" | tr ':' ' ') do # Add the $name value to each layer so that we have consistency # with how the layers are represented between the saved value @@ -262,13 +263,13 @@ parse_input_file() { fi # Skip comment lines - if echo "$line" | grep -q -e "^#" + if printf '%s\n' "$line" | grep -q -e "^#" then continue fi # If the line starts with OECORE then parse the OECORE setting - if echo "$line" | grep -q -e "^OECORE.*=" + if printf '%s\n' "$line" | grep -q -e "^OECORE.*=" then parse_oecore_line "$line" output="${output}${line}\n" @@ -276,7 +277,7 @@ parse_input_file() { fi # If the line starts with BITBAKE then parse the BITBAKE setting - if echo "$line" | grep -q -e "^BITBAKE.*=" + if printf '%s\n' "$line" | grep -q -e "^BITBAKE.*=" then parse_bitbake_line "$line" output="${output}${line}\n" @@ -284,7 +285,7 @@ parse_input_file() { fi # If the line starts with LOCALCONF: then parse the LOCALCONF: setting - if echo "$line" | grep -q -e "^LOCALCONF:.*" + if printf '%s\n' "$line" | grep -q -e "^LOCALCONF:.*" then parse_localconf_line "$line" output="${output}${line}\n" @@ -292,7 +293,7 @@ parse_input_file() { fi # If the line starts with MOTD: then parse the MOTD: setting - if echo "$line" | grep -q -e "^MOTD:.*" + if printf '%s\n' "$line" | grep -q -e "^MOTD:.*" then parse_motd_line "$line" continue @@ -335,9 +336,9 @@ configure_repo() { if [ -n "$temp" ] then - echo "This repository ($name) has already been configured with the following values:" + printf '%s\n' "This repository ($name) has already been configured with the following values:" printf '\t%s\n' "$temp" - echo "Skipping configuring duplicate repository" + printf '%s\n' "Skipping configuring duplicate repository" return 1 fi @@ -346,10 +347,10 @@ configure_repo() { get_repo_uri fi - echo "" - echo "" - echo "cloning repo $name" - echo "" + printf '%s\n' "" + printf '%s\n' "" + printf '%s\n' "cloning repo $name" + printf '%s\n' "" clone_repo @@ -392,7 +393,7 @@ clone_repo() { else if ! "$scriptdir/git_retry.sh" clone "$uri" "$sourcedir/$name" then - echo "ERROR: Could not clone repository at $uri" + printf '%s\n' "ERROR: Could not clone repository at $uri" exit 1 fi fi @@ -411,7 +412,7 @@ get_repo_branch() { t_branches=$(git branch -r | sed '/origin\/HEAD/d') for b in $t_branches do - branches="${branches}$(echo "$b" | sed 's:.*origin/::g')\n" + branches="${branches}$(printf '%s\n' "$b" | sed 's:.*origin/::g')\n" done branches=$(printf '%s\n' "$branches" | sort | uniq) @@ -440,7 +441,7 @@ EOM if [ "$found" != "1" ] then - echo "Invalid branch ($input) selected. Please try again" + printf '%s\n' "Invalid branch ($input) selected. Please try again" fi done branch=$input @@ -521,8 +522,8 @@ verify_layers() { do if [ ! -f "$sourcedir/$l/conf/layer.conf" ] then - echo "ERROR: the $l layer in the $name repository could not be" - echo " found. Bailing out." + printf '%s\n' "ERROR: the $l layer in the $name repository could not be" + printf '%s\n' " found. Bailing out." exit 1 fi done @@ -575,7 +576,7 @@ select_layers() { if [ "$arg1" != "all" ] then - echo "arg1 = $arg1" + printf '%s\n' "arg1 = $arg1" # Prompt for which layers to configure cat << EOM @@ -587,7 +588,7 @@ EOM for l in $t_layers do - printf '\t%s\n' "$(echo "$l" | sed "s:${name}\/::")" + printf '\t%s\n' "$(printf '%s\n' "$l" | sed "s:${name}\/::")" done cat << EOM @@ -639,7 +640,7 @@ get_oecorelayerconf() { if [ ! -e "$OECORELAYERCONFPATH" ] then - echo "ERROR: Could not find the specified layer conf file $OECORELAYERCONFPATH" + printf '%s\n' "ERROR: Could not find the specified layer conf file $OECORELAYERCONFPATH" fi return @@ -679,7 +680,7 @@ EOM OECORELAYERCONF=$input OECORELAYERCONFPATH=$sourcedir/$OECORELAYERCONF else - echo "ERROR: Could not find the specified layer conf file $input" + printf '%s\n' "ERROR: Could not find the specified layer conf file $input" fi done } @@ -693,7 +694,7 @@ get_oecorelocalconf() { if [ ! -e "$OECORELOCALCONFPATH" ] then - echo "ERROR: Could not find the specified local conf file $OECORELOCALCONFPATH" + printf '%s\n' "ERROR: Could not find the specified local conf file $OECORELOCALCONFPATH" exit 1 fi @@ -734,7 +735,7 @@ EOM OECORELOCALCONF=$input OECORELOCALCONFPATH=$sourcedir/$OECORELOCALCONF else - echo "ERROR: Could not find the inputted sample file: $input" + printf '%s\n' "ERROR: Could not find the inputted sample file: $input" exit 1 fi done @@ -769,7 +770,7 @@ EOM do printf '\t%s \\\n' "$l" >> "$confdir/bblayers.conf" done - echo "\"" >> "$confdir/bblayers.conf" + printf '%s\n' "\"" >> "$confdir/bblayers.conf" } @@ -792,8 +793,8 @@ EOM if [ -e "$confdir/local.conf" ] then - echo "WARNING: Found existing $confdir/local.conf" - echo "Saving a backup to $confdir/local.conf.bak" + printf '%s\n' "WARNING: Found existing $confdir/local.conf" + printf '%s\n' "Saving a backup to $confdir/local.conf.bak" cp -f "$confdir/local.conf" "$confdir/local.conf.bak" fi @@ -819,16 +820,16 @@ EOM if [ -e "$oebase/tmp_append_local.conf" ] then { - echo ""; - echo "#===================================================================="; - echo "# LOCALCONF: settings from config file:"; - echo "# $inputfile"; - echo "#"; - echo "# Do not remove."; - echo "#--------------------------------------------------------------------"; + printf '%s\n' ""; + printf '%s\n' "#===================================================================="; + printf '%s\n' "# LOCALCONF: settings from config file:"; + printf '%s\n' "# $inputfile"; + printf '%s\n' "#"; + printf '%s\n' "# Do not remove."; + printf '%s\n' "#--------------------------------------------------------------------"; cat "$oebase/tmp_append_local.conf"; - echo "#===================================================================="; - echo ""; + printf '%s\n' "#===================================================================="; + printf '%s\n' ""; } >> "$confdir/local.conf" rm "$oebase/tmp_append_local.conf" fi @@ -838,9 +839,9 @@ print_motd() { if [ -e "$oebase/tmp_motd" ] then - echo "" + printf '%s\n' "" cat "$oebase/tmp_motd" - echo "" + printf '%s\n' "" fi } @@ -854,7 +855,7 @@ print_image_names() { if [ "${FOLDER}" = "meta-arago" ]; then RECO="[recommended]" fi - echo "From ${FOLDER}${RECO}:" + printf '%s\n' "From ${FOLDER}${RECO}:" F_IMAGE_FOLDERS=$(find "${SOURCES}/${FOLDER}" -type d -a -iname images|grep recipes-core) for IMG_FOLDER in ${F_IMAGE_FOLDERS} do @@ -863,11 +864,11 @@ print_image_names() { for img in ${F_IMAGES} do name=$(basename "${img}"|sed 's/\.bb$//g') - summary=$(grep SUMMARY "${img}"|cut -d '=' -f2| sed 's/["/]//g'|xargs echo) + summary=$(grep SUMMARY "${img}"|cut -d '=' -f2| sed 's/["/]//g') if [ -z "${summary}" ]; then summary="No Summary available" fi - echo " ${name}: ${summary}" + printf '%s\n' " ${name}: ${summary}" done fi done @@ -927,9 +928,9 @@ export BUILDDIR="${builddir}" EOM if [ "$BITBAKE_INCLUSIVE_VARS" = "no" ]; then - echo "export BB_ENV_EXTRAWHITE=\"MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER OEBASE META_SDK_PATH TOOLCHAIN_TYPE TOOLCHAIN_BRAND TOOLCHAIN_BASE TOOLCHAIN_PATH TOOLCHAIN_PATH_ARMV5 TOOLCHAIN_PATH_ARMV7 TOOLCHAIN_PATH_ARMV8 EXTRA_TISDK_FILES TISDK_VERSION ARAGO_BRAND ARAGO_RT_ENABLE ARAGO_SYSTEST_ENABLE ARAGO_KERNEL_SUFFIX TI_SECURE_DEV_PKG_CAT TI_SECURE_DEV_PKG_AUTO TI_SECURE_DEV_PKG_K3 ARAGO_SYSVINIT SYSFW_FILE ARAGO_JAILHOUSE_ENABLE\"" >> "$confdir/setenv" + printf 'export %s="%s"\n' 'BB_ENV_EXTRAWHITE' 'MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER OEBASE META_SDK_PATH TOOLCHAIN_TYPE TOOLCHAIN_BRAND TOOLCHAIN_BASE TOOLCHAIN_PATH TOOLCHAIN_PATH_ARMV5 TOOLCHAIN_PATH_ARMV7 TOOLCHAIN_PATH_ARMV8 EXTRA_TISDK_FILES TISDK_VERSION ARAGO_BRAND ARAGO_RT_ENABLE ARAGO_SYSTEST_ENABLE ARAGO_KERNEL_SUFFIX TI_SECURE_DEV_PKG_CAT TI_SECURE_DEV_PKG_AUTO TI_SECURE_DEV_PKG_K3 ARAGO_SYSVINIT SYSFW_FILE ARAGO_JAILHOUSE_ENABLE' >> "$confdir/setenv" else - echo "export BB_ENV_PASSTHROUGH_ADDITIONS=\"MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER OEBASE META_SDK_PATH TOOLCHAIN_TYPE TOOLCHAIN_BRAND TOOLCHAIN_BASE TOOLCHAIN_PATH TOOLCHAIN_PATH_ARMV5 TOOLCHAIN_PATH_ARMV7 TOOLCHAIN_PATH_ARMV8 EXTRA_TISDK_FILES TISDK_VERSION ARAGO_BRAND ARAGO_RT_ENABLE ARAGO_SYSTEST_ENABLE ARAGO_KERNEL_SUFFIX TI_SECURE_DEV_PKG_CAT TI_SECURE_DEV_PKG_AUTO TI_SECURE_DEV_PKG_K3 ARAGO_SYSVINIT SYSFW_FILE ARAGO_JAILHOUSE_ENABLE\"" >> "$confdir/setenv" + printf 'export %s="%s"\n' 'BB_ENV_PASSTHROUGH_ADDITIONS' 'MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER OEBASE META_SDK_PATH TOOLCHAIN_TYPE TOOLCHAIN_BRAND TOOLCHAIN_BASE TOOLCHAIN_PATH TOOLCHAIN_PATH_ARMV5 TOOLCHAIN_PATH_ARMV7 TOOLCHAIN_PATH_ARMV8 EXTRA_TISDK_FILES TISDK_VERSION ARAGO_BRAND ARAGO_RT_ENABLE ARAGO_SYSTEST_ENABLE ARAGO_KERNEL_SUFFIX TI_SECURE_DEV_PKG_CAT TI_SECURE_DEV_PKG_AUTO TI_SECURE_DEV_PKG_K3 ARAGO_SYSVINIT SYSFW_FILE ARAGO_JAILHOUSE_ENABLE' >> "$confdir/setenv" fi } @@ -937,15 +938,15 @@ EOM build_repo_line() { # clean up the layers to remove the repository name and add : divider temp_layers="" - for l in $(echo "$repo_layers" | sed "s:${name}::" | sed -e 's:^\/::') + for l in $(printf '%s\n' "$repo_layers" | sed "s:${name}::" | sed -e 's:^\/::') do - temp_layers="${temp_layers}$(echo "$l" | sed "s:${name}\/::"):" + temp_layers="${temp_layers}$(printf '%s\n' "$l" | sed "s:${name}\/::"):" done # Lastly clean off any trailing : - temp_layers=$(echo "$temp_layers" | sed 's/:$//') + temp_layers=$(printf '%s\n' "$temp_layers" | sed 's/:$//') - echo "$name,$uri,$branch,$commit,layers=$temp_layers" + printf '%s\n' "$name,$uri,$branch,$commit,layers=$temp_layers" } ############### @@ -1016,9 +1017,9 @@ then save_layers - echo "" - echo "" - echo "Would you like to configure another repository? [y/n] " + printf '%s\n' "" + printf '%s\n' "" + printf '%s\n' "Would you like to configure another repository? [y/n] " read -r cont done fi @@ -1039,7 +1040,7 @@ then mkdir -p "$dir" fi printf '%s\n' "$output" > "$outputfile" - echo "Output file is $outputfile" + printf '%s\n' "Output file is $outputfile" fi create_setenv_file From patchwork Wed Jun 14 03:45:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25550 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F630C001DF for ; Wed, 14 Jun 2023 03:45:22 +0000 (UTC) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) by mx.groups.io with SMTP id smtpd.web11.3796.1686714321626332068 for ; Tue, 13 Jun 2023 20:45:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=cQJXU2cM; spf=pass (domain: gmail.com, ip: 209.85.210.52, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6b29c972e00so3568708a34.1 for ; Tue, 13 Jun 2023 20:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714321; x=1689306321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z5qMJwAnyUijMjp9M/jvElIGghdIqf4zPUMk5TBI3V0=; b=cQJXU2cM9SqiIqa6iU3dvRP3cxajmdtwijYZnmE8utaZNdXvr7K51nSSxNrcjxxa3H RfZK9X+P5ka/IoX+OGOEO4ZmP68RCZaqm9tTFgkyiNZFrlMNY+osOOlK1ud0iV+39UQW diS18rAxpN4Nvk0mryr07RUsSDUK5+EanPdU/+QM8mRt+hQmF7wz50xnsvVOYor7vSJj mymu9q2Z72GuTpy3dHQcusaXX6R+UL87gTvtCJwKP21TmS1Yb+1Km7MfILxEju0UBZAF fdeBG3Voh+mgulsxzsSDXUz9F5flzvwlKz35cz5skLwGQeitbO1SoH2LimzYDwO8kIXI /XAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714321; x=1689306321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z5qMJwAnyUijMjp9M/jvElIGghdIqf4zPUMk5TBI3V0=; b=c6k5WEhiVeo8YH6/4JuX7LSV1wPSWnjiixGencsewvG3xJA60VVZZdrvFH+VpItt87 HMwRafsG8RKe9z6pmPeP0uuSUnOQnz4faep+x0nbXplrMXEADhXLgcqbEaLDDkugpC2K BVcFNRRG5Y9TFSjOscx57z93rs7r6k5XamGg8HywE/IHLhIiuM27TB0tIiJEx0z7XVBv gqtXUXdb6wVOfB+fokG0UsT95/4YuTH/HK+9m87141JmTCV7XprTsItxhCVVIq5hNN2n q4M0LuHzNz+nXOQFtUuKJkH9LE33zZNIqlnyxTXZDXLAHAW3XxerZap1kfvU1p4PCh2N Vq5Q== X-Gm-Message-State: AC+VfDzlJnSdRo5mEAO2lsnHm9yslOS9+nYTCj4ifiecYIaMoQ/SEN8O 3XTDf3ndSnDFXX+1KRJQYRI= X-Google-Smtp-Source: ACHHUZ4xSiF6uApYk5dnTNv3p4xojmpmNOUHGHYEXSuwINB9zukmpB3YPYy8ExV2NvdFdV2cqibh8A== X-Received: by 2002:a05:6830:164c:b0:6b2:8ee8:b9ea with SMTP id h12-20020a056830164c00b006b28ee8b9eamr12621530otr.23.1686714320958; Tue, 13 Jun 2023 20:45:20 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:20 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 13/16] oe-layertool-setup: drop unused variable Date: Tue, 13 Jun 2023 22:45:04 -0500 Message-ID: <20230614034507.598391-14-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:22 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14618 Drop the unused IMAGES variable. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index e0cfe4e..0928959 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -848,7 +848,6 @@ print_motd() { print_image_names() { SOURCES="${1}" FOLDERS=$(find "${SOURCES}" -type d -a -iname images|grep recipes-core|sed -e "s/.*sources\///g"|cut -d '/' -f1|sort -u -r) - IMAGES="" for FOLDER in ${FOLDERS} do RECO="" From patchwork Wed Jun 14 03:45:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25554 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36A84EB64DB for ; Wed, 14 Jun 2023 03:45:32 +0000 (UTC) Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) by mx.groups.io with SMTP id smtpd.web10.3707.1686714322247108423 for ; Tue, 13 Jun 2023 20:45:22 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=sOLD0et4; spf=pass (domain: gmail.com, ip: 209.85.160.46, mailfrom: res.sapp@gmail.com) Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-19f8af9aa34so4693853fac.1 for ; Tue, 13 Jun 2023 20:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714321; x=1689306321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+4tuzckN3P03Etlf3mrUflxPh46O9g0AU8cSAKuDnIM=; b=sOLD0et4Ivt77mjLAQ1h9EJ01KhZn3NyQE+X3DD7asCusAOZjZQXPC7j/AXCgbBRwC cYlFeZ1oWuC3LBjtorDUTFQiT8Kl+RSxDPjH3m+x4Y8vX1BwC/yz/8TFoNwUhiQ3L2Iq XYbvaJpKLr5oMHWxajWWVPZf6k/huX3dbj+gGXUcKRYUZqVybcrbGSjYkv2nhUJJfY/s ArUunJ1X8u7lMY4yP8psA60x5pGKXocDN1NuE5YV02CnJu7OCsNKwdTlUhGtaOQuIqPJ IsKfshysAHiJ0gP1J43sqoKhaPQb9PYet5zSwHMiU0ABQKamHiyJCKK41EvqxqcOuV/Z Bt8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714321; x=1689306321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+4tuzckN3P03Etlf3mrUflxPh46O9g0AU8cSAKuDnIM=; b=Dl7D+QBG9whwL6sBQQ6RAdok5c1cOUFcg8UYD9obIHJrikPA0lW+UtdiHmoxHIto7d I//DubxY5gHSzU0rFHxi1TIu7P51FgXtekHZR24f7oHL0Pj29JNzwJJR0NfbGuB8NvZI W2mPvDl1vjDXacTpRAiS2/uGHg3fhqQ6gR2kg/fgWFPWV3dl1wYXXr1yVvyvoq6nr+Ou TsIQ++TAqoRx5RVxF6kvJ2c9K/8NFt/t2QLfvMoZfD4tgce8+85Jt18q8BedYG+zrBb9 7aR6QgPd4wt3y8z/nWNa7YmIGefyxSvYV/VIEs9OvNYKm/6qswp1d/U2PYz1v4DEGQyj yTHw== X-Gm-Message-State: AC+VfDy1l9dWSh125Wyr31+cg4y3RQqJCBKFL6K0MUwAJKOAj7mbmAgg AsTVpIEKGKAQjRBleP+8WJFuIhJh56oJ4Gp+ X-Google-Smtp-Source: ACHHUZ7hc6PyK/QQlN67JB+af22Ci3I9nE4gkHQhD0+7P09Wx16ceMLTVWnvU2kGP3ZUpV8MykdMCw== X-Received: by 2002:a05:6871:6a9a:b0:1a6:a5ac:6c7 with SMTP id zf26-20020a0568716a9a00b001a6a5ac06c7mr5075670oab.53.1686714321561; Tue, 13 Jun 2023 20:45:21 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:21 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 14/16] oe-layertool-setup: add a path sanity check for oebase Date: Tue, 13 Jun 2023 22:45:05 -0500 Message-ID: <20230614034507.598391-15-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:32 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14619 OEBase can not have a space in it's name due to parsing limitations of POSIX shell. Make sure to check this before doing anything. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index 0928959..8694abd 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -966,6 +966,14 @@ do esac done +# add early sanity check +if printf '%s\n' "$oebase" | grep -q '\s' +then + printf '%s\n' "OE-Base path has whitespace characters in it's path!" \ + "This is currently unsupported." ; + exit 1 +fi + # create passed in directory if it doesn't exist mkdir -p "$oebase" From patchwork Wed Jun 14 03:45:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25553 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3766FEB64DC for ; Wed, 14 Jun 2023 03:45:32 +0000 (UTC) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by mx.groups.io with SMTP id smtpd.web11.3797.1686714322940308039 for ; Tue, 13 Jun 2023 20:45:23 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=nQ5SorTU; spf=pass (domain: gmail.com, ip: 209.85.210.43, mailfrom: res.sapp@gmail.com) Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-6b162127472so3969990a34.0 for ; Tue, 13 Jun 2023 20:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714322; x=1689306322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/5rBXB1yLLKdybwna0F9rG87e6Jw6qyz/t3It+toXjs=; b=nQ5SorTUSTXH0DOaQ12CdMODZ8tiUPHJwXETjP7TcMkw+My6O1lFGs7QGquvLZ/lSQ hBzsSuNPXwe8e31iYKfXllhbOLiOSkzdQT/fDRPeY8fUP8X4AyiKR/IPbJGve/ocU7Cd WEszfgZ5AcL6Ajt35B/JzrCAN2NZyvaXbFsHY3hHba/VDOnl8QxrZm9CJiyweJh6Z71T g6+5/AXLQfXZ0mShujB56GD9/YM0L6z0ANid+0Jr/ojKagfigelEnGBwuZxKJY9mlRMl MiVovBkjO14/KyAIX02wONvLmQMOlTmg37oJnUbshWL6UKRIUCViWcHC2U21cQJOUTQ5 lI7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714322; x=1689306322; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/5rBXB1yLLKdybwna0F9rG87e6Jw6qyz/t3It+toXjs=; b=WTQU7bCvQolL+vUsiagwEefeu8762sacxA21bM/9XQKuvr+MqSJfU114MIRb5T5UMM Pu+hk3DNsIS5ObBemngT0w8/xXwXId8Jue0vkhnYjoxfGtnvFXmHOqSZ8C7cRv49uoH7 Zx2YA5TGCk9CEq0HRgOXVI2C13HX3uUP9a+PGrtQRCWJPm80nR6+In/o0GwtH96X3xnH 6gQqU9mpUXVyqZRlEM7I4MahDlYVJ7YYBAp9jKbakSLSJ5fVlSXD+/zebdBpMWc8y4eb x3svvj2CePzHDT/EFlVpUb6DszK52G7ELFcXZbYUHejZUKD9mzOzjdX2ToDdNP0jG0YU ULfA== X-Gm-Message-State: AC+VfDxETW0LgfdFcM7xfn0YD83QAbDpa3n7jpaUqr5g0zRRsM/uU9IU xje6JLaizPV0uDWftO35GwE= X-Google-Smtp-Source: ACHHUZ6PamdlNOZA5df1FQ0TlgBhM9ebbvpWO/7MkU8Ej6yod/gLnIL31ufW6MCnOFemp2yFokRTkQ== X-Received: by 2002:a9d:6a92:0:b0:6ab:ce:6eac with SMTP id l18-20020a9d6a92000000b006ab00ce6eacmr11211620otq.20.1686714322277; Tue, 13 Jun 2023 20:45:22 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:21 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 15/16] oe-layertool-setup: fix multi-line printfs Date: Tue, 13 Jun 2023 22:45:06 -0500 Message-ID: <20230614034507.598391-16-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:32 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14620 Replace multiple printf calls with one call and a good format. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index 8694abd..2b05550 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -347,10 +347,10 @@ configure_repo() { get_repo_uri fi - printf '%s\n' "" - printf '%s\n' "" - printf '%s\n' "cloning repo $name" - printf '%s\n' "" + printf '%s\n' "" \ + "" \ + "cloning repo $name" \ + "" ; clone_repo @@ -522,8 +522,8 @@ verify_layers() { do if [ ! -f "$sourcedir/$l/conf/layer.conf" ] then - printf '%s\n' "ERROR: the $l layer in the $name repository could not be" - printf '%s\n' " found. Bailing out." + printf '%s\n' "ERROR: the $l layer in the $name repository could not be" \ + " found. Bailing out." ; exit 1 fi done @@ -793,8 +793,8 @@ EOM if [ -e "$confdir/local.conf" ] then - printf '%s\n' "WARNING: Found existing $confdir/local.conf" - printf '%s\n' "Saving a backup to $confdir/local.conf.bak" + printf '%s\n' "WARNING: Found existing $confdir/local.conf" \ + "Saving a backup to $confdir/local.conf.bak"; cp -f "$confdir/local.conf" "$confdir/local.conf.bak" fi @@ -820,16 +820,16 @@ EOM if [ -e "$oebase/tmp_append_local.conf" ] then { - printf '%s\n' ""; - printf '%s\n' "#===================================================================="; - printf '%s\n' "# LOCALCONF: settings from config file:"; - printf '%s\n' "# $inputfile"; - printf '%s\n' "#"; - printf '%s\n' "# Do not remove."; - printf '%s\n' "#--------------------------------------------------------------------"; + printf '%s\n' "" \ + "#====================================================================" \ + "# LOCALCONF: settings from config file:" \ + "# $inputfile" \ + "#" \ + "# Do not remove." \ + "#--------------------------------------------------------------------" ; cat "$oebase/tmp_append_local.conf"; - printf '%s\n' "#===================================================================="; - printf '%s\n' ""; + printf '%s\n' "#====================================================================" \ + "" ; } >> "$confdir/local.conf" rm "$oebase/tmp_append_local.conf" fi @@ -1024,9 +1024,9 @@ then save_layers - printf '%s\n' "" - printf '%s\n' "" - printf '%s\n' "Would you like to configure another repository? [y/n] " + printf '%s\n' "" \ + "" ; + printf '%s' "Would you like to configure another repository? [y/n] " read -r cont done fi From patchwork Wed Jun 14 03:45:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Res Sapp X-Patchwork-Id: 25552 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32F28EB64D8 for ; Wed, 14 Jun 2023 03:45:32 +0000 (UTC) Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) by mx.groups.io with SMTP id smtpd.web11.3799.1686714323611521293 for ; Tue, 13 Jun 2023 20:45:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20221208 header.b=DcFnA74v; spf=pass (domain: gmail.com, ip: 209.85.161.41, mailfrom: res.sapp@gmail.com) Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-55b619e0ed1so228753eaf.3 for ; Tue, 13 Jun 2023 20:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686714323; x=1689306323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Szb/fNuCkckT1a0XEXrN6vyHjFPnYIlFaWgxgd81Itc=; b=DcFnA74vvG7ZGyKuqggEZEr8U6znBhpxp47uA/gllt/r6a/z2uysg3cwgcBY1A7M5u KNtQ1ck1a/q+q1tuT7gMTdlQd2LlQF46vnJlLTf2MHuBr5PPf3XkU4y5a57WmbiXxG5B ahiL2zgsMcXmqNB1klyJJ7VycmBqEFb+5i9YF4O8jziQdUaFcdaTBCuRVL4SqY1xZUxv g54myHN77z6WUH08lbvD65VobnRi7NDRPxtPZObSPGlOoBO9SDMU9n3i46M7Ur8o7RoV IAuW6OUymRQx7pxDKKwyv5Qm+3hWhisBPCtWCe3QhHbfZEzJGQLbAJppZljlvGT3937L sTFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686714323; x=1689306323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Szb/fNuCkckT1a0XEXrN6vyHjFPnYIlFaWgxgd81Itc=; b=Fi9OcD710yFy32V8xn2XizaEfoQ7MaZ+H0LNXWmiQwyHnGxrDBxxqNh3XvLcezgyUt /539Lt0JtHg7ftyoFbPM/rTIHaWqcrpec/O3KuABfa6mRdmw7f2pdR3MCy9VLVUP6GWX sgrKLpgqfrwzhwDre4BP/pD77TOBn9/7OZcwgqsP9+TYhHNoEtaVlgs8ljjFf9rWV8ul 3YgwZLP5OkG8VaEpSZ/IV9D2lBnSpNDgfA+YRiUkayqN2r8dfVeG6uuTo/vwOaLSsZEk gs4peO7/RevOcKpqpuioHebhsneH2JJuW2lxBTqOtm6kpJBZ2bX8RKrJ3a/9ORZMzI9H KwQw== X-Gm-Message-State: AC+VfDw4iMJ0AjF4azGYfATUgjjm1IOILE+Vc0wzGTUaG3c5F0afQ9IW gERDNzwQGXNj/+ck26VyuUM= X-Google-Smtp-Source: ACHHUZ6tXth/tECiI53D74HsrUm3PuzgE09f9tWy5SG47riO12c2oWVgc75im2fPRToHqGRxnFDNpA== X-Received: by 2002:a4a:e1d6:0:b0:55b:8573:b339 with SMTP id n22-20020a4ae1d6000000b0055b8573b339mr6296884oot.4.1686714322952; Tue, 13 Jun 2023 20:45:22 -0700 (PDT) Received: from rig.lan ([104.182.101.14]) by smtp.gmail.com with ESMTPSA id s9-20020a9d7589000000b006a662e9f074sm5367538otk.58.2023.06.13.20.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 20:45:22 -0700 (PDT) From: Randolph Sapp To: denis@denix.org, reatmon@ti.com, afd@ti.com, nm@ti.com, rs@ti.com Cc: meta-arago@lists.yoctoproject.org, Randolph Sapp Subject: [oe-layersetup][PATCHv2 16/16] oe-layertool-setup: add sanity check for layer names Date: Tue, 13 Jun 2023 22:45:07 -0500 Message-ID: <20230614034507.598391-17-res.sapp@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230614034507.598391-1-res.sapp@gmail.com> References: <20230614034507.598391-1-res.sapp@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 14 Jun 2023 03:45:32 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14621 Due to POSIX shell string parsing limitations we currently can't parse layer names with spaces. Display an error message and bail out when detected. Signed-off-by: Randolph Sapp --- oe-layertool-setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh index 2b05550..16b7844 100755 --- a/oe-layertool-setup.sh +++ b/oe-layertool-setup.sh @@ -211,6 +211,13 @@ parse_repo_line() { then temp_layers="" temp=$(printf '%s\n' "$parsed_layers" | cut -d= -f2) + # sanity check for whitespace in layer names string + if printf '%s\n' "$temp" | grep -q '\s' + then + printf '%s\n' "Whitespace character detected in layer names string!" \ + "This is currently unsupported." ; + exit 1 + fi # use tr to split the layers since we assume layer names don't have # whitespace characters later anyway for x in $(printf '%s\n' "$temp" | tr ':' ' ')