diff options
author | Vincent Ambo <mail@tazj.in> | 2022-05-13T15·54+0200 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-05-23T15·04+0000 |
commit | 796ff086bea3e060e61d8c56d38441898025ed1c (patch) | |
tree | 3fcbe922f6571a42871af449519873a06db5449c /tools/nixery/main.go | |
parent | d60feb21e8c9744de233bb15662bb6fe9e2f934f (diff) |
refactor(nixery): Extract layering logic into separate package r/4105
This will be required for making a standalone, Nixery-style image builder function usable from Nix. Change-Id: I5e36348bd4c32d249d56f6628cd046916691319f Reviewed-on: https://cl.tvl.fyi/c/depot/+/5601 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to '')
-rw-r--r-- | tools/nixery/main.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/nixery/main.go b/tools/nixery/main.go index 2e633e0898cd..8fe1679cfad8 100644 --- a/tools/nixery/main.go +++ b/tools/nixery/main.go @@ -26,6 +26,7 @@ import ( "github.com/google/nixery/builder" "github.com/google/nixery/config" + "github.com/google/nixery/layers" "github.com/google/nixery/logs" mf "github.com/google/nixery/manifest" "github.com/google/nixery/storage" @@ -52,7 +53,7 @@ var ( // Downloads the popularity information for the package set from the // URL specified in Nixery's configuration. -func downloadPopularity(url string) (builder.Popularity, error) { +func downloadPopularity(url string) (layers.Popularity, error) { resp, err := http.Get(url) if err != nil { return nil, err @@ -67,7 +68,7 @@ func downloadPopularity(url string) (builder.Popularity, error) { return nil, err } - var pop builder.Popularity + var pop layers.Popularity err = json.Unmarshal(j, &pop) if err != nil { return nil, err @@ -246,7 +247,7 @@ func main() { log.WithError(err).Fatal("failed to instantiate build cache") } - var pop builder.Popularity + var pop layers.Popularity if cfg.PopUrl != "" { pop, err = downloadPopularity(cfg.PopUrl) if err != nil { |