Merge pull request #174291 from jtojnar/unstable-updater-url

This commit is contained in:
Sandro 2022-05-25 23:52:26 +02:00 committed by GitHub
commit 9f8610e5db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 4 deletions

View File

@ -92,4 +92,8 @@ stdenvNoCC.mkDerivation {
];
inherit preferLocalBuild meta;
passthru = {
gitRepoUrl = url;
};
}

View File

@ -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

View File

@ -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

View File

@ -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