• [gentoo-dev] [PATCH v2] distutils-r1.eclass: Add assertions for bindir

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Fri Jun 10 14:20:02 2022
    The eclass code in distutils-r1_python_install makes some assumptions
    specific to _distutils-r1_post_python_compile being called,
    and scriptdir not being modified since. Make them more explicit by:

    1) explicitly removing the files that we expect to have been created,

    2) verifying that both the copied and the original scriptdir have
    the same list of files.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 30 +++++++++++++++++++++++++++---
    1 file changed, 27 insertions(+), 3 deletions(-)

    Changes in v2:
    - use diff instead of cksum -- which makes the code both simpler
    and gives users clear info what's mismatched

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index f3d224a51224..3d5f0791baaf 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -1514,13 +1514,37 @@ distutils-r1_python_install() {
    local merge_root=
    if [[ ${DISTUTILS_USE_PEP517} ]]; then
    local root=${BUILD_DIR}/install
    + local reg_scriptdir=${root}/${scriptdir}
    + local wrapped_scriptdir=${root}$(python_get_scriptdir)
    +
    + # we are assuming that _distutils-r1_post_python_compile
    + # has been called and ${root} has not been altered since
    + # let's explicitly verify these assumptions
    +
    + # remove files that we've created explicitly
    + rm "${reg_scriptdir}"/{"${EPYTHON}",python3,python,pyvenv.cfg} || die
    + # verify that scriptdir & wr
  • From Maxwell Seefeld@21:1/5 to mgorny@gentoo.org on Fri Jun 10 16:00:01 2022
    Hey, I'm new to the project is anyone maintaining Gentoo + BSD anymore or
    the SELINUX package?

    On Fri, Jun 10, 2022 at 8:17 AM Michał Górny <mgorny@gentoo.org> wrote:

    The eclass code in distutils-r1_python_install makes some assumptions specific to _distutils-r1_post_python_compile being called,
    and scriptdir not being modified since. Make them more explicit by:

    1) explicitly removing the files that we expect to have been created,

    2) verifying that both the copied and the original scriptdir have
    the same list of files.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 30 +++++++++++++++++++++++++++---
    1 file changed, 27 insertions(+), 3 deletions(-)

    Changes in v2:
    - use diff instead of cksum -- which makes the code both simpler
    and gives users clear info what's mismatched

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index f3d224a51224..3d5f0791baaf 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -1514,13 +1514,37 @@ distutils-r1_python_install() {
    local merge_root=
    if [[ ${DISTUTILS_USE_PEP517} ]]; then
    local root=${BUILD_DIR}/install
    + local reg_scriptdir=${root}/${scriptdir}
    + local wrapped_scriptdir=${root}$(python_get_scriptdir)
    +
    + # we are assuming that _distutils-r1_post_python_compile
    + # has been called and ${root} has not been altered since
    + # let's explicitly verify these assumptions
    +
    + # remove files that we've created explicitly
    + rm "${reg_scriptdir}"/{"${EPYTHON}",python3,python,pyvenv.cfg} || die
    + # verify that scriptdir & wrapped_scriptdir both contain
    + # the same files
    + (
    + cd "${reg_scriptdir}" && find . -mindepth 1
    + ) | sort > "${T}"/files-bin
    + assert "listing ${reg_scriptdir} failed"
    + (
    + if [[ -d ${wrapped_scriptdir} ]]; then
    + cd "${wrapped_scriptdir}" && find .
    -mindepth 1
    + fi
    + ) | sort > "${T}"/files-wrapped
    + assert "listing ${wrapped_scriptdir} failed"
    + if ! diff -U 0 "${T}"/files-{bin,wrapped}; then
    + die "File lists for ${reg_scriptdir} and ${wrapped_scriptdir} differ (see diff above)"
    + fi
    +
    # remove the altered bindir, executables from the package
    # are already in scriptdir
    - rm -r "${root}${scriptdir}" || die
    + rm -r "${reg_scriptdir}" || die
    if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
    - local wrapped_scriptdir=${root}$(python_get_scriptdir)
    if [[ -d ${wrapped_scriptdir} ]]; then
    - mv "${wrapped_scriptdir}" "${root}${scriptdir}" || die
    + mv "${wrapped_scriptdir}"
    "${reg_scriptdir}" || die
    fi
    fi
    # prune empty directories to see if ${root} contains
    anything
    --
    2.35.1




    <div dir="ltr">Hey, I&#39;m new to the project is anyone maintaining Gentoo + BSD anymore or the SELINUX package? <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 10, 2022 at 8:17 AM Michał Górny &lt;<a href="mailto:
    mgorny@gentoo.org">mgorny@gentoo.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The eclass code in distutils-r1_python_install makes some assumptions<br>
    specific to _distutils-r1_post_python_compile being called,<br>
    and scriptdir not being modified since.  Make them more explicit by:<br>

    1) explicitly removing the files that we expect to have been created,<br>

    2) verifying that both the copied and the original scriptdir have<br>
       the same list of files.<br>

    Signed-off-by: Michał Górny &lt;<a href="mailto:mgorny@gentoo.org" target="_blank">mgorny@gentoo.org</a>&gt;<br>
    ---<br>
     eclass/distutils-r1.eclass | 30 +++++++++++++++++++++++++++---<br>
     1 file changed, 27 insertions(+), 3 deletions(-)<br>

    Changes in v2:<br>
    - use diff instead of cksum -- which makes the code both simpler<br>
      and gives users clear info what&#39;s mismatched<br>

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass<br>
    index f3d224a51224..3d5f0791baaf 100644<br>
    --- a/eclass/distutils-r1.eclass<br>
    +++ b/eclass/distutils-r1.eclass<br>
    @@ -1514,13 +1514,37 @@ distutils-r1_python_install() {<br>
            local merge_root=<br>
            if [[ ${DISTUTILS_USE_PEP517} ]]; then<br>
                    local root=${BUILD_DIR}/install<br>
    +               local reg_scriptdir=${root}/${scriptdir}<br>
    +               local wrapped_scriptdir=${root}$(python_get_scriptdir)<br>
    +<br>
    +               # we are assuming that _distutils-r1_post_python_compile<br>
    +               # has been called and ${root} has not been altered since<br>
    +               # let&#39;s explicitly verify these assumptions<br> +<br>
    +               # remove files that we&#39;ve created explicitly<br> +               rm &quot;${reg_scriptdir}&quot;/{&quot;${EPYTHON}&quot;,python3,python,pyvenv.cfg} || die<br>
    +               # verify that scriptdir &amp; wrapped_scriptdir both contain<br>
    +               # the s
  • From Sam James@21:1/5 to All on Mon Jun 20 02:20:01 2022
    On 10 Jun 2022, at 14:59, Maxwell Seefeld <cyberalamo@gmail.com> wrote:

    Hey, I'm new to the project is anyone maintaining Gentoo + BSD anymore or the SELINUX package?

    [snip]

    You seem to have replied to a random ML post rather than making a new thread.

    Yes, people are maintaining SELinux in Gentoo:
    - https://wiki.gentoo.org/wiki/SELinux (the news thing on the right is a bit out of date)
    - https://wiki.gentoo.org/wiki/Project:SELinux

    We do a lot of coordination on IRC in general in Gentoo. You should join the #gentoo-hardened
    channel on libera if you have questions about SELinux.

    As for Gentoo/{Open,FreeBSD}, no, they are not maintained and all remnants of them
    were removed a while ago. Any work to restore them should probably start with making
    Prefix work as that's far more sustainable.

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

    iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCYq+8KF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kC5iAP9Y7eBqPI8bBF5CPXOe2xU1R920e4h43rbLb/XwRjgyGgEAlYz60fJWX5p8 RZi4L9zeu6g8qblMfE4IZ9qEmP/9oQM=
    =a3JE
    -----END PGP SIGNATURE-----

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