From 8dbdde5a247472e4b098a47a3f66fa2bb2ee0550 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 28 Mar 2024 07:28:25 -0600 Subject: [PATCH] fix: Use macro to define /etc/underpass directory --- src/replicator/planetreplicator.cc | 2 +- src/stats/statsconfig.cc | 2 +- src/testsuite/libunderpass.all/geo-test.cc | 2 +- src/underpass.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/replicator/planetreplicator.cc b/src/replicator/planetreplicator.cc index 59d43a181..1e8734116 100644 --- a/src/replicator/planetreplicator.cc +++ b/src/replicator/planetreplicator.cc @@ -102,7 +102,7 @@ PlanetReplicator::PlanetReplicator(void) {}; std::shared_ptr PlanetReplicator::findRemotePath(const underpassconfig::UnderpassConfig &config, ptime time) { yaml::Yaml yaml; - std::string rep_file = "/etc/underpass/replicator/planetreplicator.yaml"; + std::string rep_file = "ETCDIR/replicator/planetreplicator.yaml"; yaml.read(rep_file); std::map hashes; diff --git a/src/stats/statsconfig.cc b/src/stats/statsconfig.cc index 5acc60947..0e1203a0d 100644 --- a/src/stats/statsconfig.cc +++ b/src/stats/statsconfig.cc @@ -51,7 +51,7 @@ namespace statsconfig { StatsConfig::StatsConfig() { if (path.empty()) { - path = "/etc/underpass/stats/statistics.yaml"; + path = "ETCDIR/stats/statistics.yaml"; if (!boost::filesystem::exists(path)) { throw std::runtime_error("Statistics file not found: " + path); } diff --git a/src/testsuite/libunderpass.all/geo-test.cc b/src/testsuite/libunderpass.all/geo-test.cc index b90f1f21c..400512732 100644 --- a/src/testsuite/libunderpass.all/geo-test.cc +++ b/src/testsuite/libunderpass.all/geo-test.cc @@ -61,7 +61,7 @@ main(int argc, char* argv[]) return 1; } - if (tgu.readFile("/etc/underpass/priority.geojson")) { + if (tgu.readFile("ETCDIR/priority.geojson")) { runtest.pass("Read file with absolute path"); } else { runtest.fail("Read file with absolute path"); diff --git a/src/underpass.cc b/src/underpass.cc index b672ee9f4..3a38f6b11 100644 --- a/src/underpass.cc +++ b/src/underpass.cc @@ -85,7 +85,7 @@ main(int argc, char *argv[]) { std::string datadir = "replication/"; - std::string boundary = "/etc/underpass/priority.geojson"; + std::string boundary = "ETCDIR/priority.geojson"; UnderpassConfig config;