File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -403,7 +403,12 @@ func (p *Package) Versioned() string {
403
403
}
404
404
405
405
func (p * Package ) IsLegacy () bool {
406
- return p .isDevboxPackage () && ! p .isVersioned () && p .lockfile .Source (p .Raw ) == ""
406
+ var packageSource = ""
407
+ if p .lockfile .Get (p .Raw ) != nil {
408
+ packageSource = p .lockfile .Get (p .Raw ).Source
409
+ }
410
+
411
+ return p .isDevboxPackage () && ! p .isVersioned () && packageSource == ""
407
412
}
408
413
409
414
func (p * Package ) LegacyToVersioned () string {
Original file line number Diff line number Diff line change @@ -119,8 +119,8 @@ func (l *lockfile) LegacyNixpkgsPath(pkg string) string {
119
119
)
120
120
}
121
121
122
- func (l * lockfile ) Source (pkg string ) string {
123
- return ""
122
+ func (l * lockfile ) Get (pkg string ) * lock. Package {
123
+ return nil
124
124
}
125
125
126
126
func (l * lockfile ) Resolve (pkg string ) (* lock.Package , error ) {
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ type devboxProject interface {
11
11
}
12
12
13
13
type Locker interface {
14
+ Get (string ) * Package
14
15
LegacyNixpkgsPath (string ) string
15
16
ProjectDir () string
16
17
Resolve (string ) (* Package , error )
17
- Source (string ) string
18
18
}
Original file line number Diff line number Diff line change @@ -130,12 +130,12 @@ func (l *File) LegacyNixpkgsPath(pkg string) string {
130
130
)
131
131
}
132
132
133
- func (l * File ) Source (pkg string ) string {
133
+ func (l * File ) Get (pkg string ) * Package {
134
134
entry , hasEntry := l .Packages [pkg ]
135
135
if ! hasEntry || entry .Resolved == "" {
136
- return ""
136
+ return nil
137
137
}
138
- return entry . Source
138
+ return entry
139
139
}
140
140
141
141
// This probably belongs in input.go but can't add it there because it will
You can’t perform that action at this time.
0 commit comments