aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-09-22 04:15:55 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-09-22 04:15:55 +0000
commit3786a801c39f718f88a7d65a586bfcf1d4b335aa (patch)
tree7faf4c2d77ec7534e97015d48e8909aa1fd12876 /src/libstore
parentb7df353f27b3bd6c1addb98dae19dcc973c1b698 (diff)
parentecc8672aa007af045d77434b495ca09541e9fee3 (diff)
Merge remote-tracking branch 'upstream/master' into ca-floating-upstream
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/binary-cache-store.cc1
-rw-r--r--src/libstore/build.cc1
-rw-r--r--src/libstore/dummy-store.cc1
-rw-r--r--src/libstore/filetransfer.cc1
-rw-r--r--src/libstore/globals.cc1
-rw-r--r--src/libstore/globals.hh1
-rw-r--r--src/libstore/http-binary-cache-store.cc1
-rw-r--r--src/libstore/legacy-ssh-store.cc1
-rw-r--r--src/libstore/local-store.cc1
-rw-r--r--src/libstore/misc.cc2
-rw-r--r--src/libstore/names.cc21
-rw-r--r--src/libstore/names.hh7
-rw-r--r--src/libstore/remote-store.cc1
-rw-r--r--src/libstore/store-api.cc4
14 files changed, 34 insertions, 10 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index 34f844a18..ebc0bd6a4 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -11,6 +11,7 @@
#include "nar-accessor.hh"
#include "json.hh"
#include "thread-pool.hh"
+#include "callback.hh"
#include <chrono>
#include <future>
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index bff8a8327..b17ccd7d0 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -17,6 +17,7 @@
#include "daemon.hh"
#include "worker-protocol.hh"
#include "topo-sort.hh"
+#include "callback.hh"
#include <algorithm>
#include <iostream>
diff --git a/src/libstore/dummy-store.cc b/src/libstore/dummy-store.cc
index 128832e60..49641c2ac 100644
--- a/src/libstore/dummy-store.cc
+++ b/src/libstore/dummy-store.cc
@@ -1,4 +1,5 @@
#include "store-api.hh"
+#include "callback.hh"
namespace nix {
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index 4149f8155..6241b5e00 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -5,6 +5,7 @@
#include "s3.hh"
#include "compression.hh"
#include "finally.hh"
+#include "callback.hh"
#ifdef ENABLE_S3
#include <aws/core/client/ClientConfiguration.h>
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 491c664db..0beb9b2b7 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -2,6 +2,7 @@
#include "util.hh"
#include "archive.hh"
#include "args.hh"
+#include "abstract-setting-to-json.hh"
#include <algorithm>
#include <map>
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index 02721285a..8a2d3ff75 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -2,7 +2,6 @@
#include "types.hh"
#include "config.hh"
-#include "abstractsettingtojson.hh"
#include "util.hh"
#include <map>
diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc
index f4ab15a10..86be7c006 100644
--- a/src/libstore/http-binary-cache-store.cc
+++ b/src/libstore/http-binary-cache-store.cc
@@ -2,6 +2,7 @@
#include "filetransfer.hh"
#include "globals.hh"
#include "nar-info-disk-cache.hh"
+#include "callback.hh"
namespace nix {
diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/legacy-ssh-store.cc
index e9478c1d5..5af75669a 100644
--- a/src/libstore/legacy-ssh-store.cc
+++ b/src/libstore/legacy-ssh-store.cc
@@ -6,6 +6,7 @@
#include "worker-protocol.hh"
#include "ssh.hh"
#include "derivations.hh"
+#include "callback.hh"
namespace nix {
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 8d9a202ce..b0ffa58c4 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -6,6 +6,7 @@
#include "derivations.hh"
#include "nar-info.hh"
#include "references.hh"
+#include "callback.hh"
#include <iostream>
#include <algorithm>
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index da3981696..ad4dccef9 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -5,7 +5,7 @@
#include "store-api.hh"
#include "thread-pool.hh"
#include "topo-sort.hh"
-
+#include "callback.hh"
namespace nix {
diff --git a/src/libstore/names.cc b/src/libstore/names.cc
index d1c8a6101..41e28dc99 100644
--- a/src/libstore/names.cc
+++ b/src/libstore/names.cc
@@ -1,10 +1,18 @@
#include "names.hh"
#include "util.hh"
+#include <regex>
+
namespace nix {
+struct Regex
+{
+ std::regex regex;
+};
+
+
DrvName::DrvName()
{
name = "";
@@ -30,11 +38,18 @@ DrvName::DrvName(std::string_view s) : hits(0)
}
+DrvName::~DrvName()
+{ }
+
+
bool DrvName::matches(DrvName & n)
{
if (name != "*") {
- if (!regex) regex = std::unique_ptr<std::regex>(new std::regex(name, std::regex::extended));
- if (!std::regex_match(n.name, *regex)) return false;
+ if (!regex) {
+ regex = std::make_unique<Regex>();
+ regex->regex = std::regex(name, std::regex::extended);
+ }
+ if (!std::regex_match(n.name, regex->regex)) return false;
}
if (version != "" && version != n.version) return false;
return true;
@@ -99,7 +114,7 @@ DrvNames drvNamesFromArgs(const Strings & opArgs)
{
DrvNames result;
for (auto & i : opArgs)
- result.push_back(DrvName(i));
+ result.emplace_back(i);
return result;
}
diff --git a/src/libstore/names.hh b/src/libstore/names.hh
index 00e14b8c7..bc62aac93 100644
--- a/src/libstore/names.hh
+++ b/src/libstore/names.hh
@@ -3,10 +3,11 @@
#include <memory>
#include "types.hh"
-#include <regex>
namespace nix {
+struct Regex;
+
struct DrvName
{
string fullName;
@@ -16,10 +17,12 @@ struct DrvName
DrvName();
DrvName(std::string_view s);
+ ~DrvName();
+
bool matches(DrvName & n);
private:
- std::unique_ptr<std::regex> regex;
+ std::unique_ptr<Regex> regex;
};
typedef list<DrvName> DrvNames;
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index e92b94975..27535f1d0 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -10,6 +10,7 @@
#include "pool.hh"
#include "finally.hh"
#include "logging.hh"
+#include "callback.hh"
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 2d5077ed0..1bbc74db8 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -8,9 +8,7 @@
#include "json.hh"
#include "url.hh"
#include "archive.hh"
-
-#include <future>
-
+#include "callback.hh"
namespace nix {