mailing list of musl libc
 help / color / mirror / code / Atom feed
* Unusual behavior with bash subshell and getopt
@ 2014-10-02 20:14 Anthony G. Basile
  2014-10-02 20:36 ` Felix Janda
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony G. Basile @ 2014-10-02 20:14 UTC (permalink / raw)
  To: musl

Hi everyone,

Today I finally got around to debugging why xsltproc was failing in 
packages where man pages were being generated from xml.  It is because 
/etc/xml/{catalog,docbook} is not being generated by 
build-docbook-catalog.  The later is a bash script which behave 
differently in musl than it does in glibc.  I reduced the problem to the 
following:

#!/bin/bash

opts=$(getopt -o h --long help -- "$@") || exit 1
eval set -- "${opts}"
while true; do
	case $1 in
		-h|--help) echo "help" ;;
		--) break ;;
	esac
	shift
done
echo "$@"


When run in glibc this gives:

~ # ./test-getops.sh --help 1 2 3
help
-- 1 2 3


but when run under musl:

~ # ./test-getops.sh --help 1 2 3
Try `getopt --help' for more information.


Everything else about these systems is identical.  Any clues?

-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unusual behavior with bash subshell and getopt
  2014-10-02 20:14 Unusual behavior with bash subshell and getopt Anthony G. Basile
@ 2014-10-02 20:36 ` Felix Janda
  2014-10-02 20:50   ` Anthony G. Basile
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Janda @ 2014-10-02 20:36 UTC (permalink / raw)
  To: musl

Anthony G. Basile wrote:
> Hi everyone,
> 
> Today I finally got around to debugging why xsltproc was failing in 
> packages where man pages were being generated from xml.  It is because 
> /etc/xml/{catalog,docbook} is not being generated by 
> build-docbook-catalog.  The later is a bash script which behave 
> differently in musl than it does in glibc.  I reduced the problem to the 
> following:
> [...]

I can't reproduce the behavior of your script on my musl based system
(using your stages).

Anyway, see (second part):

http://www.openwall.com/lists/musl/2014/07/26/10

Until musl getopt_long() accepts abbreviated options, the simplest fix
for gentoo would be to change/fix the getopt invocation in
build-docbook-catalog.

Felix


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unusual behavior with bash subshell and getopt
  2014-10-02 20:36 ` Felix Janda
@ 2014-10-02 20:50   ` Anthony G. Basile
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony G. Basile @ 2014-10-02 20:50 UTC (permalink / raw)
  To: musl

On 10/02/14 16:36, Felix Janda wrote:
> Anthony G. Basile wrote:
>> Hi everyone,
>>
>> Today I finally got around to debugging why xsltproc was failing in
>> packages where man pages were being generated from xml.  It is because
>> /etc/xml/{catalog,docbook} is not being generated by
>> build-docbook-catalog.  The later is a bash script which behave
>> differently in musl than it does in glibc.  I reduced the problem to the
>> following:
>> [...]
>
> I can't reproduce the behavior of your script on my musl based system
> (using your stages).
>
> Anyway, see (second part):
>
> http://www.openwall.com/lists/musl/2014/07/26/10
>
> Until musl getopt_long() accepts abbreviated options, the simplest fix
> for gentoo would be to change/fix the getopt invocation in
> build-docbook-catalog.
>
> Felix
>

Hi Felix,

Thanks!  I missed your 7/26 email but that explains things.  And your 
solution will probably work.  I'll try that.  BTW, there's a bit of you 
in those stages too :)

-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-02 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02 20:14 Unusual behavior with bash subshell and getopt Anthony G. Basile
2014-10-02 20:36 ` Felix Janda
2014-10-02 20:50   ` Anthony G. Basile

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).