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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchFromGitHub: Always add meta.homepage to the derivation #29815

Merged
merged 2 commits into from Sep 29, 2017

Conversation

primeos
Copy link
Member

@primeos primeos commented Sep 26, 2017

The attribute meta.homepage was only added if "fetchFromGitHub = false"
which might be unexpected. Now, it will be set unconditionally.

Not sure if this is a good idea / worth it. Consider it an suggestion (could make it more foolproof a33402b 馃槃).

@@ -223,7 +222,8 @@ with pkgs;
EOF
'';
netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ];
} // passthruAttrs) // { inherit rev; };
} // passthruAttrs) // { inherit rev; })
// { meta.homepage = "${baseUrl}/"; };
Copy link
Contributor

@orivej orivej Sep 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also extract passthruAttrs down here?

Then I'd merge this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some refactoring in 5d0f7dc721997424c85624df0713c07b9cc79fc4 which makes it possible. If I didn't miss anything 5d0f7dc721997424c85624df0713c07b9cc79fc4 shouldn't change the result at all.

The refactoring was necessary to avoid the passthruAttrs redundancy as these attributes are required for both fetchzip and fetchgit (e.g. the sha256 attribute).

netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ];
}))
// passthruAttrs // { inherit name; };
in fetcher fetcherArgs // { meta.homepage = "${baseUrl}/"; inherit rev; };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, thank you! (Although extracting the private section into privateAttrs will make it even better.)
I just noticed that GitHub does not add the final slash when you navigate to a project page, so we shouldn't too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points, thanks! I've changed it accordingly.

The attribute meta.homepage was only added if "fetchFromGitHub = false"
which might be unexpected. Now, it will be set unconditionally.
And remove the tailing slash from "meta.homepage" as suggested by
@orivej (because GitHub doesn't add the final slash).
Copy link
Contributor

@orivej orivej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have confirmed that nox-review pr 29815 rebuilds nothing.

@orivej orivej merged commit ccf2c06 into NixOS:master Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants