mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
fetchFromGitLab: passthru rev
based on tag
This commit is contained in:
parent
39ddc92155
commit
f7eba55589
1 changed files with 4 additions and 5 deletions
|
@ -37,10 +37,9 @@ lib.makeOverridable (
|
||||||
repo
|
repo
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
revWithTag = if tag != null then "refs/tags/" + tag else rev;
|
||||||
escapedSlug = lib.replaceStrings [ "." "/" ] [ "%2E" "%2F" ] slug;
|
escapedSlug = lib.replaceStrings [ "." "/" ] [ "%2E" "%2F" ] slug;
|
||||||
escapedRev = lib.replaceStrings [ "+" "%" "/" ] [ "%2B" "%25" "%2F" ] (
|
escapedRevWithTag = lib.replaceStrings [ "+" "%" "/" ] [ "%2B" "%25" "%2F" ] revWithTag;
|
||||||
if tag != null then "refs/tags/" + tag else rev
|
|
||||||
);
|
|
||||||
passthruAttrs = removeAttrs args [
|
passthruAttrs = removeAttrs args [
|
||||||
"protocol"
|
"protocol"
|
||||||
"domain"
|
"domain"
|
||||||
|
@ -77,7 +76,7 @@ lib.makeOverridable (
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
url = "${protocol}://${domain}/api/v4/projects/${escapedSlug}/repository/archive.tar.gz?sha=${escapedRev}";
|
url = "${protocol}://${domain}/api/v4/projects/${escapedSlug}/repository/archive.tar.gz?sha=${escapedRevWithTag}";
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit gitRepoUrl;
|
inherit gitRepoUrl;
|
||||||
|
@ -95,9 +94,9 @@ lib.makeOverridable (
|
||||||
meta.homepage = "${protocol}://${domain}/${slug}/";
|
meta.homepage = "${protocol}://${domain}/${slug}/";
|
||||||
inherit
|
inherit
|
||||||
tag
|
tag
|
||||||
rev
|
|
||||||
owner
|
owner
|
||||||
repo
|
repo
|
||||||
;
|
;
|
||||||
|
rev = revWithTag;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue