Re: emacs and /etc/alternatives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2007-03-09 at 14:12 -0500, Jesse Keating wrote:
> On Friday 09 March 2007 14:02:13 Toshio Kuratomi wrote:
> > I don't believe circular depenencies per se are problems.  Certain
> > instances are.  (Someone please correct me if I'm wrong, here.)  In this
> > case, breaking out the dependency into a virtual provides would be the
> > standard way to show that emacs-common requires one of /usr/bin/emacs-x
> > or /usr/bin/emacs-nox.
> >
> > ### Main package is old emacs-common
> > Requires: binemacs = %{version}-%{release}
> >
> > %package x
> > Provides: binemacs = %{version}-%{release}
> > Requires: %{name} = %{version}-%{release}
> >
> > %package nox
> > Provides: binemacs = %{version}-%{release}
> > Requires: %{name} = %{version}-%{release}
> >
> > s/binemacs/WhateverVirtualProvideStrikesYourFancy/
> 
> I thought about this, but what stopped me was I kept thinking that one would 
> want to set a preference in the /usr/bin/emacs file, and that would require 
> modification of the file, or an /etc/ file to set preference which led be 
> back to well, we have alternatives....
> 
> Of course, if we don't give a care what /usr/bin/emacs runs, so long as it 
> runs, then we could keep the script as is and use this Provides method and 
> move on.

As we've seen from the discussion about alternatives setting the
preference at the wrong level; setting the preference in /usr/bin/emacs
is pushing a user-preference out to the system where it doesn't belong.
We want the user to set the preference.  The script needs slight
modification to have a preferred value passed in via ENV VAR.

#!/bin/sh

PROG_NAME=`basename $0`

for i in $PREFERRED_EMACS x nox; do
  [ -x "/usr/bin/${PROG_NAME}-$i" ] && exec -a
${PROG_NAME} /usr/bin/${PROG_NAME}-$i "$@"
done

echo "Can't find $PROG_NAME" 1>&2
exit 1

The user can set PREFERRED_EMACS to x or nox or kde or wx or whatever
interfaces the future GNU emacs supports.  If its installed on this
system, it'll be invoked, else the script falls back to looking for an
emacs to run.

If there were a multitude of options, you could even set your own
fallback order.

-Toshio

Attachment: signature.asc
Description: This is a digitally signed message part

--
Fedora-maintainers mailing list
Fedora-maintainers@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-maintainers
--
Fedora-maintainers-readonly mailing list
Fedora-maintainers-readonly@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-maintainers-readonly

[Index of Archives]     [Fedora Users]     [Fedora Development]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux