@@ -109,31 +109,29 @@ func (d *Devbox) updateDevboxPackage(
109
109
}
110
110
111
111
// Check if the package's system info is missing, or not complete.
112
- userSystem , err := nix .System ()
113
- if err != nil {
114
- return err
115
- }
116
- var needsSysInfo bool
117
- var needsLocalStorePath bool
118
112
if featureflag .RemoveNixpkgs .Enabled () {
119
- userSysInfo := d .lockfile .Packages [pkg .Raw ].Systems [userSystem ]
120
- needsSysInfo = userSysInfo == nil
121
- if ! needsSysInfo {
122
- // Check if the LocalStorePath is missing for the user's system.
123
- // Since any one user cannot add this field for all systems,
124
- // we'll need to progressively add it to a project's lockfile.
125
- needsLocalStorePath = userSysInfo .LocalStorePath == ""
113
+ userSystem , err := nix .System ()
114
+ if err != nil {
115
+ return err
116
+ }
117
+
118
+ // Check if the system info is missing for the user's system.
119
+ sysInfo := d .lockfile .Packages [pkg .Raw ].Systems [userSystem ]
120
+ if sysInfo == nil {
121
+ d .lockfile .Packages [pkg .Raw ] = newEntry
122
+ ux .Finfo (d .writer , "Updated system information for %s\n " , pkg )
123
+ return nil
124
+ }
125
+
126
+ // Check if the LocalStorePath is missing for the user's system.
127
+ // Since any one user cannot add this field for all systems,
128
+ // we'll need to progressively add it to a project's lockfile.
129
+ if sysInfo .LocalStorePath == "" {
130
+ // Update the LocalStorePath for the user's system
131
+ d .lockfile .Packages [pkg .Raw ].Systems [userSystem ].LocalStorePath = newEntry .Systems [userSystem ].LocalStorePath
132
+ ux .Finfo (d .writer , "Updated system information for %s\n " , pkg )
133
+ return nil
126
134
}
127
- }
128
- if needsSysInfo {
129
- d .lockfile .Packages [pkg .Raw ] = newEntry
130
- ux .Finfo (d .writer , "Updated system information for %s\n " , pkg )
131
- return nil
132
- } else if needsLocalStorePath {
133
- // Update the LocalStorePath for the user's system
134
- d .lockfile .Packages [pkg .Raw ].Systems [userSystem ].LocalStorePath = newEntry .Systems [userSystem ].LocalStorePath
135
- ux .Finfo (d .writer , "Updated system information for %s\n " , pkg )
136
- return nil
137
135
}
138
136
139
137
ux .Finfo (d .writer , "Already up-to-date %s %s\n " , pkg , existing .Version )
0 commit comments