Metacello and file repositories

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Metacello and file repositories

Torsten Bergmann
After a short debug session I've found it:

Metacello extracts the repository type from the spec
(see #extractTypeFromDescription: method).

Either it begins with
  ftp://        -> FTP is used
  /             -> a directory is used  
  dictionary:   -> a dictionary is used

In any other case the default "http" is used as type.

This is OK for directory names in unix and Mac, but not
on windows platforms. If you write "c:\temp\foo" it will
not catch the directory and set the type to http which is wrong.

A short workaround is to implement MetacelloPlatform>>extractTypeFromDescription:
like this:

   extractTypeFromDescription: description

        description == nil ifTrue: [ ^nil ].
        ((description beginsWith: '/') or: [description second = $:]) ifTrue: [ ^'directory' ].
        (description beginsWith: 'dictionary://') ifTrue: [ ^'dictionary' ].
        ^'http'

since on Windows you typically have the drive letter followed by a colon.
I can load my config then. Dale: can you include this for now?

However - this just works for absolute paths - not relative.
Maybe Monticello/Metacello should switch to "file://" for directory
repositories to stay platform independent in the future...

Bye
T.

 
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project