mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 10:36:12 +00:00
Fix IDE warnings
This commit is contained in:
@@ -164,14 +164,14 @@ func InstallPackages(rootDir string, forceInstallationReason InstallationReason,
|
|||||||
if rootDir != "/" {
|
if rootDir != "/" {
|
||||||
sourcePackages := make([]string, 0)
|
sourcePackages := make([]string, 0)
|
||||||
for _, action := range operation.Actions {
|
for _, action := range operation.Actions {
|
||||||
switch action.(type) {
|
switch action := action.(type) {
|
||||||
case *InstallPackageAction:
|
case *InstallPackageAction:
|
||||||
if action.(*InstallPackageAction).BpmPackage.PkgInfo.Type == "source" {
|
if action.BpmPackage.PkgInfo.Type == "source" {
|
||||||
sourcePackages = append(sourcePackages, action.(*InstallPackageAction).BpmPackage.PkgInfo.Name)
|
sourcePackages = append(sourcePackages, action.BpmPackage.PkgInfo.Name)
|
||||||
}
|
}
|
||||||
case *FetchPackageAction:
|
case *FetchPackageAction:
|
||||||
if action.(*FetchPackageAction).DatabaseEntry.Info.Type == "source" {
|
if action.DatabaseEntry.Info.Type == "source" {
|
||||||
sourcePackages = append(sourcePackages, action.(*FetchPackageAction).DatabaseEntry.Info.Name)
|
sourcePackages = append(sourcePackages, action.DatabaseEntry.Info.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package bpmlib
|
package bpmlib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@@ -169,14 +168,11 @@ func GetAllPackageFiles(rootDir string, excludePackages ...string) (map[string][
|
|||||||
}
|
}
|
||||||
bpmpkg := GetPackage(pkgName, rootDir)
|
bpmpkg := GetPackage(pkgName, rootDir)
|
||||||
if bpmpkg == nil {
|
if bpmpkg == nil {
|
||||||
return nil, errors.New(fmt.Sprintf("could not get BPM package (%s)", pkgName))
|
return nil, fmt.Errorf("could not get BPM package (%s)", pkgName)
|
||||||
}
|
}
|
||||||
for _, entry := range bpmpkg.PkgFiles {
|
for _, entry := range bpmpkg.PkgFiles {
|
||||||
if _, ok := ret[entry.Path]; ok {
|
|
||||||
ret[entry.Path] = append(ret[entry.Path], bpmpkg)
|
ret[entry.Path] = append(ret[entry.Path], bpmpkg)
|
||||||
} else {
|
|
||||||
ret[entry.Path] = []*BPMPackage{bpmpkg}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -178,10 +178,10 @@ func ReadPackage(filename string) (*BPMPackage, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
file, err := os.Open(filename)
|
file, err := os.Open(filename)
|
||||||
defer file.Close()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
defer file.Close()
|
||||||
|
|
||||||
tr := tar.NewReader(file)
|
tr := tar.NewReader(file)
|
||||||
for {
|
for {
|
||||||
@@ -304,14 +304,6 @@ func ReadPackageScripts(filename string) (map[string]string, error) {
|
|||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type packageOperation uint8
|
|
||||||
|
|
||||||
const (
|
|
||||||
packageOperationInstall packageOperation = 0
|
|
||||||
packageOperationUpdate = 1
|
|
||||||
packageOperationRemove = 2
|
|
||||||
)
|
|
||||||
|
|
||||||
func executePackageScript(pkg, rootDir string, verbose bool, packageScript string) error {
|
func executePackageScript(pkg, rootDir string, verbose bool, packageScript string) error {
|
||||||
var bpmpkg *BPMPackage
|
var bpmpkg *BPMPackage
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
Reference in New Issue
Block a user