public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] verify-sig.eclass: avoid calling unpack on sig files
@ 2024-05-22  1:58 Mike Gilbert
  2024-05-22  2:05 ` [gentoo-dev] [PATCH v2] " Mike Gilbert
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Gilbert @ 2024-05-22  1:58 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Mike Gilbert

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
 eclass/verify-sig.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
index b74ed78290aa..b0f180fdb3ac 100644
--- a/eclass/verify-sig.eclass
+++ b/eclass/verify-sig.eclass
@@ -429,7 +429,9 @@ verify-sig_src_unpack() {
 	fi
 
 	# finally, unpack the distfiles
-	default_src_unpack
+	if [[ ${#distfiles[@]} -gt 0 ]]; then
+		unpack "${distfiles[@]}"
+	fi
 }
 
 fi
-- 
2.45.1



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

* [gentoo-dev] [PATCH v2] verify-sig.eclass: avoid calling unpack on sig files
  2024-05-22  1:58 [gentoo-dev] [PATCH] verify-sig.eclass: avoid calling unpack on sig files Mike Gilbert
@ 2024-05-22  2:05 ` Mike Gilbert
  2024-05-22  3:38   ` Michał Górny
  2024-05-22  5:53   ` Ulrich Mueller
  0 siblings, 2 replies; 6+ messages in thread
From: Mike Gilbert @ 2024-05-22  2:05 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Mike Gilbert

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
 eclass/verify-sig.eclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
