Skip to content

Commit

Permalink
Fix unfree package indexing, show unfree marker
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Jul 6, 2024
1 parent 2b5c631 commit b075a39
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/nix-search/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ func mainAction(c *cli.Context) error {

fmt.Fprint(out, "- ", path)
fmt.Fprint(out, " ", styler.dim("("+pkg.Version+")"))
if pkg.Unfree {
fmt.Fprint(out, styler.dim(" (unfree)"))
}
if pkg.Broken {
fmt.Fprint(out, styler.dim(" (broken)"))
}
Expand Down
4 changes: 2 additions & 2 deletions search/nix/dump_packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ let
if pkg.meta ? "license"
then map licenseString (singleton pkg.meta.license)
else null;
unfree =
unfree =
if pkg.meta ? "license"
then any
(license: if license ? "free" then !license.free else false)
(license: license ? "free" && !license.free)
(singleton pkg.meta.license)
else false;
unsupportedPlatform = !meta.availableOn pkgs pkg;
Expand Down
1 change: 1 addition & 0 deletions search/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Package struct {
Licenses []string `json:"license,omitempty"` // usually SPDX identifiers
MainProgram string `json:"mainProgram,omitempty"`
Broken bool `json:"broken,omitempty"`
Unfree bool `json:"unfree,omitempty"`
UnsupportedPlatform bool `json:"unsupportedPlatform,omitempty"`

// Homepages []string `json:"homepages,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions search/searchers/blugesearcher/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
var indexVersions = []string{
"index",
"index-v2",
"index-v3",
}

var lastIndexVersion = indexVersions[len(indexVersions)-1]
Expand Down

0 comments on commit b075a39

Please sign in to comment.