Compare commits

...

4 Commits

Author SHA1 Message Date
Lea Anthony
6203dba146 fix default libs identifier for solus 2020-05-27 10:34:37 +10:00
Lea Anthony
0cd8d6b760 Fix package detection for solus 2020-05-27 10:33:00 +10:00
Lea Anthony
7dd51bc4db update package names 2020-05-27 10:19:16 +10:00
Lea Anthony
8b1d20f979 Initial support for solus 2020-05-27 10:16:44 +10:00
3 changed files with 36 additions and 0 deletions

View File

@@ -61,6 +61,8 @@ const (
ArchLabs
// PopOS distribution
PopOS
// Solus distribution
Solus
)
// DistroInfo contains all the information relating to a linux distribution
@@ -163,6 +165,8 @@ func parseOsRelease(osRelease string) *DistroInfo {
result.Distribution = Leap
case "pop":
result.Distribution = PopOS
case "solus":
result.Distribution = Solus
default:
result.Distribution = Unknown
}
@@ -199,6 +203,17 @@ func DpkgInstalled(packageName string) (bool, error) {
return exitCode == 0, nil
}
// EOpkgInstalled uses dpkg to see if a package is installed
func EOpkgInstalled(packageName string) (bool, error) {
program := NewProgramHelper()
eopkg := program.FindProgram("eopkg")
if eopkg == nil {
return false, fmt.Errorf("cannot check dependencies: eopkg not found")
}
stdout, _, _, _ := eopkg.Run("info", packageName)
return strings.HasPrefix(stdout, "Installed"), nil
}
// PacmanInstalled uses pacman to see if a package is installed.
func PacmanInstalled(packageName string) (bool, error) {
program := NewProgramHelper()

View File

@@ -241,6 +241,25 @@ distributions:
gccversioncommand: *gccdumpfullversion
programs: *debiandefaultprograms
libraries: *debiandefaultlibraries
solus:
id: solus
releases:
default:
version: default
name: Solus
gccversioncommand: *gccdumpfullversion
programs: &solusdefaultprograms
- name: gcc
help: Please install with `sudo eopkg it -c system.devel` and try again
- name: pkg-config
help: Please install with `sudo eopkg it -c system.devel` and try again
- name: npm
help: Please install with `sudo eopkg it nodejs` and try again
libraries: &solusdefaultlibraries
- name: libgtk-3-devel
help: Please install with `sudo eopkg it libgtk-3-devel` and try again
- name: libwebkit-gtk-devel
help: Please install with `sudo eopkg it libwebkit-gtk-devel` and try again
opensuse-tumbleweed:
id: opensuse-tumbleweed

View File

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