aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-09-08 13:41:43 +0200
committerMax Magorsch <arzano@gentoo.org>2020-09-08 13:41:43 +0200
commit478e5cc33c0d2b117859eb8a170620dc831ce50a (patch)
treeb479c7df5154cd61f7760c3218c3c8d89df6327e
parentFix wrong keywording in the changedVersions (diff)
downloadsoko-478e5cc33c0d2b117859eb8a170620dc831ce50a.tar.gz
soko-478e5cc33c0d2b117859eb8a170620dc831ce50a.tar.bz2
soko-478e5cc33c0d2b117859eb8a170620dc831ce50a.zip
Fix empty restricts slices
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r--pkg/portage/repository/version.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/portage/repository/version.go b/pkg/portage/repository/version.go
index 8bfdf91..4fbe33d 100644
--- a/pkg/portage/repository/version.go
+++ b/pkg/portage/repository/version.go
@@ -99,6 +99,9 @@ func updateModifiedVersion(changedFile string) {
case strings.HasPrefix(metadata, "RESTRICT="):
restricts = strings.Split(strings.ReplaceAll(strings.ReplaceAll(metadata, "RESTRICT=", ""), "!test? ( test )", ""), " ")
+ if len(restricts) == 1 && restricts[0] == "" {
+ restricts = []string{}
+ }
case strings.HasPrefix(metadata, "PROPERTIES="):
properties = strings.Split(strings.ReplaceAll(metadata, "PROPERTIES=", ""), " ")