pharo-project / pharo-launcher

Lets you manage your pharo images and download new ones
https://pharo-project.github.io/pharo-launcher/
MIT License
109 stars 46 forks source link

pharo-launcher vm list throws an error on Linux #657

Open demarey opened 10 months ago

demarey commented 10 months ago

pharo-launcher vm list throws an error on Linux (fgrep is obsolescent, use grep -F)

bug-pl

estebanlm commented 10 months ago

(fgrep is obsolescent, use grep -F) this is not the error, is just a warning of the script :)

Bajger commented 9 months ago

I tried to reproduce bug and executed vm list on Ubuntu, but works on my environment.

  1. 'fgrep' is not part of Pharo launcher source code. (looked for 'method source with it')
  2. Problem probably in obtaining of pharo version, most probably returns nil on particular (some old?) vm:

    PhLVmProvider class>>for:
    for: aPhLVirtualMachineOrManager
    | class |
    class := aPhLVirtualMachineOrManager pharoVersion asInteger < 90
        ifTrue: [ PhLVmProviderUntilPharo80 ]
        ifFalse: [ self ].
    
    ^ class new
        vmManager: aPhLVirtualMachineOrManager;
        yourself.
Bajger commented 9 months ago

What about using:

| class vmVersion|
        vmVersion := aPhLVirtualMachineOrManager pharoVersion.
    class := (vmVersion isNil or: [vmVersion asInteger < 90])
        ifTrue: [ PhLVmProviderUntilPharo80 ]
        ifFalse: [ self ].

    ^ class new
        vmManager: aPhLVirtualMachineOrManager;
        yourself.

@demarey What do you think? Is it systematic or we should trace down, why pharoVersion returns nil.

demarey commented 9 months ago

@estebanlm could you open the file ~/pharo/launcherSettings.ston (should be that on linux), check the value of vmsDirectory and give us the result of ls -R on this folder ?