3
0
Fork 0
forked from mirrors/nixpkgs

fetchFromGitHub: Always add meta.homepage to the derivation

The attribute meta.homepage was only added if "fetchFromGitHub = false"
which might be unexpected. Now, it will be set unconditionally.
This commit is contained in:
Michael Weiss 2017-09-26 20:47:18 +02:00
parent f27feb5481
commit 49d64a9d53

View file

@ -198,7 +198,7 @@ with pkgs;
baseUrl = "https://${githubBase}/${owner}/${repo}";
passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "private" "githubBase" "varPrefix" ];
varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
in if fetchSubmodules then
in (if fetchSubmodules then
fetchgit ({
inherit name rev fetchSubmodules;
url = "${baseUrl}.git";
@ -209,7 +209,6 @@ with pkgs;
fetchzip ({
inherit name;
url = "${baseUrl}/archive/${rev}.tar.gz";
meta.homepage = "${baseUrl}/";
} // lib.optionalAttrs private {
netrcPhase = ''
if [ -z "''$${varBase}USERNAME" -o -z "''$${varBase}PASSWORD" ]; then
@ -223,7 +222,8 @@ with pkgs;
EOF
'';
netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ];
} // passthruAttrs) // { inherit rev; };
} // passthruAttrs) // { inherit rev; })
// { meta.homepage = baseUrl; };
fetchFromBitbucket = {
owner, repo, rev, name ? gitRepoToName repo rev,