public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check
@ 2022-07-25 15:11 Fabian Groffen
  2022-07-25 17:50 ` Ulrich Mueller
  2022-07-25 23:29 ` Mike Gilbert
  0 siblings, 2 replies; 5+ messages in thread
From: Fabian Groffen @ 2022-07-25 15:11 UTC (permalink / raw
  To: gentoo-portage-dev

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

bin/ebuild-helpers/doins: fix D check, add EPREFIX check

ED = D/EPREFIX, so checking for ED includes EPREFIX, which when this is
absent fails to check for D.  Simply check for D instead, which catches
both the case for D and ED.

Add check for usage of EPREFIX, like for using D with helpers.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>

diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
index 24fe48121..4315a038f 100755
--- a/bin/ebuild-helpers/doins
+++ b/bin/ebuild-helpers/doins
@@ -42,7 +42,7 @@ if ! ___eapi_has_prefix_variables; then
 	export ED="${D}"
 fi
 
-if [[ ${_E_INSDESTTREE_#${ED}} != "${_E_INSDESTTREE_}" ]]; then
+if [[ ${_E_INSDESTTREE_#${D}} != "${_E_INSDESTTREE_}" ]]; then
 	__vecho "-------------------------------------------------------" 1>&2
 	__vecho "You should not use \${D} or \${ED} with helpers." 1>&2
 	__vecho "  --> ${_E_INSDESTTREE_}" 1>&2
@@ -50,6 +51,16 @@ if [[ ${_E_INSDESTTREE_#${ED}} != "${_E_INSDESTTREE_}" ]]; then
 	__helpers_die "${helper} used with \${D} or \${ED}"
 	exit 1
 fi
+if [[ -n ${EPREFIX} && \
+		${_E_INSDESTTREE_#${EPREFIX}} != "${_E_INSDESTTREE_}" ]];
+then
+	__vecho "-------------------------------------------------------" 1>&2
+	__vecho "You should not use \${EPREFIX} with helpers." 1>&2
+	__vecho "  --> ${_E_INSDESTTREE_}" 1>&2
+	__vecho "-------------------------------------------------------" 1>&2
+	__helpers_die "${helper} used with \${EPREFIX}"
+	exit 1
+fi
 
 if ___eapi_doins_and_newins_preserve_symlinks; then
 	DOINS_ARGS+=( --preserve_symlinks )

-- 
Fabian Groffen
Gentoo on a different level

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check
  2022-07-25 15:11 [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check Fabian Groffen
@ 2022-07-25 17:50 ` Ulrich Mueller
  2022-07-26 18:38   ` Fabian Groffen
  2022-07-25 23:29 ` Mike Gilbert
  1 sibling, 1 reply; 5+ messages in thread
From: Ulrich Mueller @ 2022-07-25 17:50 UTC (permalink / raw
  To: Fabian Groffen; +Cc: gentoo-portage-dev

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

>>>>> On Mon, 25 Jul 2022, Fabian Groffen wrote:

> @@ -50,6 +51,16 @@ if [[ ${_E_INSDESTTREE_#${ED}} != "${_E_INSDESTTREE_}" ]]; then
>  	__helpers_die "${helper} used with \${D} or \${ED}"
>  	exit 1
>  fi
> +if [[ -n ${EPREFIX} && \
> +		${_E_INSDESTTREE_#${EPREFIX}} != "${_E_INSDESTTREE_}" ]];

The semicolon is redundant.

> +then
> +	__vecho "-------------------------------------------------------" 1>&2
> +	__vecho "You should not use \${EPREFIX} with helpers." 1>&2
> +	__vecho "  --> ${_E_INSDESTTREE_}" 1>&2
> +	__vecho "-------------------------------------------------------" 1>&2
> +	__helpers_die "${helper} used with \${EPREFIX}"
> +	exit 1
> +fi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

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

* Re: [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check
  2022-07-25 15:11 [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check Fabian Groffen
  2022-07-25 17:50 ` Ulrich Mueller
@ 2022-07-25 23:29 ` Mike Gilbert
  2022-07-26 18:38   ` Fabian Groffen
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Gilbert @ 2022-07-25 23:29 UTC (permalink / raw
  To: gentoo-portage-dev

Could you please create a PR at https://github.com/gentoo/portage so
that the CI system can test the changes for this patch series?


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

* Re: [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check
  2022-07-25 17:50 ` Ulrich Mueller
@ 2022-07-26 18:38   ` Fabian Groffen
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Groffen @ 2022-07-26 18:38 UTC (permalink / raw
  To: gentoo-portage-dev

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

On 25-07-2022 19:50:41 +0200, Ulrich Mueller wrote:
> >>>>> On Mon, 25 Jul 2022, Fabian Groffen wrote:
> 
> > @@ -50,6 +51,16 @@ if [[ ${_E_INSDESTTREE_#${ED}} != "${_E_INSDESTTREE_}" ]]; then
> >  	__helpers_die "${helper} used with \${D} or \${ED}"
> >  	exit 1
> >  fi
> > +if [[ -n ${EPREFIX} && \
> > +		${_E_INSDESTTREE_#${EPREFIX}} != "${_E_INSDESTTREE_}" ]];
> 
> The semicolon is redundant.

removed, thanks


-- 
Fabian Groffen
Gentoo on a different level

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check
  2022-07-25 23:29 ` Mike Gilbert
@ 2022-07-26 18:38   ` Fabian Groffen
  0 siblings, 0 replies; 5+ messages in thread
From: Fabian Groffen @ 2022-07-26 18:38 UTC (permalink / raw
  To: gentoo-portage-dev

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

On 25-07-2022 19:29:35 -0400, Mike Gilbert wrote:
> Could you please create a PR at https://github.com/gentoo/portage so
> that the CI system can test the changes for this patch series?

https://github.com/gentoo/portage/pull/866

Thanks,
Fabian

-- 
Fabian Groffen
Gentoo on a different level

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2022-07-26 18:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-25 15:11 [gentoo-portage-dev] [PATCH] doins: fix D check, add EPREFIX check Fabian Groffen
2022-07-25 17:50 ` Ulrich Mueller
2022-07-26 18:38   ` Fabian Groffen
2022-07-25 23:29 ` Mike Gilbert
2022-07-26 18:38   ` Fabian Groffen

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