mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-20 20:46:13 +00:00
Compare commits
2
Commits
0.7.1
...
677da23c9d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
677da23c9d
|
||
|
|
7f279ef8e9
|
+24
-6
@@ -240,11 +240,12 @@ func showPackageInfo() {
|
|||||||
|
|
||||||
for n, pkg := range packages {
|
for n, pkg := range packages {
|
||||||
if showDatabaseInfo {
|
if showDatabaseInfo {
|
||||||
var err error
|
// Split package name and required version
|
||||||
var entry *bpmlib.BPMDatabaseEntry
|
pkgName, _, _ := bpmlib.SplitPkgNameAndVersion(pkg)
|
||||||
entry, _, err = bpmlib.GetDatabaseEntry(pkg)
|
|
||||||
|
entry, _, err := bpmlib.GetDatabaseEntry(pkgName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if providers := bpmlib.GetDatabaseVirtualPackageEntry(pkg); len(providers) > 0 {
|
if providers := bpmlib.GetDatabaseVirtualPackageEntry(pkgName); len(providers) > 0 {
|
||||||
entry = providers[0]
|
entry = providers[0]
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Error: could not find package (%s) in any database\n", pkg)
|
log.Printf("Error: could not find package (%s) in any database\n", pkg)
|
||||||
@@ -253,6 +254,12 @@ func showPackageInfo() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !bpmlib.EvaluateDependency(pkg, entry.Info.Version) {
|
||||||
|
log.Printf("Error: could not find package (%s) in any database\n", pkg)
|
||||||
|
exitCode = 1
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if n != 0 {
|
if n != 0 {
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
}
|
}
|
||||||
@@ -272,17 +279,28 @@ func showPackageInfo() {
|
|||||||
}
|
}
|
||||||
isFile = true
|
isFile = true
|
||||||
} else {
|
} else {
|
||||||
if providers := bpmlib.GetVirtualPackageInfo(pkg, rootDir); len(providers) > 0 {
|
// Split package name and required version
|
||||||
|
pkgName, _, _ := bpmlib.SplitPkgNameAndVersion(pkg)
|
||||||
|
|
||||||
|
if providers := bpmlib.GetVirtualPackageInfo(pkgName, rootDir); len(providers) > 0 {
|
||||||
bpmpkg = bpmlib.GetPackage(providers[0].Name, rootDir)
|
bpmpkg = bpmlib.GetPackage(providers[0].Name, rootDir)
|
||||||
} else {
|
} else {
|
||||||
bpmpkg = bpmlib.GetPackage(pkg, rootDir)
|
bpmpkg = bpmlib.GetPackage(pkgName, rootDir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if bpmpkg == nil {
|
if bpmpkg == nil {
|
||||||
log.Printf("Error: package (%s) is not installed\n", pkg)
|
log.Printf("Error: package (%s) is not installed\n", pkg)
|
||||||
exitCode = 1
|
exitCode = 1
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !bpmlib.EvaluateDependency(pkg, bpmpkg.PkgInfo.Version) {
|
||||||
|
log.Printf("Error: package (%s) is not installed\n", pkg)
|
||||||
|
exitCode = 1
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if n != 0 {
|
if n != 0 {
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -649,11 +649,17 @@ func (operation *BPMOperation) GetModifiedFiles() {
|
|||||||
installAction := action.(*InstallPackageAction)
|
installAction := action.(*InstallPackageAction)
|
||||||
isUpgrade := IsPackageInstalled(installAction.BpmPackage.PkgInfo.Name, operation.RootDir)
|
isUpgrade := IsPackageInstalled(installAction.BpmPackage.PkgInfo.Name, operation.RootDir)
|
||||||
|
|
||||||
for _, pkgFile := range installAction.BpmPackage.PkgFiles {
|
if isUpgrade {
|
||||||
operation.ModifiedFiles[pkgFile.Path] = "install"
|
for _, pkgFile := range installAction.BpmPackage.PkgFiles {
|
||||||
if isUpgrade {
|
|
||||||
operation.ModifiedFiles[pkgFile.Path] = "upgrade"
|
operation.ModifiedFiles[pkgFile.Path] = "upgrade"
|
||||||
}
|
}
|
||||||
|
for _, pkgFile := range GetPackage(installAction.BpmPackage.PkgInfo.Name, operation.RootDir).PkgFiles {
|
||||||
|
operation.ModifiedFiles[pkgFile.Path] = "upgrade"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for _, pkgFile := range installAction.BpmPackage.PkgFiles {
|
||||||
|
operation.ModifiedFiles[pkgFile.Path] = "install"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if action.GetActionType() == "remove" {
|
if action.GetActionType() == "remove" {
|
||||||
|
|||||||
Reference in New Issue
Block a user