Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908401 - app-admin/eselect: eselect env update fails due to erroneous detection after sys-apps/file change
Summary: app-admin/eselect: eselect env update fails due to erroneous detection after ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: UPSTREAM
Depends on: 908415
Blocks:
  Show dependency tree
 
Reported: 2023-06-12 11:36 UTC by Paul Zander
Modified: 2023-08-01 15:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for app-admin/eselect (env.eselect.diff,840 bytes, patch)
2023-06-12 12:32 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Zander 2023-06-12 11:36:55 UTC
sys-apps/file added detection for "Hewlett-Packard Graphics Language" in <https://github.com/file/file/commit/57df9984ca59a54a0ad2ac548bc155dabe07f03a>. This causes files in /etc/env.d that start with "PA" like "PATH" or "NP" as in  "NPM_CONFIG_GLOBALCONFIG" to be detected as "Hewlett-Packard Graphics Language" files and not as "ASCII text". As a result "eselect env update" ignores these files and doesn't add them to the environment.

I found this after doxygen crashed because it could no longer find "libclang.so.16" because the LDPATH set from the env file created by "sys-devel/llvm" is no longer added.

The simplest fix is adding a blank line as the first line or reordering the lines so the file no longer starts with "PA" or "NPM".
Preferably I would enforce adding a header like "sys-apps/baselayout" does in "/etc/env.d/50baselayout".

Reproducible: Always

Steps to Reproduce:
1. file /etc/env.d/*
Actual Results:  
95eselect-wine:            Hewlett-Packard Graphics Language, starting with "PATH="/etc/eselect/wine/bin"" with "MANPATH="/"

Expected Results:  
95eselect-wine:            ASCII text

The files in /etc/env.d/ belong to package that creates the env file.
Comment 1 Ulrich Müller gentoo-dev 2023-06-12 12:06:45 UTC
Reported to file upstream: https://bugs.astron.com/view.php?id=457

(In reply to Paul Zander from comment #0)
> The simplest fix is adding a blank line as the first line or reordering the
> lines so the file no longer starts with "PA" or "NPM".

We shouldn't jump through such hoops. Obviously, 95eselect-wine is a text file, so detection should be robust enough to correctly identify it.
Comment 2 Ulrich Müller gentoo-dev 2023-06-12 12:32:50 UTC
Created attachment 863731 [details, diff]
Patch for app-admin/eselect

Please test if attached patch fixes the problem for you.
Comment 3 Paul Zander 2023-06-12 12:38:07 UTC
It does. Cheers!
Comment 4 Larry the Git Cow gentoo-dev 2023-06-12 16:24:04 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/eselect.git/commit/?id=cc4270eeb9b737ecd4332b417524976ede25a323

commit cc4270eeb9b737ecd4332b417524976ede25a323
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2023-06-12 15:56:19 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-06-12 15:56:19 +0000

    env.eselect: More robust file type detection
    
    * modules/env.eselect (is_envfile): Make detection of text file
    more robust. Bug 908401.
    
    Bug: https://bugs.gentoo.org/908401
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 ChangeLog           | 3 +++
 modules/env.eselect | 9 +++++----
 2 files changed, 8 insertions(+), 4 deletions(-)
Comment 5 Larry the Git Cow gentoo-dev 2023-06-12 16:25:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bfceb288cb51af113eddd0fb3cf22ee00e0ff663

commit bfceb288cb51af113eddd0fb3cf22ee00e0ff663
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2023-06-12 16:17:55 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-06-12 16:24:40 +0000

    app-admin/eselect: More robust file type detection in env module
    
    Bug: https://bugs.gentoo.org/908401
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 app-admin/eselect/eselect-1.4.22-r1.ebuild         | 60 ++++++++++++++++++++++
 .../eselect/files/eselect-1.4.22-env-module.patch  | 19 +++++++
 2 files changed, 79 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fb4f8c265b91691ffc427036bab49a06b84095e

commit 1fb4f8c265b91691ffc427036bab49a06b84095e
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2023-06-12 16:12:44 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-06-12 16:24:39 +0000

    app-admin/eselect: add 1.4.25
    
    Bug: https://bugs.gentoo.org/908401
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 app-admin/eselect/Manifest              |  1 +
 app-admin/eselect/eselect-1.4.25.ebuild | 58 +++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
Comment 6 Ulrich Müller gentoo-dev 2023-06-12 21:37:43 UTC
Workaround is in place:
- eselect-1.4.22-r1 in stable
- eselect-1.4.25 in unstable

Thank you for reporting!

I'll follow up on the sys-apps/file issue (presumably in a new bug) when we get a reply in its upstream bug.
Comment 7 Larry the Git Cow gentoo-dev 2023-06-16 21:02:36 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe6c7371f5fc929a308bd83e471084a961080fc5

commit fe6c7371f5fc929a308bd83e471084a961080fc5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-06-16 21:00:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-16 21:02:20 +0000

    profiles: mask <app-admin/eselect-1.4.22-r1
    
    This means folks with the older version installed will see the mask message
    when doing other emerges.
    
    Bug: https://bugs.gentoo.org/908401
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/package.mask | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 8 Larry the Git Cow gentoo-dev 2023-08-01 15:42:36 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26eb5b45518d15e61fe83c7da08afb749be9f6e6

commit 26eb5b45518d15e61fe83c7da08afb749be9f6e6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-08-01 15:41:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-08-01 15:42:16 +0000

    sys-apps/file: backport 32-bit time_t fix, backport weak shell magic fix
    
    Bug: https://bugs.gentoo.org/908401
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/file/file-5.45-r1.ebuild                  | 180 +++++++++++++++++++++
 .../file/files/file-5.45-32-bit-time_t-deux.patch  |  29 ++++
 sys-apps/file/files/file-5.45-32-bit-time_t.patch  |  34 ++++
 .../file/files/file-5.45-weak-magic-shell.patch    |  43 +++++
 4 files changed, 286 insertions(+)