Loading GitHub repositories in Pharo 4

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

Loading GitHub repositories in Pharo 4

Sven Van Caekenberghe-2
Hi,

Like others I seem to have trouble loading GitHub repositories, in Pharo 4 in my case.

Basically, the following fails:

Metacello new
   baseline: 'P3';
   repository: 'github://svenvc/P3';
   load.

But it also fails as dependency when specified like this:

baseline: 'P3' with: [
   spec repository: 'github://svenvc/P3' ];

The problem seems to be related to the version info and meta data. (This project was created with Iceberg).

MCFileTreeStCypressReader>>#loadVersionInfo
  self hasMonticelloMetadata
    ifTrue: [ ^ info := self extractInfoFrom: (self parseMember: 'version') ].
  ...

The test #hasMonticelloMetadata succeeds, but 'version' is not found in /Users/sven/Tmp/pharo4/github-cache/svenvc/P3/master/svenvc-P3-6897866/BaselineOfP3.package/monticello.meta/version

In the above method, there seems to be code to handle missing meta data, but it is not reached.

Is this supposed to work ?
Is there a way around this ?

Thx,

Sven
Reply | Threaded
Open this post in threaded view
|

Re: Loading GitHub repositories in Pharo 4

Sven Van Caekenberghe-2

> On 13 Jul 2017, at 11:10, Sven Van Caekenberghe <[hidden email]> wrote:
>
> Hi,
>
> Like others I seem to have trouble loading GitHub repositories, in Pharo 4 in my case.
>
> Basically, the following fails:
>
> Metacello new
>   baseline: 'P3';
>   repository: 'github://svenvc/P3';
>   load.
>
> But it also fails as dependency when specified like this:
>
> baseline: 'P3' with: [
>   spec repository: 'github://svenvc/P3' ];
>
> The problem seems to be related to the version info and meta data. (This project was created with Iceberg).
>
> MCFileTreeStCypressReader>>#loadVersionInfo
>  self hasMonticelloMetadata
>    ifTrue: [ ^ info := self extractInfoFrom: (self parseMember: 'version') ].
>  ...
>
> The test #hasMonticelloMetadata succeeds, but 'version' is not found in /Users/sven/Tmp/pharo4/github-cache/svenvc/P3/master/svenvc-P3-6897866/BaselineOfP3.package/monticello.meta/version
>
> In the above method, there seems to be code to handle missing meta data, but it is not reached.
>
> Is this supposed to work ?
> Is there a way around this ?

I copied the following from a Pharo 6 image to the Pharo 4 image, Thierry's newer version:

MCFileTreeAbstractReader>>#hasMonticelloMetadata
    ^ (self fileUtils
                filePathExists: 'version'
                relativeTo:
                        (self fileUtils
                                directoryFromPath: MCFileTreeStCypressWriter monticelloMetaDirName
                                relativeTo: packageDirectory))
                or:
                        [ (self fileUtils
                                filePathExists: 'version'
                                relativeTo: packageDirectory)
                                and:
                                        [ self fileUtils
                                                filePathExists: 'package'
                                                relativeTo: packageDirectory ] ]

Which does the trick ! (It tests for 'version' explicitly).

Is there a clean way to get this newer code in a 4.0 image ?

Where does MonticelloFileTree-Core live when not integrated ?

> Thx,
>
> Sven


Reply | Threaded
Open this post in threaded view
|

Re: Loading GitHub repositories in Pharo 4

Thierry Goubier
Le 13/07/2017 à 11:34, Sven Van Caekenberghe a écrit :

