> -----Original Message-----
> From: [email protected] 
> <[email protected]> On Behalf Of Mike Looijmans
> Sent: den 13 april 2022 11:52
> To: [email protected]
> Subject: Re: [OE-core] [PATCH] "bitbake-prserv-tool: Added quotes to 
> variables to prevent splitting and gobbling"

There shouldn't be quotes in the subject above. No idea how you 
managed to get them there...

Also, "gobbling" is not a word, AFAIK. Did you mean "globbing"?

> 
> See comment below (our mail server injects signatures, sorry for that)
> 
> 
> Met vriendelijke groet / kind regards,
> 
> Mike Looijmans
> System Expert
> 
> 
> TOPIC Embedded Products B.V.
> Materiaalweg 4, 5681 RJ Best
> The Netherlands
> 
> T: +31 (0) 499 33 69 69
> E: [email protected]
> W: www.topic.nl
> 
> Please consider the environment before printing this e-mail
> On 13-04-2022 11:35, Abongwa Amahnui Bonalais via lists.openembedded.org 
> wrote:
> > Signed-off-by: Abongwa Bonalais Amahnui <[email protected]>
> > ---
> >   scripts/bitbake-prserv-tool | 22 +++++++++++-----------
> >   1 file changed, 11 insertions(+), 11 deletions(-)
> >
> > diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool
> > index e55d98c72e..68caa9fb66 100755
> > --- a/scripts/bitbake-prserv-tool
> > +++ b/scripts/bitbake-prserv-tool
> > @@ -5,7 +5,7 @@
> >
> >   help ()
> >   {
> > -    base=`basename $0`
> > +    base=`basename "$0"`
> >       echo -e "Usage: $base command"
> >       echo "Avaliable commands:"
> >       echo -e "\texport <file.conf>: export and lock down the AUTOPR values 
> > from the PR service into a file for release."
> > @@ -16,7 +16,7 @@ clean_cache()
> >   {
> >       s=`bitbake -e | grep ^CACHE= | cut -f2 -d\"`
> >       if [ "x${s}" != "x" ]; then
> > -        rm -rf ${s}
> > +        rm -rf "${s}"
> >       fi
> >   }
> >
> > @@ -24,14 +24,14 @@ do_export ()
> >   {
> >       file=$1
> 
> You'd want to quote this one too I think.

Actually, as inconsistent as it may seem, quotes are _not_ needed above.

> 
> >       [ "x${file}" == "x" ] && help && exit 1
> > -    rm -f ${file}
> > +    rm -f "${file}"
> >
> >       clean_cache
> >       bitbake -R conf/prexport.conf -p
> >       s=`bitbake -R conf/prexport.conf -e | grep ^PRSERV_DUMPFILE= | cut 
> > -f2 -d\"`
> >       if [ "x${s}" != "x" ];
> >       then
> > -       [ -e $s ] && mv -f $s $file && echo "Exporting to file $file 
> > succeeded!"
> > +       [ -e "$s" ] && mv -f "$s" "$file" && echo "Exporting to file $file 
> > succeeded!"
> >          return 0
> >       fi
> >       echo "Exporting to file $file failed!"
> > @@ -44,7 +44,7 @@ do_import ()
> >       [ "x${file}" == "x" ] && help && exit 1
> >
> >       clean_cache
> > -    bitbake -R conf/primport.conf -R $file -p
> > +    bitbake -R conf/primport.conf -R "$file" -p
> >       ret=$?
> >       [ $ret -eq 0 ] && echo "Importing from file $file succeeded!" || echo 
> > "Importing from file $file failed!"
> >       return $ret
> > @@ -60,13 +60,13 @@ do_migrate_localcount ()
> >           return 1
> >       fi
> >
> > -    rm -rf $df
> > +    rm -rf "$df"
> >       clean_cache
> >       echo "Exporting LOCALCOUNT to AUTOINCs..."
> >       bitbake -R conf/migrate_localcount.conf -p
> >       [ ! $? -eq 0 ] && echo "Exporting to file $df failed!" && exit 1
> >
> > -    if [ -e $df ];
> > +    if [ -e "$df" ];
> >       then
> >           echo "Exporting to file $df succeeded!"
> >       else
> > @@ -75,7 +75,7 @@ do_migrate_localcount ()
> >       fi
> >
> >       echo "Importing generated AUTOINC entries..."
> > -    [ -e $df ] && do_import $df
> > +    [ -e "$df" ] && do_import "$df"
> >
> >       if [ ! $? -eq 0 ]
> >       then
> > @@ -93,17 +93,17 @@ case $2 in
> >   *.conf|*.inc)
> >       ;;
> >   *)
> > -    echo ERROR: $2 must end with .conf or .inc!
> > +    echo ERROR: "$2" must end with .conf or .inc!

The quote above is strictly not needed as the output from echo 
will be the same regardless if there are spaces in $2 or not. 
However, if you really want to quote that line, a more natural 
way would be:

    echo "ERROR: $2 must end with .conf or .inc!"

> >       exit 1
> >       ;;
> >   esac
> >
> >   case $1 in
> >   export)
> > -    do_export $2
> > +    do_export "$2"
> >       ;;
> >   import)
> > -    do_import $2
> > +    do_import "$2"
> >       ;;
> >   migrate_localcount)
> >       do_migrate_localcount

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164315): 
https://lists.openembedded.org/g/openembedded-core/message/164315
Mute This Topic: https://lists.openembedded.org/mt/90437025/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to