Skip to Content.
Sympa Menu

sm-sorcery-bugs - [SM-Sorcery-Bugs] [Bug 6861] apprentice

sm-sorcery-bugs AT lists.ibiblio.org

Subject: Bugs for Sorcery are reported here

List archive

Chronological Thread  
  • From: bugzilla-daemon AT metalab.unc.edu
  • To: sm-sorcery-bugs AT lists.ibiblio.org
  • Subject: [SM-Sorcery-Bugs] [Bug 6861] apprentice
  • Date: Fri, 14 May 2004 02:47:12 -0400

http://bugs.sourcemage.org/show_bug.cgi?id=6861





------- Additional Comments From acedit AT armory.com 2004-05-14 02:47 -------
thats surprising as it was in the pre-sourcemage sorcery,
it was rumored to actually do something then too, although
I never tried it. I think it was slowly and surely coded around
and eventually disappeared.

Sandalle is correct in that it was implemented as symlinks (or aliases)
to an "apprentice" script, which presumably grepped some listing
that mapped commands to their spell, queried the user about casting
that spell and so forth. Pretty straightforward.

For example there was a /usr/bin/bc symlink to /usr/sbin/apprentice
and after I did an install I typed "bc" and magically I was prompted
about casting bc.

There was an "apprentice on" function, and there still is
an "apprentice off" function in libsorcery. Those presumably
created and destroyed all those symlinks (or aliases).

The question becomes, how do we generate the apprentice listing
when/how is it updated, what goes in it, what stays out, etc.

We could have apprentice as spell (in the smgl section) which
installs a file that contains all the aliases in /etc/profile.d/
along with the apprentice script itself. Alternatively if we used the
symlink implementation the spell could manage the symlinks.

However that makes dispelling the apprentice spell ugly if someone
cast right over the top of an apprentice file without doing it
through apprentice. The solution to that is to put all the
symlinks in some special sheltered directory (say
/var/lib/sorcery/apprentice/), then we can teach /etc/profile
about it.

On the other hand when someone casts over the top of an alias, the
alias will still exist and thus cause problems when running the real
command, which thus introduces the need for additional sorcery-fu to
fix that.

Of course aliases are not expanded for non-interactive shells, which
is nice because if a script wants to run a command we dont have it will
get the normal "command not found" stuff rather than asking the script
if it wants to cast, and asking it for a root password. Symlinks dont do
this, but we could always make apprentice smart enough to deal with being
run from a non-interactive place.

Finally. adding a large alias listing will slow down shell startup to some
extent, I have no evidence of how much though.

In either case, I say we make it a spell, not a sorcery feature.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




Archive powered by MHonArc 2.6.24.

Top of Page