tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Implement dash as bootstrap shell



On Mon, Dec 07, 2015 at 02:57:12PM +0000, Sevan / Venture37 wrote:
> Hello,
> 
> On 5 December 2015 at 08:03, Jonathan Perkin <jperkin%joyent.com@localhost> wrote:
> > The platforms which currently require pdksh are AIX and OSF1.  AIX is
> > listed in the dash ChangeLog as being supported, but I have no idea
> > about OSF1.  Maybe Sevan can perform his magic and get us an OSF1 host
> > to test on? :)
> 
> I switched AIX to pdksh earlier this year, it could very well be that
> I made a mistake (I never managed to get a bulk build going properly
> on AIX 7).
> Re OSF1, we need a pkgsrc zoo! :)


Hi,

about a year ago I was using dash on my Ubuntu buildhosts, and after a
change in mk/wrapper/gen-transform.sh the libtool builds stopped working
( http://mail-index.netbsd.org/pkgsrc-users/2014/09/23/msg020394.html )

Currently I just use WRAPPER_SHELL=/bin/bash, but dash is a lot
faster.

Looking at the current mk/wrapper/gen-transform.sh, it still uses the
problematic echo sequences \1 and \2:

    146                         $echo "s|\([$_sep]\)$1\(/[^$_sep]*\.la[$_sep]\)|\1$2\2|g"

which result in Ctrl-A and Ctrl-B under dash (also dash from pkgsrc).


I wonder why this causes next to no problems for the bulk builds, but I
haven't tried using dash in a year (and I still use pkg_rr and no bulk
builds ...).


The following shell code illustrates the problem:

    root@pkgsrc1404-64:~/tmp# cat backslashed.sh 
    echo "\1\2" | hexdump -C
    printf "\1\2\n" | hexdump -C
    printf "%s\n" "\1\2" | hexdump -C

    root@pkgsrc1404-64:~/tmp# /opt/pkgsrc/bin/dash -x backslashed.sh 
    + hexdump -C
    + echo \1\2
=>  00000000  01 02 0a                                          |...|
    00000003
    + hexdump -C
    + printf \1\2\n
=>  00000000  01 02 0a                                          |...|
    00000003
    + hexdump -C
    + printf %s\n \1\2
=>  00000000  5c 31 5c 32 0a                                    |\1\2.|
    00000005



Regards
Matthias Ferdinand


Home | Main Index | Thread Index | Old Index