mirror of
https://github.com/NixOS/nix
synced 2025-07-08 11:03:54 +02:00
Merge pull request #4988 from NixOS/fetchgit-name-attribute
Add a name attribute to the fetchers
This commit is contained in:
commit
8648143120
11 changed files with 41 additions and 12 deletions
|
@ -189,3 +189,7 @@ path8=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = \"file://$rep
|
|||
rev4=$(git -C $repo rev-parse HEAD)
|
||||
rev4_nix=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = \"file://$repo\"; ref = \"HEAD\"; }).rev")
|
||||
[[ $rev4 = $rev4_nix ]]
|
||||
|
||||
# The name argument should be handled
|
||||
path9=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = \"file://$repo\"; ref = \"HEAD\"; name = \"foo\"; }).outPath")
|
||||
[[ $path9 =~ -foo$ ]]
|
||||
|
|
|
@ -94,3 +94,8 @@ hg commit --cwd $repo -m 'Bla3'
|
|||
|
||||
path4=$(nix eval --impure --refresh --raw --expr "(builtins.fetchMercurial file://$repo).outPath")
|
||||
[[ $path2 = $path4 ]]
|
||||
|
||||
echo paris > $repo/hello
|
||||
# Passing a `name` argument should be reflected in the output path
|
||||
path5=$(nix eval -vvvvv --impure --refresh --raw --expr "(builtins.fetchMercurial { url = \"file://$repo\"; name = \"foo\"; } ).outPath")
|
||||
[[ $path5 =~ -foo$ ]]
|
||||
|
|
|
@ -40,6 +40,11 @@ test_tarball() {
|
|||
(! nix-instantiate --eval -E '<fnord/xyzzy> 1' -I fnord=file://no-such-tarball$ext)
|
||||
|
||||
nix-instantiate --eval -E '<fnord/config.nix>' -I fnord=file://no-such-tarball$ext -I fnord=.
|
||||
|
||||
# Ensure that the `name` attribute isn’t accepted as that would mess
|
||||
# with the content-addressing
|
||||
(! nix-instantiate --eval -E "fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"$hash\"; name = \"foo\"; }")
|
||||
|
||||
}
|
||||
|
||||
test_tarball '' cat
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue