View previous topic :: View next topic |
Author |
Message |
Xharlie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 21 May 2017 Posts: 13
|
Posted: Thu Jun 13, 2024 11:46 am Post subject: -y or --noask switch for Portage & emaint commands? |
|
|
In my `/etc/portage/make.conf`, I have set `EMERGE_DEFAULT_OPTS="--ask --ask-enter-invalid …"` because, honestly, these saved my arse so many times that it's bonkers.
The full set is:
Code: |
EMERGE_DEFAULT_OPTS="--ask --ask-enter-invalid --fail-clean --quiet-build"
|
However, because `--ask` is there, I also get an interactive halt when I run things like `emaint sync` and that's really not what I want.
I don't think I have ever bothered to type `sudo emaint sync` into a terminal and *not* actually intended to actually sync.
Similarly, there are a few times when I do want to just `emerge` or `emerge --depclean` without being asked, despite having the defaults.
Is there some way to send `--noask` or `-y` or something to these commands to override the pre-existing `--ask` from `EMERGE_DEFAULT_OPTS`?
I have tried a few things but I can't seem to find how to do it.
Shell aliases are also of limited use because they don't get applied when `sudo` enters the picture. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
eeckwrk99 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1208501992659c54b9b9e81.jpg)
Joined: 14 Mar 2021 Posts: 204 Location: Gentoo forums
|
Posted: Thu Jun 13, 2024 11:58 am Post subject: Re: -y or --noask switch for Portage & emaint commands? |
|
|
Xharlie wrote: | However, because `--ask` is there, I also get an interactive halt when I run things like `emaint sync` and that's really not what I want. I don't think I have ever bothered to type `sudo emaint sync` into a terminal and *not* actually intended to actually sync. |
I'm also using --ask in EMERGE_DEFAULT_OPTS and I'm not getting any interactive confirmation when running
, be it with sudo or as root.
Xharlie wrote: | Is there some way to send `--noask` or `-y` or something to these commands to override the pre-existing `--ask` from `EMERGE_DEFAULT_OPTS`? |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Xharlie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 21 May 2017 Posts: 13
|
Posted: Thu Jun 13, 2024 12:01 pm Post subject: |
|
|
This is what `sudo emaint sync` gives me, every time:
Code: |
>>> Syncing repository 'gentoo' into '/var/db/repos/gentoo'...
* Using keys from /usr/share/openpgp-keys/gentoo-release.asc
* Refreshing keys via WKD ... [ ok ]
Do you want to sync your ebuild repository with the mirror at
rsync://[2a00:1828:a00d:ffff::6]/gentoo-portage? [Yes/No]
|
I had just guessed that it began to do so when I added `--ask` to `EMERGE_DEFAULT_OPTS` because it was not always thus. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
grknight Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
Joined: 20 Feb 2015 Posts: 1833
|
Posted: Thu Jun 13, 2024 12:19 pm Post subject: |
|
|
Xharlie wrote: | Is there some way to send `--noask` or `-y` or something to these commands to override the pre-existing `--ask` from `EMERGE_DEFAULT_OPTS`? |
Being python based, many boolean options can be negated like --ask=n. This is covered in the man page as well. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
eeckwrk99 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1208501992659c54b9b9e81.jpg)
Joined: 14 Mar 2021 Posts: 204 Location: Gentoo forums
|
Posted: Thu Jun 13, 2024 12:20 pm Post subject: |
|
|
Xharlie wrote: | This is what `sudo emaint sync` gives me, every time:
Code: |
>>> Syncing repository 'gentoo' into '/var/db/repos/gentoo'...
* Using keys from /usr/share/openpgp-keys/gentoo-release.asc
* Refreshing keys via WKD ... [ ok ]
Do you want to sync your ebuild repository with the mirror at
rsync://[2a00:1828:a00d:ffff::6]/gentoo-portage? [Yes/No]
|
I had just guessed that it began to do so when I added `--ask` to `EMERGE_DEFAULT_OPTS` because it was not always thus. |
Ha, maybe that's because you're using rsync and I'm using Git (Gentoo Wiki - Portage with Git). |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2163
|
Posted: Thu Jun 13, 2024 1:22 pm Post subject: |
|
|
Xharlie wrote: | This is what `sudo emaint sync` gives me, every time:
Code: |
rsync://[2a00:1828:a00d:ffff::6]/gentoo-portage? [Yes/No]
|
|
Looks like rsync related to me.
Best Regards,
Georgi |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Xharlie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 21 May 2017 Posts: 13
|
Posted: Fri Aug 02, 2024 6:47 am Post subject: |
|
|
I fiddled with `emerge` and `emaint` commands a bit, this morning, and here's what I've learned.
Firstly, this command does what I want it to do:
Code: | emerge --ask=n --sync |
These, however, do not work:
Code: | emaint --ask=n sync
emaint sync --ask=n |
... and so I've settled on simply reverting to `emerge --sync` and ignoring the advice in the wiki which recommends use of `emaint`, going forward.
This is not the *only* switch that `emaint` doesn't like. In fact, reverting to `emerge --sync` makes it possible – once again – to do:
Quote: | emerge --ask=n --quiet --sync |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2163
|
Posted: Fri Aug 02, 2024 7:00 am Post subject: |
|
|
Xharlie wrote: |
... and so I've settled on simply reverting to `emerge --sync` and ignoring the advice in the wiki which recommends use of `emaint`, going forward. |
According to that same wiki, if my memory serves me well, emerge --sync just calls emaint, so you should be good.
Best Regards,
Georgi |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Xharlie n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 21 May 2017 Posts: 13
|
Posted: Fri Aug 02, 2024 7:55 am Post subject: |
|
|
's true. Which is why I find it remarkable that any switches to it don't work with `emaint sync ...`. One day, I'll have a Bier in hand and get around to filing an issue or a merge request to patch it. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2163
|
Posted: Fri Aug 02, 2024 9:03 am Post subject: |
|
|
For what's worth, I'm using eix-sync.
It might be useful to you too.
Best Regards,
Georgi |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
eeckwrk99 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1208501992659c54b9b9e81.jpg)
Joined: 14 Mar 2021 Posts: 204 Location: Gentoo forums
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Zucca Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
![](images/avatars/1241878214609aa5b503437.gif)
Joined: 14 Jun 2007 Posts: 3604 Location: Rasi, Finland
|
Posted: Fri Aug 02, 2024 9:15 am Post subject: |
|
|
I wonder if creating an alias or some kind of wrapper which runs Code: | EMERGE_DEFAULT_OPTS="" emaint sync | ... assuming emaint works the same way as emerge and prefers to use environment variables, if set over the ones in make.conf. _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2163
|
Posted: Fri Aug 02, 2024 9:42 am Post subject: |
|
|
Zucca wrote: | I wonder if creating an alias or some kind of wrapper... |
emerge --sync is already a wrapper.
Best Regards,
Georgi |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Zucca Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
![](images/avatars/1241878214609aa5b503437.gif)
Joined: 14 Jun 2007 Posts: 3604 Location: Rasi, Finland
|
Posted: Fri Aug 02, 2024 9:50 am Post subject: |
|
|
logrusx wrote: | emerge --sync is already a wrapper.
Best Regards,
Georgi | That's correct, but the code I provided sets EMERGE_DEFAULT_OPTS to an empty string, which should make emaint run without --ask. _________________ ..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2163
|
Posted: Fri Aug 02, 2024 10:10 am Post subject: |
|
|
Zucca wrote: | logrusx wrote: | emerge --sync is already a wrapper.
Best Regards,
Georgi | That's correct, but the code I provided sets EMERGE_DEFAULT_OPTS to an empty string, which should make emaint run without --ask. |
OP said emerge --sync worked the way they wanted it to.
p.s. I'm not savvy with that stuff. Just stating facts.
Best Regards,
Georgi |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|