|
8 | 8 | "fmt" |
9 | 9 |
|
10 | 10 | "github.com/pkg/errors" |
11 | | -"go.jetpack.io/devbox/internal/boxcli/featureflag" |
12 | 11 | "go.jetpack.io/devbox/internal/devbox/devopt" |
13 | 12 | "go.jetpack.io/devbox/internal/devpkg" |
14 | 13 | "go.jetpack.io/devbox/internal/lock" |
@@ -143,39 +142,36 @@ func (d *Devbox) mergeResolvedPackageToLockfile( |
143 | 142 | } |
144 | 143 |
|
145 | 144 | // Add any missing system infos for packages whose versions did not change. |
146 | | -if featureflag.RemoveNixpkgs.Enabled() { |
147 | | - |
148 | | -if lockfile.Packages[pkg.Raw].Systems == nil { |
149 | | -lockfile.Packages[pkg.Raw].Systems = map[string]*lock.SystemInfo{} |
150 | | -} |
| 145 | +if lockfile.Packages[pkg.Raw].Systems == nil { |
| 146 | +lockfile.Packages[pkg.Raw].Systems = map[string]*lock.SystemInfo{} |
| 147 | +} |
151 | 148 |
|
152 | | -userSystem := nix.System() |
153 | | -updated := false |
154 | | -for sysName, newSysInfo := range resolved.Systems { |
155 | | -// Check whether we are actually updating any system info. |
156 | | -if sysName == userSystem { |
157 | | -// The resolved pkg has a system info for the user's system, so add/overwrite it. |
158 | | -if !newSysInfo.Equals(existing.Systems[userSystem]) { |
159 | | -// We only guard this so that the ux messaging is accurate. We could overwrite every time. |
160 | | -updated = true |
161 | | -} |
162 | | -} else { |
163 | | -// Add other system infos if they don't exist, or if we have a different StorePath. This may |
164 | | -// overwrite an existing StorePath, but to ensure correctness we should ensure that all StorePaths |
165 | | -// come from the same package version. |
166 | | -existingSysInfo, exists := existing.Systems[sysName] |
167 | | -if !exists || !existingSysInfo.Equals(newSysInfo) { |
168 | | -updated = true |
169 | | -} |
| 149 | +userSystem := nix.System() |
| 150 | +updated := false |
| 151 | +for sysName, newSysInfo := range resolved.Systems { |
| 152 | +// Check whether we are actually updating any system info. |
| 153 | +if sysName == userSystem { |
| 154 | +// The resolved pkg has a system info for the user's system, so add/overwrite it. |
| 155 | +if !newSysInfo.Equals(existing.Systems[userSystem]) { |
| 156 | +// We only guard this so that the ux messaging is accurate. We could overwrite every time. |
| 157 | +updated = true |
| 158 | +} |
| 159 | +} else { |
| 160 | +// Add other system infos if they don't exist, or if we have a different StorePath. This may |
| 161 | +// overwrite an existing StorePath, but to ensure correctness we should ensure that all StorePaths |
| 162 | +// come from the same package version. |
| 163 | +existingSysInfo, exists := existing.Systems[sysName] |
| 164 | +if !exists || !existingSysInfo.Equals(newSysInfo) { |
| 165 | +updated = true |
170 | 166 | } |
171 | 167 | } |
172 | | -if updated { |
173 | | -// if we are updating the system info, then we should also update the other fields |
174 | | -useResolvedPackageInLockfile(lockfile, pkg, resolved, existing) |
| 168 | +} |
| 169 | +if updated { |
| 170 | +// if we are updating the system info, then we should also update the other fields |
| 171 | +useResolvedPackageInLockfile(lockfile, pkg, resolved, existing) |
175 | 172 |
|
176 | | -ux.Finfo(d.stderr, "Updated system information for %s\n", pkg) |
177 | | -return nil |
178 | | -} |
| 173 | +ux.Finfo(d.stderr, "Updated system information for %s\n", pkg) |
| 174 | +return nil |
179 | 175 | } |
180 | 176 |
|
181 | 177 | ux.Finfo(d.stderr, "Already up-to-date %s %s\n", pkg, existing.Version) |
|
0 commit comments