Hide URL and license from readable info if empty

This commit is contained in:
2025-10-19 16:26:57 +03:00
parent 8a7519628f
commit 04e966fef5
2 changed files with 12 additions and 4 deletions
+6 -2
View File
@@ -299,8 +299,12 @@ func (entry *BPMDatabaseEntry) CreateReadableInfo(rootDir string) string {
ret = append(ret, "Database: "+entry.Database.Name)
ret = append(ret, "Description: "+entry.Info.Description)
ret = append(ret, "Version: "+entry.Info.GetFullVersion())
ret = append(ret, "URL: "+entry.Info.Url)
ret = append(ret, "License: "+entry.Info.License)
if entry.Info.Url != "" {
ret = append(ret, "URL: "+entry.Info.Url)
}
if entry.Info.License != "" {
ret = append(ret, "License: "+entry.Info.License)
}
ret = append(ret, "Architecture: "+entry.Info.Arch)
if entry.Info.Type == "source" && entry.Info.OutputArch != "" && entry.Info.OutputArch != GetArch() {
ret = append(ret, "Output architecture: "+entry.Info.OutputArch)
+6 -2
View File
@@ -523,8 +523,12 @@ func (pkgInfo *PackageInfo) CreateReadableInfo(rootDir string) string {
ret = append(ret, "Name: "+pkgInfo.Name)
ret = append(ret, "Description: "+pkgInfo.Description)
ret = append(ret, "Version: "+pkgInfo.GetFullVersion())
ret = append(ret, "URL: "+pkgInfo.Url)
ret = append(ret, "License: "+pkgInfo.License)
if pkgInfo.Url != "" {
ret = append(ret, "URL: "+pkgInfo.Url)
}
if pkgInfo.License != "" {
ret = append(ret, "License: "+pkgInfo.License)
}
ret = append(ret, "Architecture: "+pkgInfo.Arch)
if pkgInfo.Type == "source" && pkgInfo.OutputArch != "" && pkgInfo.OutputArch != GetArch() {
ret = append(ret, "Output architecture: "+pkgInfo.Arch)