diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2023-04-10 20:57:54 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-04-10 20:58:32 +0300 |
commit | af74d483c4bd89e733379876f6185a4c9118a646 (patch) | |
tree | e5221b79024d16f73665f5d881ce04d463f4f7c2 /pkg/portage | |
parent | update node dependencies (diff) | |
download | soko-af74d483c4bd89e733379876f6185a4c9118a646.tar.gz soko-af74d483c4bd89e733379876f6185a4c9118a646.tar.bz2 soko-af74d483c4bd89e733379876f6185a4c9118a646.zip |
app/packages/show: better rendering of newlines in description
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
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:] } |