DST 6.02 PRO Sts bug?

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

DST 6.02 PRO Sts bug?

ian-3
Just a relatively minor observation.

If you import a package into the Sts repository and subsequently load
the version from the repository, when you look at the packages in the
package browser the package doesn't appear in the correct folder it
appears in the root folder.

e.g. Extract the DSDN package to a \DSDN directory under My
documents\Dolphin... If you install the package through the package
browser then the DSDN.pac appears in a DSDN folder in the package
browser hierarchy tree. If instead of installing the package through
the package browser you import it into the repository and then load the
version through the package editions browser (?, not near my image so
can't remember exactly) the loaded package now appears under the root
($) directory instead of under \DSDN.

Ian


Reply | Threaded
Open this post in threaded view
|

Re: DST 6.02 PRO Sts bug?

David Gorisek-5
Ian,

you can fix this by changing the method StsDolphinPackageProxy
class>>#loadFrom:  (see below).

However, since package path is implicitly set by the package file
location, the package path which will be set during package import
depends on the file location from which you are importing the code.
Package pathname is not stored inside the .PAC file.

The reason why the package pathname is currently not being imported is
simply because if I work on some package, my version of that package is
already stored in the right folder. And when I get another version of
that package from someone else, I am not going to copy it over my
version on the disk. So I just have to import it from some other file
location. Importing a package from any other file location would mean
that the pathname is wrong anyway, so IMO it is better to just leave it
empty.

So to solve this problem, the "package folder location" as shown in the
IDE should be part of the PAC file contents.

If you are exchanging code between repositories then use STS projects
exports/imports (STP files) or STS package import/export (STZ files)
which will retain package pathname regardless of the actual file
location. The file format is compressed XML, so that it is very
convenient for exchanging code via e-mail.

Best regards,

David Gorisek


----
loadFrom: pathname
        | stream package |
        ((File splitExtensionFrom: pathname) sameAs: 'pac')
                ifFalse:
                        [MessageBox
                                errorMsg: 'The selected Dolphin Smalltalk package has an invalid
file format.
Only packages with extension .PAC can be imported into repository.'.
                        ^nil].
        stream := FileStream read: pathname text: false.
       
        [(STBInFiler peekForSignatureIn: stream)
                ifTrue:
                        [MessageBox
                                errorMsg: 'This package was saved with a different version of the
Dolphin VM(98.2).
The package can not be imported into repository. Please install the
package first.'.
                        ^nil].
        stream beText.
        package := self readFrom: stream.
        package isNil
                ifTrue:
                        [MessageBox errorMsg: 'Invalid package file, file can not be imported.'.
                        ^nil].
        package fileInFrom: stream]
                        ensure: [stream close].
        package packagePathname: (Package name: pathname) packagePathname.
        ^package


Ian wrote:

> Just a relatively minor observation.
>
> If you import a package into the Sts repository and subsequently load
> the version from the repository, when you look at the packages in the
> package browser the package doesn't appear in the correct folder it
> appears in the root folder.
>
> e.g. Extract the DSDN package to a \DSDN directory under My
> documents\Dolphin... If you install the package through the package
> browser then the DSDN.pac appears in a DSDN folder in the package
> browser hierarchy tree. If instead of installing the package through
> the package browser you import it into the repository and then load the
> version through the package editions browser (?, not near my image so
> can't remember exactly) the loaded package now appears under the root
> ($) directory instead of under \DSDN.
>
> Ian
>