>
>> On 13 Jul 2017, at 11:10, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>> Hi,
>>
>> Like others I seem to have trouble loading GitHub repositories, in Pharo 4 in my case.
>>
>> Basically, the following fails:
>>
>> Metacello new
>>    baseline: 'P3';
>>    repository: 'github://svenvc/P3';
>>    load.
>>
>> But it also fails as dependency when specified like this:
>>
>> baseline: 'P3' with: [
>>    spec repository: 'github://svenvc/P3' ];
>>
>> The problem seems to be related to the version info and meta data. (This project was created with Iceberg).
>>
>> MCFileTreeStCypressReader>>#loadVersionInfo
>>   self hasMonticelloMetadata
>>     ifTrue: [ ^ info := self extractInfoFrom: (self parseMember: 'version') ].
>>   ...
>>
>> The test #hasMonticelloMetadata succeeds, but 'version' is not found in /Users/sven/Tmp/pharo4/github-cache/svenvc/P3/master/svenvc-P3-6897866/BaselineOfP3.package/monticello.meta/version
>>
>> In the above method, there seems to be code to handle missing meta data, but it is not reached.
>>
>> Is this supposed to work ?
>> Is there a way around this ?
>
> I copied the following from a Pharo 6 image to the Pharo 4 image, Thierry's newer version:
>
> MCFileTreeAbstractReader>>#hasMonticelloMetadata
>      ^ (self fileUtils
> filePathExists: 'version'
> relativeTo:
> (self fileUtils
> directoryFromPath: MCFileTreeStCypressWriter monticelloMetaDirName
> relativeTo: packageDirectory))
> or:
> [ (self fileUtils
> filePathExists: 'version'
> relativeTo: packageDirectory)
> and:
> [ self fileUtils
> filePathExists: 'package'
> relativeTo: packageDirectory ] ]
>
> Which does the trick ! (It tests for 'version' explicitly).

Yes, I added that to handle the switch to the Metadata-less format.

> Is there a clean way to get this newer code in a 4.0 image ?

Yes. Load FileTree from its repository.

> Where does MonticelloFileTree-Core live when not integrated ?

github, where else?

(https://github.com/dalehenrich/filetree)

Regards,

Thierry

>> Thx,
>>
>> Sven
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Loading GitHub repositories in Pharo 4

Sven Van Caekenberghe-2

> On 13 Jul 2017, at 15:00, Thierry Goubier <[hidden email]> wrote:
>
> Le 13/07/2017 à 11:34, Sven Van Caekenberghe a écrit :
>>> On 13 Jul 2017, at 11:10, Sven Van Caekenberghe <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> Like others I seem to have trouble loading GitHub repositories, in Pharo 4 in my case.
>>>
>>> Basically, the following fails:
>>>
>>> Metacello new
>>>   baseline: 'P3';
>>>   repository: 'github://svenvc/P3';
>>>   load.
>>>
>>> But it also fails as dependency when specified like this:
>>>
>>> baseline: 'P3' with: [
>>>   spec repository: 'github://svenvc/P3' ];
>>>
>>> The problem seems to be related to the version info and meta data. (This project was created with Iceberg).
>>>
>>> MCFileTreeStCypressReader>>#loadVersionInfo
>>>  self hasMonticelloMetadata
>>>    ifTrue: [ ^ info := self extractInfoFrom: (self parseMember: 'version') ].
>>>  ...
>>>
>>> The test #hasMonticelloMetadata succeeds, but 'version' is not found in /Users/sven/Tmp/pharo4/github-cache/svenvc/P3/master/svenvc-P3-6897866/BaselineOfP3.package/monticello.meta/version
>>>
>>> In the above method, there seems to be code to handle missing meta data, but it is not reached.
>>>
>>> Is this supposed to work ?
>>> Is there a way around this ?
>> I copied the following from a Pharo 6 image to the Pharo 4 image, Thierry's newer version:
>> MCFileTreeAbstractReader>>#hasMonticelloMetadata
>>     ^ (self fileUtils
>> filePathExists: 'version'
>> relativeTo:
>> (self fileUtils
>> directoryFromPath: MCFileTreeStCypressWriter monticelloMetaDirName
>> relativeTo: packageDirectory))
>> or:
>> [ (self fileUtils
>> filePathExists: 'version'
>> relativeTo: packageDirectory)
>> and:
>> [ self fileUtils
>> filePathExists: 'package'
>> relativeTo: packageDirectory ] ]
>> Which does the trick ! (It tests for 'version' explicitly).
>
> Yes, I added that to handle the switch to the Metadata-less format.
>
>> Is there a clean way to get this newer code in a 4.0 image ?
>
> Yes. Load FileTree from its repository.
>
>> Where does MonticelloFileTree-Core live when not integrated ?
>
> github, where else?
>
> (https://github.com/dalehenrich/filetree)

Thanks for the reply.

After some trial and error, the simplest way to get your patch in a Pharo 4 image is by doing

Metacello new
  baseline: 'FileTree';
  repository: 'github://dalehenrich/filetree:pharo4.0/repository';
  load.

After that, I can do meta-data-less code loading.

> Regards,
>
> Thierry
>
>>> Thx,
>>>
>>> Sven