tech-pkg archive

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

Re: [PATCH] If the shell fails the echo test, try /bin/bash



In #pkgsrc, schmonz mentioned that bootstrap was failing on Ubuntu. I
was curious so I tried it and it failed for me as well.

On 2021-04-26, Jonathan Perkin <jperkin%joyent.com@localhost> wrote:
> We only had these workarounds for bad code in the legacy wrappers which
> should be removed anyway.  I'd rather we just removed this stuff
> completely and fix up any places where we're still using incompatible
> sequences.
>
> A few years back when I was performing full bulk builds with dash, I had
> these changes:
>
>
> https://github.com/joyent/pkgsrc-legacy/commit/624fd0785e70e89d5e1fef745060efee0aca0da3

I determined that the issue is that "\1" is used with echo in
gen-transform.sh, and dash's built-in echo treats it as an octal
escape. This is what the above patch fixes.

Was the intention that this patch be applied before removing the echo
test in bootstrap?

Looking over the patch, I think it should be using %s with an argument
instead of using variables within the format string. Otherwise, if the
variable contains a % or \ it will be treated as a format specifier or
escape sequence

So instead of

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

we should do something like
	
	printf '%s\n' "s|^$1\(/[^$_sep]*\.la[$_sep]\)|$2\1|g"

> https://github.com/joyent/pkgsrc-legacy/commit/b7d9205aa23be3e91789c1b0350edc00812baa1a
>
> The other changes (e.g. fixing configure scripts to use $ac_echo) have
> already been committed.  And obviously I haven't used the legacy
> wrappers for over 5 years now.


Home | Main Index | Thread Index | Old Index