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
Fix package position links #242
Conversation
8d8f8a4
to
034de95
Compare
034de95
to
df8793c
Compare
Oops, I tried bumping the version in |
Noted. |
@ncfavier Sorry I wrote to fast before. The VERSION change lets us test - alongside existing search index. Most of the time I only used this when index schema changed and bigger changes. But we do have to run the import manually. |
Ok, I assume it's something you have to do? |
yes, sadly, It would be nice to automate this somehow. |
@@ -462,7 +462,7 @@ def gen(): | |||
|
|||
position = data["meta"].get("position") | |||
if position and position.startswith("/nix/store"): | |||
position = position[44:] | |||
position = position.split("/", 4)[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some time ago this was actually working. but then something changed in nixpkgs and source/
was added. It think we need to be a little more defensive here. I would only remove source/
and nothing else. We definetly dont want to rely on structure here.
position = position[44:]
if position.startswith('source/'):
position = position[len('source/'):]
or something similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then things will break again if source/
changes to src/
or whatnot. I think we can reasonably rely on the fact that it will always look like /nix/store/hash-name/actual_path_in_nixpkgs
, and therefore stripping the first three path components should be enough.
I'll import the channels manually and then merge this. |
Splitting at the 44th character means leaving the
source/
part which is not part of GitHub nixpkgs URLs. All "Nix expression" links in the package search are currently broken because of this.This fix strips the first three path components instead (
/nix/store/...-source
).