mirror of
https://github.com/EnumeratedDev/bpm.git
synced 2026-09-16 02:26:12 +00:00
Added 'search' subcommand and removed repository functionality from 'info' subcommand
This commit is contained in:
+2
-18
@@ -353,7 +353,7 @@ func CreateInfoFile(pkgInfo *PackageInfo) string {
|
||||
return string(bytes)
|
||||
}
|
||||
|
||||
func CreateReadableInfo(showArchitecture, showType, showPackageRelations, showRemoteInfo, showInstallationReason bool, pkgInfo *PackageInfo, rootDir string) string {
|
||||
func CreateReadableInfo(showArchitecture, showType, showPackageRelations bool, pkgInfo *PackageInfo, rootDir string) string {
|
||||
ret := make([]string, 0)
|
||||
appendArray := func(label string, array []string) {
|
||||
if len(array) == 0 {
|
||||
@@ -380,23 +380,7 @@ func CreateReadableInfo(showArchitecture, showType, showPackageRelations, showRe
|
||||
appendArray("Provided packages", pkgInfo.Provides)
|
||||
|
||||
}
|
||||
if showRemoteInfo {
|
||||
arr := make([]string, 0)
|
||||
for _, repo := range BPMConfig.Repositories {
|
||||
if repo.ContainsPackage(pkgInfo.Name) {
|
||||
arr = append(arr, repo.Name)
|
||||
}
|
||||
}
|
||||
appendArray("Repositories", arr)
|
||||
}
|
||||
if showInstallationReason {
|
||||
if IsPackageInstalled(pkgInfo.Name, rootDir) {
|
||||
ret = append(ret, "Installed: yes")
|
||||
ret = append(ret, "Installation Reason: "+string(GetInstallationReason(pkgInfo.Name, rootDir)))
|
||||
} else {
|
||||
ret = append(ret, "Installed: no")
|
||||
}
|
||||
}
|
||||
ret = append(ret, "Installation Reason: "+string(GetInstallationReason(pkgInfo.Name, rootDir)))
|
||||
return strings.Join(ret, "\n")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user