Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e044ccb67c | ||
|
|
d0632f4c48 | ||
|
|
573b3aab66 | ||
|
|
5d00dc9d67 | ||
|
|
bda64b4b65 | ||
|
|
a07ecbc548 | ||
|
|
32a7724c22 | ||
|
|
45ed4e6178 | ||
|
|
21c23031c1 |
No files matched your search
@@ -590,7 +590,7 @@ create_directories() {
|
||||
"$get_chr_own" -R "root:$NIX_BUILD_GROUP_NAME" "$NIX_ROOT" || true
|
||||
fi
|
||||
_sudo "to make the basic directory structure of Nix (part 1)" \
|
||||
install -dv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix{,/db,/gcroots,/profiles,/temproots,/userpool} /nix/var/nix/{gcroots,profiles}/per-user
|
||||
install -dv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix{,/db,/gcroots,/profiles,/temproots,/userpool,/daemon-socket} /nix/var/nix/{gcroots,profiles}/per-user
|
||||
|
||||
_sudo "to make the basic directory structure of Nix (part 2)" \
|
||||
install -dv -g "$NIX_BUILD_GROUP_NAME" -m 1775 /nix/store
|
||||
|
||||
@@ -364,15 +364,19 @@ struct StaticEnv
|
||||
|
||||
void sort()
|
||||
{
|
||||
std::sort(vars.begin(), vars.end(),
|
||||
std::stable_sort(vars.begin(), vars.end(),
|
||||
[](const Vars::value_type & a, const Vars::value_type & b) { return a.first < b.first; });
|
||||
}
|
||||
|
||||
void deduplicate()
|
||||
{
|
||||
const auto last = std::unique(vars.begin(), vars.end(),
|
||||
[] (const Vars::value_type & a, const Vars::value_type & b) { return a.first == b.first; });
|
||||
vars.erase(last, vars.end());
|
||||
auto it = vars.begin(), jt = it, end = vars.end();
|
||||
while (jt != end) {
|
||||
*it = *jt++;
|
||||
while (jt != end && it->first == jt->first) *it = *jt++;
|
||||
it++;
|
||||
}
|
||||
vars.erase(it, end);
|
||||
}
|
||||
|
||||
Vars::const_iterator find(const Symbol & name) const
|
||||
|
||||
@@ -405,7 +405,7 @@ expr_select
|
||||
expr_simple
|
||||
: ID {
|
||||
std::string_view s = "__curPos";
|
||||
if (strncmp($1.p, s.data(), s.size()) == 0)
|
||||
if ($1.l == s.size() && strncmp($1.p, s.data(), s.size()) == 0)
|
||||
$$ = new ExprPos(CUR_POS);
|
||||
else
|
||||
$$ = new ExprVar(CUR_POS, data->symbols.create($1));
|
||||
|
||||
@@ -128,7 +128,7 @@ struct curlFileTransfer : public FileTransfer
|
||||
if (requestHeaders) curl_slist_free_all(requestHeaders);
|
||||
try {
|
||||
if (!done)
|
||||
fail(FileTransferError(Interrupted, nullptr, "download of '%s' was interrupted", request.uri));
|
||||
fail(FileTransferError(Interrupted, {}, "download of '%s' was interrupted", request.uri));
|
||||
} catch (...) {
|
||||
ignoreException();
|
||||
}
|
||||
@@ -704,7 +704,7 @@ struct curlFileTransfer : public FileTransfer
|
||||
auto s3Res = s3Helper.getObject(bucketName, key);
|
||||
FileTransferResult res;
|
||||
if (!s3Res.data)
|
||||
throw FileTransferError(NotFound, nullptr, "S3 object '%s' does not exist", request.uri);
|
||||
throw FileTransferError(NotFound, {}, "S3 object '%s' does not exist", request.uri);
|
||||
res.data = std::move(*s3Res.data);
|
||||
callback(std::move(res));
|
||||
#else
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ Path canonPath(PathView path, bool resolveSymlinks)
|
||||
path = {};
|
||||
} else {
|
||||
s += path.substr(0, slash);
|
||||
path = path.substr(slash + 1);
|
||||
path = path.substr(slash);
|
||||
}
|
||||
|
||||
/* If s points to a symlink, resolve it and continue from there */
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3
|
||||
@@ -0,0 +1,2 @@
|
||||
((__curPosFoo: __curPosFoo) 1) + ((__curPosBar: __curPosBar) 2)
|
||||
|
||||
@@ -40,3 +40,26 @@ testRepl () {
|
||||
testRepl
|
||||
# Same thing (kind-of), but with a remote store.
|
||||
testRepl --store "$TEST_ROOT/store?real=$NIX_STORE_DIR"
|
||||
|
||||
testReplResponse () {
|
||||
local response="$(nix repl <<< "$1")"
|
||||
echo "$response" | grep -qs "$2" \
|
||||
|| fail "repl command set:
|
||||
|
||||
$1
|
||||
|
||||
does not respond with:
|
||||
|
||||
$2
|
||||
|
||||
but with:
|
||||
|
||||
$response"
|
||||
}
|
||||
|
||||
# :a uses the newest version of a symbol
|
||||
testReplResponse '
|
||||
:a { a = "1"; }
|
||||
:a { a = "2"; }
|
||||
"result: ${a}"
|
||||
' "result: 2"
|
||||
Reference in new issue
Block a user