unstableGitUpdater: fix updating fetchzip-based sources
a67950f20b
added `url` attribute
from `fetchurl` and therefore also from `fetchzip`.
We previously relied on `url` from fetchgit-based fetchers
to find the repo URL but now it will just return tarballs
in the case of `fetchFrom{GitHub,GitLab}`.
Let’s add an attribute to `fetch{git,FromGitHub,FromGitLab}`
to expose a repo URL consistently.
This commit is contained in:
parent
1daa1ede66
commit
7aae279ad9
@ -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