diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2023-04-08 10:22:36 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-04-08 10:22:36 +0300 |
commit | df6bcf1e56abcbbb1a8200ee0499e1ef4e713156 (patch) | |
tree | 28faa6cda27a7c004733e8d8a2f390a1aab8ea5f | |
parent | update/repo: add package.deprecated parser & collector (diff) | |
download | soko-df6bcf1e56abcbbb1a8200ee0499e1ef4e713156.tar.gz soko-df6bcf1e56abcbbb1a8200ee0499e1ef4e713156.tar.bz2 soko-df6bcf1e56abcbbb1a8200ee0499e1ef4e713156.zip |
updater: perform metadata updated on full update
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | pkg/portage/update.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/pkg/portage/update.go b/pkg/portage/update.go index a9c5199..a08999a 100644 --- a/pkg/portage/update.go +++ b/pkg/portage/update.go @@ -33,8 +33,11 @@ func Update() { // update the local useflags repository.UpdateUse("profiles/use.local.desc") - updateMetadata() - updatePackageData() + latestCommit := utils.GetLatestCommit() + changed := utils.ChangedFiles(latestCommit, "HEAD") + + updateMetadata(changed) + updatePackageData(changed) updateHistory() repository.CalculateMaskedVersions() @@ -56,13 +59,10 @@ func Update() { // retrieving the last commit in the database (if present) and parsing all // following commits. In case no last commit is present a full import // starting with the first commit in the tree is done. -func updateMetadata() { +func updateMetadata(changed []string) { logger.Info.Println("Start updating changed metadata") - latestCommit := utils.GetLatestCommit() - - changed := utils.ChangedFiles(latestCommit, "HEAD") logger.Info.Println("Iterating", len(changed), "changed files") for _, path := range changed { repository.UpdateUse(path) @@ -80,13 +80,10 @@ func updateMetadata() { // - versions // // changed data is determined by parsing all commits since the last update. -func updatePackageData() { +func updatePackageData(changed []string) { logger.Info.Println("Start updating changed package data") - latestCommit := utils.GetLatestCommit() - - changed := utils.ChangedFiles(latestCommit, "HEAD") logger.Info.Println("Iterating", len(changed), "changed files") repository.UpdateVersions(changed) repository.UpdatePackages(changed) @@ -154,6 +151,7 @@ func FullUpdate() { repository.UpdateUse("profiles/use.local.desc") allFiles := utils.AllFiles() + updateMetadata(allFiles) repository.UpdateVersions(allFiles) repository.UpdatePackages(allFiles) repository.UpdateCategories(allFiles) @@ -166,6 +164,9 @@ func FullUpdate() { fixPrecedingCommitsOfPackages() + repository.CalculateMaskedVersions() + repository.CalculateDeprecatedToVersion() + logger.Info.Println("Finished update up...") } |