aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-02-21 21:13:17 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-02-21 21:21:24 +0200
commit9c2b34ee79723dee30e31d78fea1ed72a02c0e29 (patch)
treea7c0d3a6863be99497512f76da9f0412a6305ac7 /pkg/portage
parentuse templ instead of html/template (diff)
downloadsoko-9c2b34ee79723dee30e31d78fea1ed72a02c0e29.tar.gz
soko-9c2b34ee79723dee30e31d78fea1ed72a02c0e29.tar.bz2
soko-9c2b34ee79723dee30e31d78fea1ed72a02c0e29.zip
updater/useflags: rebuild all useflags types on fullupdate
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'pkg/portage')
-rw-r--r--pkg/portage/update.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkg/portage/update.go b/pkg/portage/update.go
index a08999a..b2b14a4 100644
--- a/pkg/portage/update.go
+++ b/pkg/portage/update.go
@@ -5,6 +5,7 @@ package portage
import (
"io/ioutil"
"log"
+ "os"
"soko/pkg/config"
"soko/pkg/database"
"soko/pkg/logger"
@@ -147,8 +148,18 @@ func FullUpdate() {
// Add new entries & update existing
logger.Info.Println("Update all present files")
- // update the local useflags
+ // update useflags
+ database.TruncateTable[models.Useflag]("id")
+ repository.UpdateUse("profiles/use.desc")
repository.UpdateUse("profiles/use.local.desc")
+ entries, err := os.ReadDir(config.PortDir() + "/profiles/desc")
+ if err != nil {
+ logger.Error.Println("Error reading profiles/desc", err)
+ } else {
+ for _, entry := range entries {
+ repository.UpdateUse(config.PortDir() + "/profiles/desc/" + entry.Name())
+ }
+ }
allFiles := utils.AllFiles()
updateMetadata(allFiles)