• Re: [gentoo-dev] [PATCH v2] verify-sig.eclass: avoid calling unpack on

    From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Mike Gilbert on Wed May 22 05:40:01 2024
    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


    -----BEGIN PGP SIGNATURE-----

    iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmZNaLcSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQO8wsH/i2Csiix1d4JQAAeaB8KT2TPcurBTrn2 GW2V6UHQqfE539pdwB8mZeAVy4oGEasLljczBd4LQdl+ZjG8J8pIKjtZa9l7z1rr xa83cPya7QIclKbjbdpBgU0eUBsFVaR6HzCgcn1199rtMtF7nw/RqevsJVgY7KgN XxA8EIxvnKf0HMR1TvAKOaD9KEuH16V5wf6tBLYwxDxZDh4ndqob10ZEy/Zb+Mjv PWvSU+TTwzhLUDPggaOIRlWMNbTAfauWBYRgCcY+v6JVoCGyWLA1Xz+LeibDJxae iaj6UlP++zEzkjie/dfdY3F89u4PzVV+Zc37Eqqz7D3cIC/zNFVCl+Q=
    =80Ro
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Wed May 22 08:00:01 2024
    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

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmZNiGsPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4u4PYH/1n4rtVquFYktBwjzlglBZLkPwbiKuxh5TRq RgrXZsURMbdwGYfAuuS36O3C9D0KjVRdhz/ZPaH2ySPSYMqRF53We3EOPDCinUtf cFn4VlS7/9NRPZoYhHZuhwHIYibgDOsxTgTtinL9I30zaQiR1l9DGpPeeCX34JVU DFMnE3EnBEebzNlBL+Agn80qA/tUXYjMWLM5ngRZcSVzUyPqmAxVqyRte7pys415 4rvj/ust5DSg0lYPt/YAuX2IR/c+NVXV6O1Y2zS52RrCnqtRo7xKqZSOKYEUjZjD 6KHWvRjinvFyxAf62eXeK96cNpnCej9xAjcgp2ZqSLGfC858ZKU=Wr9u
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to ulm@gentoo.org on Wed May 22 17:00:01 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to mgorny@gentoo.org on Wed May 22 17:10:02 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)