Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913480 - app-admin/eselect: eselect profile: suppress --force warning for exp profiles if already on an exp profile
Summary: app-admin/eselect: eselect profile: suppress --force warning for exp profiles...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2023-09-02 06:16 UTC by Sam James
Modified: 2023-09-13 18:24 UTC (History)
0 users

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


Attachments
Patch for profile.eselect (profile.eselect.diff,1.01 KB, patch)
2023-09-02 16:34 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-02 06:16:58 UTC
```
# eselect profile list
Available profile symlink targets:
  [1]   default/linux/hppa/17.0 (stable)
  [2]   default/linux/hppa/17.0/systemd (exp) *
  [3]   default/linux/hppa/17.0/systemd/merged-usr (exp)
  [4]   default/linux/hppa/17.0/desktop (stable)
  [5]   default/linux/hppa/17.0/developer (exp)
# eselect profile set 3
!!! Error: Profile default/linux/hppa/17.0/systemd/merged-usr is experimental
!!! Error: Refusing to select exp profile without --force option
```

It would be nice to suppress the requirement for --force and downgrade the 'Error' to a 'Warning' if we're already on an exp profile.
Comment 1 Ulrich Müller gentoo-dev 2023-09-02 07:27:18 UTC
I'd rather keep it simple, and check only the status of one (namely the new) profile. Also:

- Why does it matter what the old status was?
- How would eselect detect what the status of the old profile was at the time the user had eselected it? The profile could have changed from stable to exp in the meantime, or vice versa. See the ppc64/17.0/32bit-userland profiles for a recent example.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-02 07:28:35 UTC
(In reply to Ulrich Müller from comment #1)
> I'd rather keep it simple, and check only the status of one (namely the new)
> profile.

Alright, that's fine. It's hit me a few times and I've found it annoying, especially when almost all (or all) of the profiles for an arch are exp.

> Also:
> 
> - Why does it matter what the old status was?

The user is presumably already fine with things being experimental.

> - How would eselect detect what the status of the old profile was at the
> time the user had eselected it? The profile could have changed from stable
> to exp in the meantime, or vice versa. See the ppc64/17.0/32bit-userland
> profiles for a recent example.

I suppose, yeah. That would be more of a problem if they didn't just run 'list', although that's not very advisable.
Comment 3 Ulrich Müller gentoo-dev 2023-09-02 07:52:21 UTC
(In reply to Sam James from comment #2)
> Alright, that's fine. It's hit me a few times and I've found it annoying,
> especially when almost all (or all) of the profiles for an arch are exp.

We could check for the case that all available candidates are experimental.
Comment 4 Ulrich Müller gentoo-dev 2023-09-02 16:34:52 UTC
Created attachment 869237 [details, diff]
Patch for profile.eselect

Attached patch checks for available non-exp profiles.

It is not clear to me if ignoring the repository (where the target profile is located) is correct. Maybe the check should only include profiles from the same repository?

Also, I am still somewhat sceptical about adding intricate case distinctions. Currently the behaviour of the module is very straight forward and predictable.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-02 16:38:30 UTC
(In reply to Ulrich Müller from comment #4)
> Created attachment 869237 [details, diff] [details, diff]
> Patch for profile.eselect
> 
> Attached patch checks for available non-exp profiles.
> 
> It is not clear to me if ignoring the repository (where the target profile
> is located) is correct. Maybe the check should only include profiles from
> the same repository?
> 

Yeah, we should probably check only the same repository, if we're going to do it.

> Also, I am still somewhat sceptical about adding intricate case
> distinctions. Currently the behaviour of the module is very straight forward
> and predictable.

It's okay with me if this is a WONTFIX, I just wanted to suggest it as it had been on my mind. I don't feel strongly about it.
Comment 6 Ulrich Müller gentoo-dev 2023-09-09 12:40:49 UTC
Fixed in Git:

https://gitweb.gentoo.org/proj/eselect.git/commit/?h=bug643864&id=34c16498cf238235bb5c712d9325037904d8b7e9

commit 34c16498cf238235bb5c712d9325037904d8b7e9
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: Sat Sep 9 14:33:56 2023 +0200
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: Sat Sep 9 14:33:56 2023 +0200

    Display only a warning when selecting an experimental profile
    
    * modules/profile.eselect (set_symlink): Selecting an experimental
    profile without --force is no longer a fatal error. Bug 643864.
    
    Bug: https://bugs.gentoo.org/643864
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 ChangeLog               | 5 +++++
 modules/profile.eselect | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2023-09-11 16:32:34 UTC
The bug has been referenced in the following commit(s):

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

commit e1a72cd47678d5202d2c7959ca6784462590c9fa
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2023-09-09 12:33:56 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-09-09 18:55:45 +0000

    Display only a warning when selecting an experimental profile
    
    * modules/profile.eselect (set_symlink): Selecting an experimental
    profile without --force is no longer a fatal error. Bug 913480.
    
    Bug: https://bugs.gentoo.org/913480
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 ChangeLog               | 5 +++++
 modules/profile.eselect | 8 +++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
Comment 8 Larry the Git Cow gentoo-dev 2023-09-13 18:24:47 UTC
The bug has been closed via the following commit(s):

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

commit 6295126972e2bde535690cac67322741e14b0987
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2023-09-13 18:22:47 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-09-13 18:24:37 +0000

    app-admin/eselect: add 1.4.27
    
    Closes: https://bugs.gentoo.org/913480
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 app-admin/eselect/Manifest              |  1 +
 app-admin/eselect/eselect-1.4.27.ebuild | 63 +++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)