about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-07-04T14·34+0200
committerEelco Dolstra <edolstra@gmail.com>2017-07-04T14·34+0200
commit42c5774e78a9f1422dee9c35adb9c056aa994d3b (patch)
tree6d162197e5993948b7f62446a5fd66ec00d74768 /src/libstore/store-api.cc
parentb7203e853e3b928e1a7fb081fce379f023e935bb (diff)
Sort substituters by priority
Fixes #1438.
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index db2e023ab0bf..108e2d4ce9b0 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -812,6 +812,10 @@ std::list<ref<Store>> getDefaultSubstituters()
         for (auto uri : settings.extraSubstituters.get())
             addStore(uri);
 
+        stores.sort([](ref<Store> & a, ref<Store> & b) {
+            return a->getPriority() < b->getPriority();
+        });
+
         return stores;
     } ());