diff options
author | Thomas Churchman <thomas@kepow.org> | 2021-06-23 22:07:55 +0100 |
---|---|---|
committer | Thomas Churchman <thomas@kepow.org> | 2021-06-23 22:09:22 +0100 |
commit | e3d11f9a9ca8cf1663de0182154683db250df095 (patch) | |
tree | a729d19bdc0336e3965331d41e8d007d445daf6c /src/libstore/machines.cc | |
parent | 323e5450a1a6e4eb97ba1c9aeba195187cfaff37 (diff) |
Improve machine store URI parsing
Diffstat (limited to 'src/libstore/machines.cc')
-rw-r--r-- | src/libstore/machines.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/libstore/machines.cc b/src/libstore/machines.cc index b42e5e434..9843ccf04 100644 --- a/src/libstore/machines.cc +++ b/src/libstore/machines.cc @@ -16,13 +16,18 @@ Machine::Machine(decltype(storeUri) storeUri, decltype(mandatoryFeatures) mandatoryFeatures, decltype(sshPublicHostKey) sshPublicHostKey) : storeUri( - // Backwards compatibility: if the URI is a hostname, - // prepend ssh://. + // Backwards compatibility: if the URI is schemeless, is not a path, + // and is not one of the special store connection words, prepend + // ssh://. storeUri.find("://") != std::string::npos - || hasPrefix(storeUri, "local") - || hasPrefix(storeUri, "remote") - || hasPrefix(storeUri, "auto") - || hasPrefix(storeUri, "/") + || storeUri.find("/") != std::string::npos + || storeUri == "auto" + || storeUri == "daemon" + || storeUri == "local" + || hasPrefix(storeUri, "auto?") + || hasPrefix(storeUri, "daemon?") + || hasPrefix(storeUri, "local?") + || hasPrefix(storeUri, "?") ? storeUri : "ssh://" + storeUri), systemTypes(systemTypes), |