Re: lzip support in busybox?

2021-08-24 Thread Kang-Che Sung
On Wed, Aug 25, 2021 at 1:32 AM Jacob Burkholder
 wrote:
>
> In 2012 a patch was submitted to the list about lzip support in busybox, 
> there was not much discussion about it.  I've been using the patch for some 
> years and keep porting it to new versions of busybox, just now 1.33.1.  I use 
> a busybox based linux distribution as a build environment and the patch is 
> useful as more projects distribute their source distribution as .tar.lz.  Any 
> chance to get the latest patch committed?  I can submit the patch applied to 
> busybox 1.33.1 or 1.34.0.

If I remember correctly, the original lzip patch uses a separate LZMA
decompression code, which duplicates a lot of what xz (LZMA2)
decompression would do.
It would be better if lzip and xz share code as much as possible. It
would be bad to maintain two versions of the code for algorithms that
are mostly the same.
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] shell script error management in ash (set of 6 patches)

2021-08-24 Thread Harald van Dijk

On 24/08/2021 11:10, Roberto A. Foglietta wrote:

Thanks again for your insightfulness.

I reverted back to the previous situation when I was resetting the 
recursive flag when the evaltree returns:


  - if evaltree returns: no problem
  - before an not-exit not-returning exception is raised, it sets an 
handler that makes it returning


  Moreover, I used static variables to save the previous state in such a 
way I am able to set back again in case my handler takes off.
  I have updated the testsuite and moved the test9.sh in testD.sh plus 
testD.sh makes the check of the last case you arise to my attention.


  The full patch is here:

https://github.com/robang74/tinycore-editor/tree/main/busybox/patches 


  busybox-1.33.1-error-management-extension-for-ash-v017.patch


I had trouble applying the patch you attached, so I reset everything and 
restarted from that full patch. I'm getting:


  shell/ash.c: In function ‘evalfun’:
  shell/ash.c:9910:16: warning: variable ‘evaldone’ set but not used 
[-Wunused-but-set-variable]

   9910 | int e, evaldone = 0;
|^~~~

That looks like a correct warning, evaldone is never read, only assigned to.

As for the handling of errors, you are now catching EXERROR and not 
propagating the error. That does not look right. However, when trying to 
create a testcase for that, I stumbled upon a more fundamental problem:


  f() {
trap "echo ERR" ERR
false
  }
  f

This is supposed to print ERR. You've implemented set +E (the default 
mode) as forcibly disabling ERR handlers inside functions, but that's 
not what it's supposed to do, nor what it's documented as doing in bash. 
What it's supposed to do is only to prevent outer ERR handlers from 
being inherited, it's not supposed to prevent ERR handlers defined 
within the function from taking effect.

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


lzip support in busybox?

2021-08-24 Thread Jacob Burkholder
In 2012 a patch was submitted to the list about lzip support in busybox,
there was not much discussion about it.  I've been using the patch for some
years and keep porting it to new versions of busybox, just now 1.33.1.  I
use a busybox based linux distribution as a build environment and the patch
is useful as more projects distribute their source distribution as
.tar.lz.  Any chance to get the latest patch committed?  I can submit the
patch applied to busybox 1.33.1 or 1.34.0.
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] shell script error management in ash (set of 6 patches)

2021-08-24 Thread Roberto A. Foglietta
Il giorno mar 24 ago 2021 alle ore 00:00 Harald van Dijk 
ha scritto:

> On 23/08/2021 11:50, Roberto A. Foglietta wrote:
> > Il giorno lun 23 ago 2021 alle ore 11:15 Harald van Dijk
> > mailto:har...@gigawatt.nl>> ha scritto:
> >
> > On 23/08/2021 10:09, Roberto A. Foglietta wrote:
> >  > Il giorno lun 23 ago 2021 alle ore 10:45 Harald van Dijk
> >  > mailto:har...@gigawatt.nl>
> > >> ha scritto:
> >  >
> >  > On 23/08/2021 09:16, Roberto A. Foglietta wrote:
> >
> >  >   I did the same.
> >
> > You changed command eval false to false, but the 'command' builtin
> was
> > the key element there, that is what made the syntax error non-fatal.
> > 'command eval false' is not the same thing as simply 'false' (at
> least
> > not in busybox ash).
> >
> >
> > Hi Harald, thanks to your deep knowledge of the shell we finally reached
> > the point!
> >
> > The attached patch solves two questions/issues:
> >
> >   - not exit exceptions disables trap ERR (solved)
> >   - not exit exceptions might do memory leak (not the case, verified)
>
> Sorry, but this approach cannot work. The fact that an exception was
> raised and handled does not tell you where it was handled, it does not
> tell you whether the handler is still active.
>
> Consider:
>
>trap '
>command eval ")"
>false
>' ERR
>false
>echo done
>

Thanks again for your insightfulness.

I reverted back to the previous situation when I was resetting the
recursive flag when the evaltree returns:

 - if evaltree returns: no problem
 - before an not-exit not-returning exception is raised, it sets an handler
that makes it returning

 Moreover, I used static variables to save the previous state in such a way
I am able to set back again in case my handler takes off.
 I have updated the testsuite and moved the test9.sh in testD.sh plus
testD.sh makes the check of the last case you arise to my attention.

 The full patch is here:

 https://github.com/robang74/tinycore-editor/tree/main/busybox/patches
 busybox-1.33.1-error-management-extension-for-ash-v017.patch

 Best regards,
-- 
Roberto A. Foglietta
+39.349.33.30.697


busybox-1.33.1-not-returning-handlers-return-by-handler.patch
Description: Binary data


testsuite.tgz
Description: application/compressed
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox