Comments (15)
that's weird, but since i can't reproduce the problem in arch - i'm closing this one
from pikaur.
what the output of sudo --preserve-env=EDITOR bash -c 'echo $EDITOR'
?
also install latest pikaur-git
and upload the log again please
from pikaur.
Well, there we have it:
❯ sudo --preserve-env=EDITOR bash -c 'echo $EDITOR'
nano
(as a note: without specifying the EDITOR
in preserve-env, the result is nvim
, as expected)
And for the logs:
:: debug: install_info_fetcher: got AUR pkgs install info: []
=> pacman --color=always --query --upgrades --quiet
=> pacman --color=always --sync lib32-libgudev --print-format %r/%n
:: debug: install_cli: self.install_info.all_install_info_containers=([<RepoInstallInfo "lib32-libgudev" 237-2 -> 238-1>], [], [], [], [], [], [], [])
:: debug: news: print
:: debug: news: loading date from /home/telmar/.cache/pikaur/last_seen_news.dat
:: debug: news: data: Sun, 18 Jun 2023 09:14:37 +0000, parsed: 2023-06-18 09:14:37+00:00
:: debug: news: Arch News Date: 2023-06-18 09:14:37+00:00, Last-seen date: 2023-06-18 09:14:37+00:00
:: Repository package will be installed:
lib32-libgudev 237-2 -> 238-1
:: debug: prompt: Gonna get input from user...
:: debug: FileLock: Acquiring /tmp/pikaur_prompt_502584.lock...
:: debug: FileLock: Acquired /tmp/pikaur_prompt_502584.lock
:: debug: prompt_nolock: Restoring TTY...
:: debug: prompt_nolock: Using standard input reader...
:: Proceed with installation? [Y/n]
:: [v]iew package details [m]anually select packages
>> m
:: debug: FileLock: Releasing /tmp/pikaur_prompt_502584.lock
:: debug: FileLock: Released /tmp/pikaur_prompt_502584.lock
:: debug: prompt: Got answer: 'm'
:: debug: prompt: Found editor: nano
=> sudo --user=#1000 --preserve-env=EDITOR -- nano /tmp/tmp5m5azstn
So that explains the "bug". Thanks for the help!
Update: I fixed it by specifying to preserve the EDITOR in the sudoers file, but since I didn't needed that before, I'll let you choose if you want to chose the issue or not.
from pikaur.
weird - did you previously altered your sudoers file?
i have default config file from arch linux and it being preserved, so in the first case i'm seeing output of EDITOR set in the current user, not in root
from pikaur.
No, I never edited it before.
I use endeavour, not pure arch, but it should be globally the same file I think
from pikaur.
Same issue here, using Manjaro.
> echo $EDITOR
vim
> sudo --preserve-env=EDITOR bash -c 'echo $EDITOR'
usr/bin/nano
My fix is add the following to /etc/sudoers
(remember to use visudo
)
Defaults env_keep += "EDITOR VISUAL"
from pikaur.
For me, the culprit was /etc/environment
where Cnchi (legacy installer of Antergos) added EDITOR=/usr/bin/nano
. And since pikaur is using a non-interactive shell, that was used instead of user (interactive) configuration like ~/.bashrc
.
from pikaur.
i wonder, if it would be better then to spawn commands with some different sudo flags?
from pikaur.
Running the editor as user would be ideal imo. With sudo -E
you get the same experience as if you were the user, but with potential for file ownership issues (e.g. Neovim; new files are owned by root and typically not writable by the user after that)
from pikaur.
no, preserving all env variables (-E) wouldn't work in this case:
your user
|
v
sudo pikaur
|-----------|
v v
pacman sudo -u your_user EDITOR_CMD
because in that case all your env variables would end up in pacman, while it should be running with root's env vars
from pikaur.
Running the editor as user would be ideal imo
and this is a good point - i've just realized that during build and during PKGBUILD review editor command is not changing the user properly, i'll fix this
from pikaur.
I see. Maybe sudo -i
then? It doesn't preserve the original environment though.
from pikaur.
please don't do any suggestions, if you don't know for sure
from pikaur.
I read the man page and from my experience it looks like a reasonable solution. But I haven't read the source code of pikaur from start to finish nor did I try every possible user configuration to make sure this is definitely the way to go. Maybe I will, but probably not.
My first suggestion was under the assumption that pikaur is run as user and elevates privileges only for pacman, which is not unreasonable to assume.
from pikaur.
My first suggestion was under the assumption that pikaur is run as user and elevates privileges only for pacman, which is not unreasonable to assume.
that's described in readme, reading is usually more effective than asuming ;)
from pikaur.
Related Issues (20)
- mark internally already built packages, thus avoid need to call pkgver() of pkgbuild of verifying if that version is already installed
- `pikaur -Syu --devel` fails for unsatisfied dependencies used in prepare() HOT 1
- Pikaur crashes when dealing with self-circular dependencies HOT 3
- Can't run as root, outputs "AttributeError: 'NoneType' object has no attribute 'split'"
- Add an option to delete dependencies that are no longer required
- `pikaur -Sla` fails with `pacman: invalid option` HOT 1
- Installation: AttributeError: module 'datetime' has no attribute 'UTC' HOT 1
- Pikaur asks for gitlab username while trying to retrieve split packages HOT 3
- Failing to bulid any AUR package: "Cannot find the debugedit binary" HOT 3
- `KeepBuildDeps` not being honored HOT 2
- Off by one eror in error message when choosing between packages
- Pikaur incorrectly treat runtime dependencies as make dependencies HOT 6
- pikaur gives only a ValueError when executed HOT 4
- python update breaks pikaur HOT 8
- new version Pikaur v1.20 asks for root for operations that didn't ask before HOT 1
- pikaur build fails due to missing python module "build" HOT 1
- `pikaur -P` to warn if running from within the pikaur build directory
- remember that I checked files when build fails
- Request: Option to add git safe.directory exception HOT 1
- pikaur 1.21 is broken on Manjaro aarch64 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pikaur.