public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Re: [PATCH] eapply_user: allow empty directories
       [not found] <1457305317-32338-1-git-send-email-Jason@zx2c4.com>
@ 2016-03-06 23:12 ` Zac Medico
  2016-03-06 23:33 ` Ulrich Mueller
  1 sibling, 0 replies; 2+ messages in thread
From: Zac Medico @ 2016-03-06 23:12 UTC (permalink / raw)
  To: Jason A. Donenfeld, dev-portage, gentoo-dev

On 03/06/2016 03:01 PM, Jason A. Donenfeld wrote:
> Without this, an empty directory in
> /etc/portage/patches/$cat/$pkg will result in an fatal error.
> 
> Fixes: 573920
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  bin/phase-helpers.sh | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
> index 80f5946..60e51ea 100644
> --- a/bin/phase-helpers.sh
> +++ b/bin/phase-helpers.sh
> @@ -1089,6 +1089,10 @@ if ___eapi_has_eapply_user; then
>  		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
>  
>  		local d applied
> +		local LC_ALL=POSIX
> +		local prev_shopt=$(shopt -p nullglob)
> +		shopt -s nullglob
> +
>  		# possibilities:
>  		# 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying
>  		#    ${P} twice)
> @@ -1096,12 +1100,14 @@ if ___eapi_has_eapply_user; then
>  		# 3. ${CATEGORY}/${PN}
>  		# all of the above may be optionally followed by a slot
>  		for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do
> -			if [[ -d ${d} ]]; then
> +			if [[ -n $(echo ${d}/*.diff) || -n $(echo ${d}/*.patch) ]]; then

Technically, ${d} should be quoted above. Otherwise, the patch looks good.

Test case:

$ d="foo  bar"
$ echo ${d}
foo bar
$ echo "${d}"
foo  bar

>  				eapply "${d}"
>  				applied=1
>  			fi
>  		done
>  
> +		${prev_shopt}
> +
>  		[[ -n ${applied} ]] && ewarn "User patches applied."
>  	}
>  fi
> 


-- 
Thanks,
Zac


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

* [gentoo-dev] Re: [PATCH] eapply_user: allow empty directories
       [not found] <1457305317-32338-1-git-send-email-Jason@zx2c4.com>
  2016-03-06 23:12 ` [gentoo-dev] Re: [PATCH] eapply_user: allow empty directories Zac Medico
@ 2016-03-06 23:33 ` Ulrich Mueller
  1 sibling, 0 replies; 2+ messages in thread
From: Ulrich Mueller @ 2016-03-06 23:33 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jason A. Donenfeld, dev-portage

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

>>>>> On Sun, 6 Mar 2016, Jason A. Donenfeld wrote:

>> --- a/bin/phase-helpers.sh
>> +++ b/bin/phase-helpers.sh
>> @@ -1089,6 +1089,10 @@ if ___eapi_has_eapply_user; then
>>  		local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
>>  
>>  		local d applied
>> +		local LC_ALL=POSIX
>> +		local prev_shopt=$(shopt -p nullglob)
>> +		shopt -s nullglob

Why is LC_ALL=POSIX needed there?

Ulrich

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

end of thread, other threads:[~2016-03-06 23:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1457305317-32338-1-git-send-email-Jason@zx2c4.com>
2016-03-06 23:12 ` [gentoo-dev] Re: [PATCH] eapply_user: allow empty directories Zac Medico
2016-03-06 23:33 ` Ulrich Mueller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox