[Surfraw-devel] namespace issues + some small changes

Ian Beckwith ianb@nessie.mcc.ac.uk
Wed, 10 Sep 2003 22:10:43 +0100


Hi.

I'm back from my travels.

Christian wrote:

> > Attached is a tar.gz of the elvi (imdb, cddb, freedb, bbcnews) I
> > wrote, plus a patch for google to add -l for "I'm feeling lucky".
> 
> are this patch now in cvs? sorry but I can't check now...

I've just committed the google patch to cvs (thanks, whoever gave me
cvs access), along with modifications to sourceforge to implement
search options, a new alioth elvi, and a trivial change to debpackages
to document the fact that -distro=all works.

bbcnews, cddb, imdb and freedb have all been already checked in for me
by Stephen.

> > Looking at the BTS (#131661), someone else has written an imdb elvi (what's
> > the singular? elvis?) Feel free to use his if it's better, I won't be hurt :)
> 
> Did you check them?

Functionally, they are pretty much the same.

Kevin wrote:

> > TO USE SURFRAW: run "sr <elvis-name> <search terms>"
> > OR run "surfraw --update-rc-files" to add the elvi to your $PATH.
> >
> > Does this seem reasonable?  Adding the change should be easy, just appending a 
> > line or two to the end of the correct dotfile.
> 
> I'm not really for it.  Keep in mind our audience.  This program is
> used by people who want to stay at a command prompt as much as
> possible.  Setting their $PATH is generally trivial for them, and they
> generally don't want random programs messing with their dotfiles.

If we changed the message to something like

TO USE SURFRAW: run "sr <elvis-name> <search terms>"
OR run "surfraw --update-rc-files" to append /usr/bin/surfraw/ to your $PATH.

experienced users then have the info to manually change it.

The --update-rc-files option is potentially tricky if we want to cater
for every weird shell out there, but bash & tcsh support would probably
cater for the vast majority.

We should probably have a debconf option so the sysadmin can add it to
the default path, or at least a message explaining the changes.

> More importantly, it still doesn't really solve the problem, because
> while surfraw and rhyme (for instance) will no longer conflict in the
> Debian package sense, they will still continue to conflict as far as
> use goes.  Let's say I install surfraw and rhyme both, and do the
> --update-rc-files bit.  When I type 'rhyme' into my command prompt,
> which program runs?  How are you going to explain why the other
> doesn't to a person who doesn't understand enough about their $PATH to
> set it?

I think (at least by default) we should stick the surfraw dir at the end,
because if there is a clash the user can still do "sr elviname"

I'd rather avoid a solution which involves renaming all the elvi,
because without using (autogenerated?) aliases, everyone will have to
reprogram their brain to type (eg) srgoogle instead of google.

I suspect there is no 100% elegant solution to the namespace issues.

So, my vote is to move the elvi somewhere, provide the
--update-rc-files option to append that dir to the path, modify
surfraw to take an elvis as an argument, and creat 'sr' as an alias to
surfraw.

Ian.