[Gambas-user] Gambas setup compile and install script.

Bruce adamnt42 at gmail.com
Thu Oct 15 00:41:37 CEST 2020


On 15/10/20 6:44 am, Bruce Steers wrote:
>> 5) You must detect if there is already a Gambas installation by running
>> "gbx3", finding where it is installed to find the Gambas installation
>> prefix, and then tell the user before aborting the script (unless you
>> can detect if it was installed by package or manually to remove it, but
>> I don't think so).
>>
> 
> I worked out the following commands listed all installed gambas3 components
> only if installed by package manager and listed nothing if installed by
> make.
> apt
> 
> *$(apt list gambas3* 2>/dev/null|grep 'installed'|awk {'print $1'})*
> pacman
> 
> *$(pacman -Qsq gambas3* 2>/dev/null)*
> pacman listed just the package names and apt gave a string like
> "gambas3-ide/stable,now 3.12.2-1 all [installed,automatic]" so i just split
> the string left of the / (not that there is need to with apt as regex* can
> be used)
> 
> So with apt systems I issue a 'apt-get purge gambas3*'
> with pacman i had to provide the list of packages, It's been tested and now
> working on both those packagers
> I detects the existing installation if present at the start of the script
> and informs the user it will be removed just before the 'make install'
> command is run.
> I did it that way so if the compilation fails the user will still have
> their existing gambas installed.
> 
> I'm going to have to download and install alpine to get it working for apk
> though.
> 
> https://github.com/BruceSteers/gambas3-compile-and-install/tree/testing
> 
> Wishing Well
> Bruce

Just as a matter of interest, why don't you check for the libraries 
rather than the packages. automake knows nothing of packages, the only 
time you need a particular distro package is when some library or dev 
header  is missing. The packages that contain the library can and 
sometimes do chnage at the whim of the distro.

b


More information about the User mailing list