diff options
author | Brennan Vincent <brennan@umanwizard.com> | 2024-09-23 07:21:07 -0400 |
---|---|---|
committer | Guix Patches Tester <> | 2024-09-24 11:16:54 +0200 |
commit | 4ce27d55a625f4d9866b228ffb7b14bbed136a3a (patch) | |
tree | 80dd611be6227e2c737cd65ce1e6fd8070f3b179 | |
parent | dfab637246971ba6f7a2e21b0a66ba5fbb8a3483 (diff) | |
download | guix-patches-issue-73438.tar guix-patches-issue-73438.tar.gz |
Better error message in checkStoreNameissue-73438
When trying to pass a local-file beginning with a dot to something like
home-files-service-type, one gets an error message like:
guix home: error: invalid name: `.vimrc'
which does not explain what went wrong. This update should make it more clear.
Change-Id: I045a663bc6cd9844677c65b38a31d3941cf212b5
-rw-r--r-- | nix/libstore/store-api.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nix/libstore/store-api.cc b/nix/libstore/store-api.cc index 781fb9e693..38a1403a71 100644 --- a/nix/libstore/store-api.cc +++ b/nix/libstore/store-api.cc @@ -61,7 +61,7 @@ void checkStoreName(const string & name) /* Disallow names starting with a dot for possible security reasons (e.g., "." and ".."). */ if (string(name, 0, 1) == ".") - throw Error(format("invalid name: `%1%'") % name); + throw Error(format("invalid name: `%1%' (can't begin with dot)") % name); foreach (string::const_iterator, i, name) if (!((*i >= 'A' && *i <= 'Z') || (*i >= 'a' && *i <= 'z') || |