Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] $EDITOR undefined when spell is cast

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Jaka Kranjc <smgl AT lynxlynx.info>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] $EDITOR undefined when spell is cast
  • Date: Tue, 05 Jun 2012 14:08:13 +0200

On Tuesday 05 of June 2012 07:21:30 Sukneet Basuta wrote:
> On Tue, Jun 5, 2012 at 2:22 AM, Andraž 'ruskie' Levstik
>
> <ruskie AT codemages.net> wrote:
> > :2012-06-04T21:49:Sukneet Basuta:
> >> Is $EDITOR expected to be defined when a spell is cast? The dwm spell
> >> and a few others seem to assume to.
> >> If so, nothing seems to create a .bashrc file for root, leaving
> >> $EDITOR undefined unless you manually create it. Perhaps, the bash
> >> spell can copy /etc/skel/.bashrc to /root/.bashrc to resolve this
> >> issue.
> >
> > It gets set by /etc/profile.d/editor.sh
>
> Sorry, I should have been more explicit. Running cast with sudo leaves
> $EDITOR unset. sudo does not start a login shell, thus /etc/profile is
> never run.
>
> Looking into this a bit more, it looks like the "proper" way is to set
> BASH_ENV in /etc/enviornment to ~/.bashrc or ~/.bash_profile and then
> possibly sourcing /etc/profile.d/editor.sh in that file. Or sorcery
> can possibly source /etc/profile.d/editor.sh to ensure it is set.
Spells can take care of this themselves and a lot do. Setting QTDIR comes to
mind, but we've already deprecated qt(3)-x11.

So just check that it exists, source the file and use a fallback from
basesystem if the variable ends up being empty.

LP
--
To err is humor




Archive powered by MHonArc 2.6.24.

Top of Page