Merge pull request #174291 from jtojnar/unstable-updater-url
This commit is contained in:
commit
9f8610e5db
@ -92,4 +92,8 @@ stdenvNoCC.mkDerivation {
|
||||
];
|
||||
|
||||
inherit preferLocalBuild meta;
|
||||
|
||||
passthru = {
|
||||
gitRepoUrl = url;
|
||||
};
|
||||
}
|
||||
|
@ -42,11 +42,20 @@ let
|
||||
'';
|
||||
netrcImpureEnvVars = [ "${varBase}USERNAME" "${varBase}PASSWORD" ];
|
||||
};
|
||||
|
||||
gitRepoUrl = "${baseUrl}.git";
|
||||
|
||||
fetcherArgs = (if useFetchGit
|
||||
then {
|
||||
inherit rev deepClone fetchSubmodules sparseCheckout; url = "${baseUrl}.git";
|
||||
inherit rev deepClone fetchSubmodules sparseCheckout; url = gitRepoUrl;
|
||||
} // lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; }
|
||||
else { url = "${baseUrl}/archive/${rev}.tar.gz"; }
|
||||
else {
|
||||
url = "${baseUrl}/archive/${rev}.tar.gz";
|
||||
|
||||
passthru = {
|
||||
inherit gitRepoUrl;
|
||||
};
|
||||
}
|
||||
) // privateAttrs // passthruAttrs // { inherit name; };
|
||||
in
|
||||
|
||||
|
@ -15,11 +15,17 @@ let
|
||||
useFetchGit = deepClone || fetchSubmodules || leaveDotGit;
|
||||
fetcher = if useFetchGit then fetchgit else fetchzip;
|
||||
|
||||
gitRepoUrl = "${protocol}://${domain}/${slug}.git";
|
||||
|
||||
fetcherArgs = (if useFetchGit then {
|
||||
inherit rev deepClone fetchSubmodules leaveDotGit;
|
||||
url = "${protocol}://${domain}/${slug}.git";
|
||||
url = gitRepoUrl;
|
||||
} else {
|
||||
url = "${protocol}://${domain}/api/v4/projects/${escapedSlug}/repository/archive.tar.gz?sha=${escapedRev}";
|
||||
|
||||
passthru = {
|
||||
inherit gitRepoUrl;
|
||||
};
|
||||
}) // passthruAttrs // { inherit name; };
|
||||
in
|
||||
|
||||
|
@ -49,7 +49,7 @@ let
|
||||
# By default we set url to src.url
|
||||
if [[ -z "$url" ]]; then
|
||||
url="$(${nix}/bin/nix-instantiate $systemArg --eval -E \
|
||||
"with import ./. {}; $UPDATE_NIX_ATTR_PATH.src.url or $UPDATE_NIX_ATTR_PATH.src.meta.homepage" \
|
||||
"with import ./. {}; $UPDATE_NIX_ATTR_PATH.src.gitRepoUrl" \
|
||||
| tr -d '"')"
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user