Skip to content

Commit b7c013c

Browse files
authored
Refactor: Use "formula" instead of "bottle" as pkgtype (#321)
1 parent 80c6540 commit b7c013c

3 files changed

Lines changed: 4 additions & 14 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ src-bundle
3535
*.local
3636
*.bak
3737

38+
notes.md
39+
3840
/vendor/
3941

4042
*.prof

internal/origins/drivers/brew/parser.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func parseInstallReceipt(path string, version string) (*pkgdata.PkgInfo, error)
6767
Reason: inferInstallReason(receipt),
6868
Version: version,
6969
Arch: receipt.Arch,
70-
PkgType: getPkgType(receipt),
70+
PkgType: "formula",
7171
Depends: parseDepends(receipt),
7272
}
7373

@@ -76,18 +76,6 @@ func parseInstallReceipt(path string, version string) (*pkgdata.PkgInfo, error)
7676
return pkg, nil
7777
}
7878

79-
func getPkgType(receipt installReceipt) string {
80-
if receipt.BuiltAsBottle && receipt.PouredFromBottle {
81-
return "bottle"
82-
}
83-
84-
if receipt.BuiltAsBottle {
85-
return "local_bottle"
86-
}
87-
88-
return "source"
89-
}
90-
9179
func inferBuildDate(pkg *pkgdata.PkgInfo, receipt installReceipt) {
9280
if !receipt.PouredFromBottle {
9381
pkg.BuildTimestamp = receipt.Time

internal/pkgdata/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
const (
15-
cacheVersion = 19 // bump when updating structure of PkgInfo/Relation/pkginfo.proto OR when dependency resolution is updated
15+
cacheVersion = 20 // bump when updating structure of PkgInfo/Relation/pkginfo.proto OR when dependency resolution is updated
1616
xdgCacheHomeEnv = "XDG_CACHE_HOME"
1717
homeEnv = "HOME"
1818
qpCacheDir = "query-packages"

0 commit comments

Comments
 (0)