profile.d comes with a explicit dependency on nano even when nano is not installed #24

Closed
opened 2024-01-10 17:25:45 +00:00 by udotirol · 3 comments
udotirol commented 2024-01-10 17:25:45 +00:00 (Migrated from gitlab2.manjaro.org)

when trying to configure a crontab for my user, I was greeted with the following message:

$ crontab -e
no crontab for udo - using an empty one
/bin/sh: line 1: /usr/bin/nano: No such file or directory
crontab: "/usr/bin/nano" exited with status 127

This is actually correct, I do not have nano installed on my workstation:

$ pacman -Qi nano
error: package 'nano' was not found

Now as it seems, manjaro-gnome-settings come with a hard dependency for nano in /etc/profile.d/nano-default-editor.sh, ignoring the fact, if it is installed in the system or not. In my case, I replaced nano in favour of vim.

IMHO the correct solution would be if the nano package provides this /etc/profile.d/nano-default-editor.sh file, or like in other distributions, to have dedicated nano-default-editor, vim-default-editor, emacs-default-editor, ... packages. This would make it easy to switch the default editor.

when trying to configure a crontab for my user, I was greeted with the following message: ``` $ crontab -e no crontab for udo - using an empty one /bin/sh: line 1: /usr/bin/nano: No such file or directory crontab: "/usr/bin/nano" exited with status 127 ``` This is actually correct, I do not have nano installed on my workstation: ``` $ pacman -Qi nano error: package 'nano' was not found ``` Now as it seems, manjaro-gnome-settings come with a hard dependency for nano in `/etc/profile.d/nano-default-editor.sh`, ignoring the fact, if it is installed in the system or not. In my case, I replaced nano in favour of vim. IMHO the correct solution would be if the nano package provides this /etc/profile.d/nano-default-editor.sh file, or like in other distributions, to have dedicated nano-default-editor, vim-default-editor, emacs-default-editor, ... packages. This would make it easy to switch the default editor.
yochananmarqos1 commented 2024-01-10 18:55:19 +00:00 (Migrated from gitlab2.manjaro.org)

I've dropped nano-default-editor.sh as it's not needed. The default editor is already set to nano in /etc/environment.

I've [dropped](https://gitlab.manjaro.org/profiles-and-settings/manjaro-gnome-settings/-/commit/1a78e98ca23272b7c79714d52883eca91f4ab211) `nano-default-editor.sh` as it's not needed. The default editor is already set to `nano` in [`/etc/environment`](https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/-/blob/7c1d02ded0068ed204b008deef7612437b3278db/manjaro/gnome/desktop-overlay/etc/environment#L7).
yochananmarqos1 (Migrated from gitlab2.manjaro.org) closed this issue 2024-01-10 18:55:20 +00:00
udotirol commented 2024-01-12 11:05:48 +00:00 (Migrated from gitlab2.manjaro.org)

thx.

Following your /etc/enviroment link, I see that nano is actually a shared root package

https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/-/blob/master/shared/Packages-Root

and so it makes some sense to have it registered as the EDITOR in /etc/environment. So I guess, without mangling with either the iso-profiles or the nano package, there is no easy fix for the case that nano has been uninstalled?

thx. Following your `/etc/enviroment` link, I see that `nano` is actually a shared root package https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/-/blob/master/shared/Packages-Root and so it makes some sense to have it registered as the EDITOR in `/etc/environment`. So I guess, without mangling with either the `iso-profiles` or the `nano` package, there is no easy fix for the case that nano has been uninstalled?
yochananmarqos1 commented 2024-01-14 21:33:40 +00:00 (Migrated from gitlab2.manjaro.org)

Whoops. I forgot I moved everything to /etc/profile.d/. I'm going to reverse the change I made. You can override any defaults in userspace.

FYI, I use micro instead of nano and use gedit for a graphical editor. I have this in my ~/.profile:

# an interactive switch between gedit under X or micro
# https://wiki.archlinux.org/title/Environment_variables#Default_programs
export EDITOR="$(if [[ -n $DISPLAY ]]; then echo 'gedit'; else echo 'micro'; fi)"
export SUDO_EDITOR="$(if [[ -n $DISPLAY ]]; then echo 'gedit'; else echo 'micro'; fi)"
export VISUAL="$(if [[ -n $DISPLAY ]]; then echo 'gedit'; else echo 'micro'; fi)"
Whoops. I forgot I moved everything to `/etc/profile.d/`. I'm going to reverse the change I made. You can override any defaults in userspace. FYI, I use `micro` instead of `nano` and use `gedit` for a graphical editor. I have this in my `~/.profile`: ``` # an interactive switch between gedit under X or micro # https://wiki.archlinux.org/title/Environment_variables#Default_programs export EDITOR="$(if [[ -n $DISPLAY ]]; then echo 'gedit'; else echo 'micro'; fi)" export SUDO_EDITOR="$(if [[ -n $DISPLAY ]]; then echo 'gedit'; else echo 'micro'; fi)" export VISUAL="$(if [[ -n $DISPLAY ]]; then echo 'gedit'; else echo 'micro'; fi)" ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
profiles/manjaro-gnome-settings#24
No description provided.