index b74ed78290aa..4d48c9ed8503 100644
--- a/eclass/verify-sig.eclass
+++ b/eclass/verify-sig.eclass
@@ -426,10 +426,14 @@ verify-sig_src_unpack() {
 			verify-sig_verify_detached \
 				"${DISTDIR}/${f%.*}" "${DISTDIR}/${f}"
 		done
-	fi
 
-	# finally, unpack the distfiles
-	default_src_unpack
+		# finally, unpack the distfiles
+		if [[ ${#distfiles[@]} -gt 0 ]]; then
+			unpack "${distfiles[@]}"
+		fi
+	else
+		default_src_unpack
+	fi
 }
 
 fi
-- 
2.45.1



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

* Re: [gentoo-dev] [PATCH v2] verify-sig.eclass: avoid calling unpack on sig files
  2024-05-22  2:05 ` [gentoo-dev] [PATCH v2] " Mike Gilbert
@ 2024-05-22  3:38   ` Michał Górny
  2024-05-22 14:59     ` Mike Gilbert
  2024-05-22  5:53   ` Ulrich Mueller
  1 sibling, 1 reply; 6+ messages in thread
From: Michał Górny @ 2024-05-22  3:38 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Mike Gilbert

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

On Tue, 2024-05-21 at 22:05 -0400, Mike Gilbert wrote:
> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
> ---
>  eclass/verify-sig.eclass | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
> index b74ed78290aa..4d48c9ed8503 100644
> --- a/eclass/verify-sig.eclass
> +++ b/eclass/verify-sig.eclass
> @@ -426,10 +426,14 @@ verify-sig_src_unpack() {
>  			verify-sig_verify_detached \
>  				"${DISTDIR}/${f%.*}" "${DISTDIR}/${f}"
>  		done
> -	fi
>  
> -	# finally, unpack the distfiles
> -	default_src_unpack
> +		# finally, unpack the distfiles
> +		if [[ ${#distfiles[@]} -gt 0 ]]; then
> +			unpack "${distfiles[@]}"
> +		fi
> +	else
> +		default_src_unpack
> +	fi
>  }
>  
>  fi

Please make a pull request or send a patch with more context.
As submitted, this patch is completely unreadable.

-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

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

* Re: [gentoo-dev] [PATCH v2] verify-sig.eclass: avoid calling unpack on sig files
  2024-05-22  2:05 ` [gentoo-dev] [PATCH v2] " Mike Gilbert
  2024-05-22  3:38   ` Michał Górny
@ 2024-05-22  5:53   ` Ulrich Mueller
  2024-05-22 14:55     ` Mike Gilbert
  1 sibling, 1 reply; 6+ messages in thread
From: Ulrich Mueller @ 2024-05-22  5:53 UTC (permalink / raw)
  To: Mike Gilbert; +Cc: gentoo-dev

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

>>>>> On Wed, 22 May 2024, Mike Gilbert wrote:

> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
> ---
>  eclass/verify-sig.eclass | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

> diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
> index b74ed78290aa..4d48c9ed8503 100644
> --- a/eclass/verify-sig.eclass
> +++ b/eclass/verify-sig.eclass
> @@ -426,10 +426,14 @@ verify-sig_src_unpack() {
>  			verify-sig_verify_detached \
>  				"${DISTDIR}/${f%.*}" "${DISTDIR}/${f}"
>  		done
> -	fi
 
> -	# finally, unpack the distfiles
> -	default_src_unpack
> +		# finally, unpack the distfiles
> +		if [[ ${#distfiles[@]} -gt 0 ]]; then
> +			unpack "${distfiles[@]}"
> +		fi
> +	else
> +		default_src_unpack
> +	fi
>  }
 
>  fi

Please provide an explanation what problem this patch fixes.

Why is calling unpack on sig files bad? It should silently skip files
with unknown extensions.

Ulrich

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

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

* Re: [gentoo-dev] [PATCH v2] verify-sig.eclass: avoid calling unpack on sig files
  2024-05-22  5:53   ` Ulrich Mueller
@ 2024-05-22 14:55     ` Mike Gilbert
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Gilbert @ 2024-05-22 14:55 UTC (permalink / raw)
  To: gentoo-dev

On Wed, May 22, 2024 at 1:53 AM Ulrich Mueller <ulm@gentoo.org> wrote:
> Please provide an explanation what problem this patch fixes.
>
> Why is calling unpack on sig files bad? It should silently skip files
> with unknown extensions.

The main reason is that Portage does not *silently* skip unknown
extensions in unpack. For  example:

>>> Unpacking freerdp-2.11.7.tar.gz.asc to /x/portage/net-misc/freerdp-2.11.7/work
unpack freerdp-2.11.7.tar.gz.asc: file format not recognized. Ignoring.

The other reason would be the small/trivial efficiency gain; there is
no point in calling unpack on a file it won't be able to process.


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

* Re: [gentoo-dev] [PATCH v2] verify-sig.eclass: avoid calling unpack on sig files
  2024-05-22  3:38   ` Michał Górny
@ 2024-05-22 14:59     ` Mike Gilbert
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Gilbert @ 2024-05-22 14:59 UTC (permalink / raw)
  To: gentoo-dev

On Tue, May 21, 2024 at 11:38 PM Michał Górny <mgorny@gentoo.org> wrote:
>
> On Tue, 2024-05-21 at 22:05 -0400, Mike Gilbert wrote:
> > Signed-off-by: Mike Gilbert <floppym@gentoo.org>
> > ---
> >  eclass/verify-sig.eclass | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
> > index b74ed78290aa..4d48c9ed8503 100644
> > --- a/eclass/verify-sig.eclass
> > +++ b/eclass/verify-sig.eclass
> > @@ -426,10 +426,14 @@ verify-sig_src_unpack() {
> >                       verify-sig_verify_detached \
> >                               "${DISTDIR}/${f%.*}" "${DISTDIR}/${f}"
> >               done
> > -     fi
> >
> > -     # finally, unpack the distfiles
> > -     default_src_unpack
> > +             # finally, unpack the distfiles
> > +             if [[ ${#distfiles[@]} -gt 0 ]]; then
> > +                     unpack "${distfiles[@]}"
> > +             fi
> > +     else
> > +             default_src_unpack
> > +     fi
> >  }
> >
> >  fi
>
> Please make a pull request or send a patch with more context.
> As submitted, this patch is completely unreadable.

Sure, I updated the commit message per ulm's comments, and opened a PR.

https://github.com/gentoo/gentoo/pull/36776


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

end of thread, other threads:[~2024-05-22 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-22  1:58 [gentoo-dev] [PATCH] verify-sig.eclass: avoid calling unpack on sig files Mike Gilbert
2024-05-22  2:05 ` [gentoo-dev] [PATCH v2] " Mike Gilbert
2024-05-22  3:38   ` Michał Górny
2024-05-22 14:59     ` Mike Gilbert
2024-05-22  5:53   ` Ulrich Mueller
2024-05-22 14:55     ` Mike Gilbert

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