add support for crux linux (#581)

* Add support for Crux Linux (http://crux.nu)

* Update linuxdb.yaml

fix typo

* Update linux.go

fixed comment typo

* Update linuxdb.yaml

fixed more typos

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
Alexander Matviychuk
2021-02-05 13:54:59 +09:00
committed by GitHub
parent cbd9eca6c3
commit 9167508302
3 changed files with 36 additions and 0 deletions

View File

@@ -67,6 +67,8 @@ const (
Ctlos
// EndeavourOS linux distribution
EndeavourOS
// Crux linux distribution
Crux
)
// DistroInfo contains all the information relating to a linux distribution
@@ -175,6 +177,8 @@ func parseOsRelease(osRelease string) *DistroInfo {
result.Distribution = Solus
case "endeavouros":
result.Distribution = EndeavourOS
case "crux":
result.Distribution = Crux
default:
result.Distribution = Unknown
}
@@ -255,6 +259,17 @@ func RpmInstalled(packageName string) (bool, error) {
return exitCode == 0, nil
}
// PrtGetInstalled uses prt-get to see if a package is installed
func PrtGetInstalled(packageName string) (bool, error) {
program := NewProgramHelper()
prtget := program.FindProgram("prt-get")
if prtget == nil {
return false, fmt.Errorf("cannot check dependencies: prt-get not found")
}
_, _, exitCode, _ := prtget.Run("isinst", packageName)
return exitCode == 0, nil
}
// RequestSupportForDistribution promts the user to submit a request to support their
// currently unsupported distribution
func RequestSupportForDistribution(distroInfo *DistroInfo) error {

View File

@@ -307,3 +307,22 @@ distributions:
gccversioncommand: *gccdumpfullversion
programs: *opensusedefaultprograms
libraries: *opensusedefaultlibraries
crux:
id: crux
releases:
default:
version: default
name: Crux Linux
gccversioncommand: *gccdumpversion
programs:
- name: gcc
help: Please install with `sudo prt-get depinst gcc-c++ make` and try again
- name: pkg-config
help: Please install with `sudo prt-get depinst pkg-config` and try again
- name: npm
help: Please install with `sudo prt-get depinst nodejs` and try again
libraries:
- name: gtk3
help: Please install with `sudo prt-get depinst gtk3` and try again
- name: webkitgtk
help: Please install with `sudo prt-get depinst webkitgtk` and try again

View File

@@ -286,6 +286,8 @@ func CheckDependencies(logger *Logger) (bool, error) {
libraryChecker = XbpsInstalled
case Solus:
libraryChecker = EOpkgInstalled
case Crux:
libraryChecker = PrtGetInstalled
default:
return false, RequestSupportForDistribution(distroInfo)
}