-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update lockfile api for package source (#1266)
## Summary Update lockfile api for package source as suggested in #1264 (comment) ## How was it tested? devbox run build devbox update
- Loading branch information
Showing
5 changed files
with
44 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2023 Jetpack Technologies Inc and contributors. All rights reserved. | ||
// Use of this source code is governed by the license in the LICENSE file. | ||
|
||
package lock | ||
|
||
const ( | ||
nixpkgSource string = "nixpkg" | ||
devboxSearchSource string = "devbox-search" | ||
) | ||
|
||
type Package struct { | ||
LastModified string `json:"last_modified,omitempty"` | ||
PluginVersion string `json:"plugin_version,omitempty"` | ||
Resolved string `json:"resolved,omitempty"` | ||
Source string `json:"source,omitempty"` | ||
Version string `json:"version,omitempty"` | ||
// Systems is keyed by the system name | ||
Systems map[string]*SystemInfo `json:"systems,omitempty"` | ||
} | ||
|
||
type SystemInfo struct { | ||
// StorePath is the input-addressed path for the nix package in /nix/store | ||
// It is the cache key in the Binary Cache Store (cache.nixos.org) | ||
// It is of the form <hash>-<name>-<version> | ||
// <name> may be different from the canonicalName so we store the full store path. | ||
StorePath string `json:"store_path,omitempty"` | ||
// CAStorePath is the content-addressed path for the nix package in /nix/store | ||
// It is of the form <hash>-<name>-<version> | ||
CAStorePath string `json:"ca_store_path,omitempty"` | ||
} | ||
|
||
func (p *Package) GetSource() string { | ||
if p == nil { | ||
return "" | ||
} | ||
return p.Source | ||
} |