Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix search: allow `-a` for attribute-only searches #2266

Open
wants to merge 3 commits into
base: master
from

Conversation

@Ma27
Copy link
Member

commented Jul 3, 2018

  • Added optional flag -a for this purpose (see #2050)
  • ef0e228 fixes a regression when using nix search with --json
@Ma27

This comment has been minimized.

Copy link
Member Author

commented Jul 5, 2018

/cc @kballard do you want to have a look at this?

@dtzWill

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

Unrelated but consider rebasing onto latest Nix master -- in particular without cb9ef85 this branch fails tests (which means it doesn't build without disabling them, making it harder to test the resulting binaries and makes it less clear that tests would pass "if" they passed on commit this was based on...).

Anyway no big deal just thought I'd mention it after running into such failures trying to give this a go :).

@grahamc

This comment has been minimized.

Copy link
Member

commented Jul 5, 2018

@Ma27 Ma27 force-pushed the Ma27:feature/attr-path-only-search branch from ef0e228 to cb8e47f Jul 5, 2018

@Ma27

This comment has been minimized.

Copy link
Member Author

commented Jul 5, 2018

@dtzWill good point, rebased onto master
@grahamc I originally had nix-env -qaP in mind, but I didn't know what the actual arguments were actually used for. After actually reading the man pages I think as well that -A is the better option 😅

@dtzWill

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2018

Consider adding this fix: dtzWill@80d8ca6

To fix reading/writing cache in presence of "No description" packages.

@Ma27

This comment has been minimized.

Copy link
Member Author

commented Jul 16, 2018

seems legit, is it okay if I just cherry-pick it onto my branch?

@dtzWill

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2018

seems legit, is it okay if I just cherry-pick it onto my branch?

(of course! Thanks! <3)

@Ma27

This comment has been minimized.

Copy link
Member Author

commented Sep 5, 2018

@edolstra any chance to get this merged?:)

Ma27 and others added some commits Jul 3, 2018

nix search: introduce `-a` to search for attribute paths
In the end, the attribute paths are most important when it comes to
installing a package from any nix-based package set. However `nix
search` looks inside values like the description as well for the regex.

This canbe quite helpful, but when running e.g. `nix search git`, results
like this might be unwanted:

```
* nixpkgs.bspwm-unstable (bspwm-unstable-2016-09-30)
  A tiling window manager based on binary space partitioning (git version)
```

Closes #2050
nix search: fix regression from 6b74fda with `--json`
JSON output shouldn't be written into a pager, additionally the "no
results" error was thrown by mistake with `--json`.

Furthermore replace empty package descriptions with `No description`
when `--json` is not set.
search.cc: fix writing ansi escapes into cache
Use local variable for adding formatting to 'description'
instead of overwriting what is later written to cache.

This is more than cosmetic, as these escapes are rejected
when trying to read the cache back in.

@Ma27 Ma27 force-pushed the Ma27:feature/attr-path-only-search branch from 59976bc to 00e4a78 Oct 30, 2018

@Ma27

This comment has been minimized.

Copy link
Member Author

commented Oct 30, 2018

rebased onto latest master and resolved conflicts.

@Ma27

This comment has been minimized.

Copy link
Member Author

commented Dec 4, 2018

anything missing here?

@Ma27

This comment has been minimized.

Copy link
Member Author

commented Mar 8, 2019

@grahamc anything missing or any chance to get this merged?

@nixos-discourse

This comment has been minimized.

Copy link

commented Jun 1, 2019

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/9

@lilyball

This comment has been minimized.

Copy link
Member

commented Jun 2, 2019

I'm not familiar with the C++ sources but I took a look at this PR and it looks pretty good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.