[devtools,3/7] arch-nspawn: make sure that makepkg.conf is always parsed as text

Message ID 20180115165759.26127-4-lukeshu@lukeshu.com
State Accepted
Headers show
Series Backports from Parabola v20180103 | expand

Commit Message

Luke Shumaker Jan. 15, 2018, 4:57 p.m. UTC
From: Luke Shumaker <lukeshu@parabola.nu>

https://lists.parabola.nu/pipermail/dev/2017-June/005576.html
---
 arch-nspawn.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Emil Velikov via arch-projects Jan. 15, 2018, 5:11 p.m. UTC | #1
On 01/15/2018 11:57 AM, Luke Shumaker wrote:
> From: Luke Shumaker <lukeshu@parabola.nu>
> 
> https://lists.parabola.nu/pipermail/dev/2017-June/005576.html
> ---
>  arch-nspawn.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch-nspawn.in b/arch-nspawn.in
> index c55f498..3949ee1 100644
> --- a/arch-nspawn.in
> +++ b/arch-nspawn.in
> @@ -107,7 +107,7 @@ fi
>  build_mount_args
>  copy_hostconf
>  
> -eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")"
> +eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")"
>  
>  [[ -z $nosetarch ]] || unset CARCH

I'm curious, in what situation were you having grep parse makepkg.conf
as not text?

I also wonder whether we should source makepkg.conf in a subshell and
printf the relevant variables...
Luke Shumaker Jan. 15, 2018, 7:29 p.m. UTC | #2
On Mon, 15 Jan 2018 12:11:29 -0500,
Eli Schwartz wrote:
> 
> On 01/15/2018 11:57 AM, Luke Shumaker wrote:
> > From: Luke Shumaker <lukeshu@parabola.nu>
> > 
> > https://lists.parabola.nu/pipermail/dev/2017-June/005576.html
> > ---
> >  arch-nspawn.in | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch-nspawn.in b/arch-nspawn.in
> > index c55f498..3949ee1 100644
> > --- a/arch-nspawn.in
> > +++ b/arch-nspawn.in
> > @@ -107,7 +107,7 @@ fi
> >  build_mount_args
> >  copy_hostconf
> >  
> > -eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")"
> > +eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")"
> >  
> >  [[ -z $nosetarch ]] || unset CARCH
> 
> I'm curious, in what situation were you having grep parse makepkg.conf
> as not text?

Some unicode in a comment near the top was tripping it up (this was on
the box of a Spanish-speaking developer).

> I also wonder whether we should source makepkg.conf in a subshell and
> printf the relevant variables...

I have no problem with that.
Emil Velikov via arch-projects Jan. 20, 2018, 3:12 p.m. UTC | #3
On 2018-01-15 18:11, Eli Schwartz via arch-projects wrote:
> On 01/15/2018 11:57 AM, Luke Shumaker wrote:
>> From: Luke Shumaker <lukeshu@parabola.nu>
>>
>> https://lists.parabola.nu/pipermail/dev/2017-June/005576.html
>> ---
>>  arch-nspawn.in | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch-nspawn.in b/arch-nspawn.in
>> index c55f498..3949ee1 100644
>> --- a/arch-nspawn.in
>> +++ b/arch-nspawn.in
>> @@ -107,7 +107,7 @@ fi
>>  build_mount_args
>>  copy_hostconf
>>  
>> -eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")"
>> +eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")"
>>  
>>  [[ -z $nosetarch ]] || unset CARCH
> 
> I'm curious, in what situation were you having grep parse makepkg.conf
> as not text?
> 
> I also wonder whether we should source makepkg.conf in a subshell and
> printf the relevant variables...
> 

Used to happen with my "ł" in ~/.makepkg.conf, so sounds generally useful.

Patch

diff --git a/arch-nspawn.in b/arch-nspawn.in
index c55f498..3949ee1 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -107,7 +107,7 @@  fi
 build_mount_args
 copy_hostconf
 
-eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")"
+eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")"
 
 [[ -z $nosetarch ]] || unset CARCH