diff options
Diffstat (limited to 'pkg/portage')
-rw-r--r-- | pkg/portage/repository/deprecated.go | 6 | ||||
-rw-r--r-- | pkg/portage/repository/mask.go | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/pkg/portage/repository/deprecated.go b/pkg/portage/repository/deprecated.go index 4c642b7..f9348d6 100644 --- a/pkg/portage/repository/deprecated.go +++ b/pkg/portage/repository/deprecated.go @@ -70,7 +70,11 @@ func parsePackagesDeprecated(entry string) { var reason string packageLine, packageLines = packageLines[0], packageLines[1:] for strings.HasPrefix(packageLine, "#") { - reason = reason + " " + strings.Replace(packageLine, "# ", "", 1) + if packageLine == "#" { + reason += "\n" + } else { + reason = reason + " " + strings.TrimPrefix(packageLine, "# ") + } packageLine, packageLines = packageLines[0], packageLines[1:] } diff --git a/pkg/portage/repository/mask.go b/pkg/portage/repository/mask.go index 1b70c64..22715f2 100644 --- a/pkg/portage/repository/mask.go +++ b/pkg/portage/repository/mask.go @@ -113,7 +113,11 @@ func parsePackageMask(packageMask string) { var reason string packageMaskLine, packageMaskLines = packageMaskLines[0], packageMaskLines[1:] for strings.HasPrefix(packageMaskLine, "#") { - reason = reason + " " + strings.Replace(packageMaskLine, "# ", "", 1) + if packageMaskLine == "#" { + reason += "\n" + } else { + reason = reason + " " + strings.TrimPrefix(packageMaskLine, "# ") + } packageMaskLine, packageMaskLines = packageMaskLines[0], packageMaskLines[1:] } |