On Fri, May 09, 2025 at 08:24:33AM -0700, Andrew Hewus Fresh wrote:
> On Fri, May 09, 2025 at 08:12:02AM +0000, Lucas Gabriel Vuotto wrote:
> > On Thu, May 08, 2025 at 05:29:24PM -0700, Andrew Hewus Fresh wrote:
> > > It's pretty easy to fix fw_update.
> > > Apparently was not thinking when I wrote it.
> > >
> > > Comments, OK?
> >
> > In principle this is OK lucas, but I do have comments.
> >
> > > Index: fw_update.sh
> <SNIP>
> > > - while read -r _c _g; do
> > > - case $_c in
> > > - @cwd) _cwd="${DESTDIR}$_g"
> > > + while read -r _l; do
> > > + case ${_l%% *} in
> > > + @cwd) _cwd="${DESTDIR}${_l#* }"
> > > ;;
> > > @*) continue
> > > ;;
> > > - *) set -A _remove -- "$_cwd/$_c" "${_remove[@]}"
> > > + *) set -A _remove -- "$_cwd/$_l" "${_remove[@]}"
> >
> > Doesn't only the following take care of it? And saves you from parsing
> > the line manually. In which case, you might also want to keep the chunk
> > that adds _remove, _c and _g to local.
> >
> > + *) set -A _remove -- "$_cwd/$_g" "${_remove[@]}"
>
> You will have to better explain why attempting to remove the part of the
> filename after the first space will be more effective than failing to
> remove the part of the filename before the first space.
I got deeply confused while reading it this morning, that's why. I kept
reading it as if the `set -A` was in the same case as @cwd. Works on my
head(tm)?
Reading it again, I still OK this. The whitespace handling is fine.