scsh-users
[Top] [All Lists]

Re: os-error while loading package

To: scsh <scsh@zurich.csail.mit.edu>
Subject: Re: os-error while loading package
From: Andreas Bernauer <andreas.bernauer@gmx.de>
Date: Fri, 27 Feb 2004 12:12:16 -0500
Mail-followup-to: scsh <scsh@zurich.csail.mit.edu>
Andreas Bernauer wrote:
> I've installed the recent sunet-2.1 files with the current version of
> scsh-packages.  Everything's fine, except when I try to load the
> script (with the current scsh-0.6.6-beta):
> 
> [andreas@hgt scsh]$ scsh -lel sunet    
> 
> Error: exception
>        os-error
>        (channel-maybe-read 21 '#{Byte-vector (length 4096) 0 0 0 0 0 ---} 0 
> 4096 #t ---)
> [andreas@hgt scsh]$

Martin pointed out, that I am trying to load a directory instead of a
file, which doesn't work (hopefully currently).  Thanks a lot for
that.

This brings some other issue to my mind.  I haven't read all the
documentation on the new package proposal, but was there a reason why
load.scm is not loaded automatically if the argument is a directory?
After all, nobody wants to remember which package uses which
load-file-name.  And if the load-file is usually supposed to be
load.scm, why not use that name by default?  We can still allow to
specify a particular file.

The other issue is that scsh issues a warning when I load sunet:

[andreas@hgt sunet]$ scsh -lel  sunet-2.1/load.scm 

Warning: undefined variables
         #{Package 177 config}
         sxml-to-html
         sxml-tree-trans
Welcome to scsh 0.6.6 (beta version)

The problem is that some package in sunet requires SSAX, which I
haven't loaded.  I know this, because it's my package that causes the
problem.  However, for a regular user the error message is no help at
all.  Besides that the sunet documentation should point out the
dependency,  has there any thought be spend on dependencies?  E.g. if
I load sunet's load.scm the system realizes that this/some package
needs SSAX and thus tries to load SSAX, indicating a warning, if it
can't do so.  

This could be implemented in the install package.  The install package
might allow the developer to specify some dependencies like

(dependency '(SSAX))

[ or even
(dependency '((SSAX . ( 2 . 1))))
indicating a minimum version number, which can't be implemented so easily.]

and includes load commands into load.scm before the load commands to
the other configuration files.  The result in sunet/load.scm would
look like this:

(user)
(config)
(load "/home/andreas/bin/lib/scsh/modules/SSAX/scheme/packages")
(load "/home/andreas/bin/lib/scsh/modules/sunet-2.1/scheme/packages.scm")
(load 
"/home/andreas/bin/lib/scsh/modules/sunet-2.1/scheme/httpd/surflets/packages.scm")
(user)

assuming SSAX can be installed as a package like this, which it isn't
currently as far as I know.

The problem with that approach is that if load.scm tries to load a
file that does not exist (i.e. SSAX hasn't been installed that way),
scsh issues an error and exits.  While this is better than the warning
message we currently get, it would be even "more" better if we could
make scsh just warn and continue instead of bailing out.  I don't know
how this is possible, though.

What do you think about that?

Andreas.

Attachment: pgpQIn1B74OlC.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>