mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 02:26:12 +00:00
Fix package installation reason not being displayed or set correctly
This commit is contained in:
+32
-1
@@ -19,7 +19,8 @@ const (
|
||||
)
|
||||
|
||||
// InstallPackages installs the specified packages into the given root directory by fetching them from databases or directly from local bpm archives
|
||||
func InstallPackages(rootDir string, installationReason InstallationReason, reinstallMethod ReinstallMethod, installOptionalDependencies, forceInstallation, verbose bool, packages ...string) (operation *BPMOperation, err error) {
|
||||
func InstallPackages(rootDir string, forceInstallationReason InstallationReason, reinstallMethod ReinstallMethod, installOptionalDependencies, forceInstallation, verbose bool, packages ...string) (operation *BPMOperation, err error) {
|
||||
|
||||
// Setup operation struct
|
||||
operation = &BPMOperation{
|
||||
Actions: make([]OperationAction, 0),
|
||||
@@ -44,6 +45,16 @@ func InstallPackages(rootDir string, installationReason InstallationReason, rein
|
||||
continue
|
||||
}
|
||||
|
||||
// Set package installation reason
|
||||
installationReason := forceInstallationReason
|
||||
if installationReason == InstallationReasonUnknown {
|
||||
if IsPackageInstalled(splitPkg.Name, rootDir) {
|
||||
installationReason = GetInstallationReason(splitPkg.Name, rootDir)
|
||||
} else {
|
||||
installationReason = InstallationReasonManual
|
||||
}
|
||||
}
|
||||
|
||||
operation.AppendAction(&InstallPackageAction{
|
||||
File: pkg,
|
||||
InstallationReason: installationReason,
|
||||
@@ -58,6 +69,16 @@ func InstallPackages(rootDir string, installationReason InstallationReason, rein
|
||||
continue
|
||||
}
|
||||
|
||||
// Set package installation reason
|
||||
installationReason := forceInstallationReason
|
||||
if installationReason == InstallationReasonUnknown {
|
||||
if IsPackageInstalled(bpmpkg.PkgInfo.Name, rootDir) {
|
||||
installationReason = GetInstallationReason(bpmpkg.PkgInfo.Name, rootDir)
|
||||
} else {
|
||||
installationReason = InstallationReasonManual
|
||||
}
|
||||
}
|
||||
|
||||
operation.AppendAction(&InstallPackageAction{
|
||||
File: pkg,
|
||||
InstallationReason: installationReason,
|
||||
@@ -84,6 +105,16 @@ func InstallPackages(rootDir string, installationReason InstallationReason, rein
|
||||
continue
|
||||
}
|
||||
|
||||
// Set package installation reason
|
||||
installationReason := forceInstallationReason
|
||||
if installationReason == InstallationReasonUnknown {
|
||||
if IsPackageInstalled(entry.Info.Name, rootDir) {
|
||||
installationReason = GetInstallationReason(entry.Info.Name, rootDir)
|
||||
} else {
|
||||
installationReason = InstallationReasonManual
|
||||
}
|
||||
}
|
||||
|
||||
operation.AppendAction(&FetchPackageAction{
|
||||
InstallationReason: installationReason,
|
||||
DatabaseEntry: entry,
|
||||
|
||||
Reference in New Issue
Block a user