[Gambas-user] multiple Gambas versions on the same machine

Tobias Boege taboege at gmail.com
Sat Jan 16 20:21:58 CET 2021


On Sat, 16 Jan 2021, Bruce Steers wrote:
> Awesome 😊
> Next K you can make a simple gambas app that stores the paths and quickly
> switches between versions , and share it with us 😋
> 

Such programs exist for other languages and the common elements by now
are reasonably well understood:

  - an `install vX.Y` command which pulls the release archive
    for Gambas X.Y, builds and installs it somewhere under $HOME
    (note: no su or sudo needed for this per-user install into
     their own home directory).

  - a `switch vX.Y` command to make the given version the currently
    active Gambas version. The selected version is merely recorded
    in some text file after checking that it is available.

  - an `env` command which outputs a PATH and GB_PATH environment
    variable setting for the currently selected Gambas version, like

      $ gambasbrew install v3.15.2
      ...
      OK
      $ gambasbrew switch v3.15.2
      OK
      $ gambasbrew env
      PATH="$HOME/gambas/v3.15.2/bin:$PATH"; export PATH;
      GB_PATH="$HOME/gambas/v3.15.2"; export GB_PATH;

    so that you can write in your shell rc file just

      eval "$(gambasbrew env)"

    to make your shell always use the Gambas version that was selected
    when you started the shell.

You are very much encouraged (by me) to add these features to your
installer or make a new project out of it. There are some arguments
as to why you should only mess with /usr through your package manager,
so by now I personally prefer installing all custom software into my
home directory (or /opt), always.

But I am unsure about installing libraries and components. Will they
end up in the right location...? Depends on who install them, right?

Best,
Tobias

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list