aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-11-24 13:58:40 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-11-24 13:58:40 +0300
commit5e40d45fedc7181810d837a77a8a1ca97b5f8665 (patch)
tree33b59913a2ae3c0c0ce296a24c70c07b1641c788
parent6b625bea1beee70c326e1e32936e66ecc23ba99c (diff)
Adapt to converting local repo canonical name path part to lower case on Windows
-rw-r--r--bdep/deinit.cxx2
-rw-r--r--bdep/fetch.cxx2
-rw-r--r--bdep/status.cxx2
-rw-r--r--bdep/sync.cxx2
-rw-r--r--bdep/utility.cxx14
-rw-r--r--bdep/utility.hxx5
-rw-r--r--tests/fetch.testscript6
-rw-r--r--tests/status.testscript4
-rw-r--r--tests/sync.testscript16
-rw-r--r--tests/test.testscript16
10 files changed, 44 insertions, 25 deletions
diff --git a/bdep/deinit.cxx b/bdep/deinit.cxx
index b4a3350..598efd5 100644
--- a/bdep/deinit.cxx
+++ b/bdep/deinit.cxx
@@ -214,7 +214,7 @@ namespace bdep
o,
"remove",
"-d", c->path,
- "dir:" + prj.string ());
+ repository_name (prj));
}
return 0;
diff --git a/bdep/fetch.cxx b/bdep/fetch.cxx
index dcc98b6..93a727f 100644
--- a/bdep/fetch.cxx
+++ b/bdep/fetch.cxx
@@ -23,7 +23,7 @@ namespace bdep
o,
"fetch",
"-d", c->path,
- (full ? nullptr : ("dir:" + prj.string ()).c_str ()));
+ (full ? nullptr : repository_name (prj).c_str ()));
}
int
diff --git a/bdep/status.cxx b/bdep/status.cxx
index a4cdb28..2e60b29 100644
--- a/bdep/status.cxx
+++ b/bdep/status.cxx
@@ -33,7 +33,7 @@ namespace bdep
"fetch",
"-d", cfg,
"--shallow",
- "dir:" + prj.string ());
+ repository_name (prj));
// Don't show the hold status since the only packages that will normally
// be held are the project's. But do show dependency constraints.
diff --git a/bdep/sync.cxx b/bdep/sync.cxx
index 63486cd..471e190 100644
--- a/bdep/sync.cxx
+++ b/bdep/sync.cxx
@@ -256,7 +256,7 @@ namespace bdep
for (const project& prj: prjs)
{
if (prj.fetch)
- reps.push_back ("dir:" + prj.path.string ());
+ reps.push_back (repository_name (prj.path));
for (const package_state& pkg: prj.config->packages)
{
diff --git a/bdep/utility.cxx b/bdep/utility.cxx
index 0e19691..703520e 100644
--- a/bdep/utility.cxx
+++ b/bdep/utility.cxx
@@ -310,4 +310,18 @@ namespace bdep
dr << info << "consider using " << opt << " to override";
}
}
+
+ string
+ repository_name (const dir_path& d)
+ {
+ // We could probably obtain the canonical name by creating the repository
+ // URL and then the repository location, but let's keep it simple and
+ // produce it directly.
+ //
+ #ifdef _WIN32
+ return "dir:" + lcase (d.string ());
+ #else
+ return "dir:" + d.string ();
+ #endif
+ }
}
diff --git a/bdep/utility.hxx b/bdep/utility.hxx
index 22be4ee..d5e98c8 100644
--- a/bdep/utility.hxx
+++ b/bdep/utility.hxx
@@ -311,6 +311,11 @@ namespace bdep
validate_utf8_graphic (const string&,
const char* what,
const char* opt = nullptr);
+
+ // Return the canonical name of a directory repository location.
+ //
+ string
+ repository_name (const dir_path&);
}
#include <bdep/utility.txx>
diff --git a/tests/fetch.testscript b/tests/fetch.testscript
index 9ffd7aa..08ede11 100644
--- a/tests/fetch.testscript
+++ b/tests/fetch.testscript
@@ -35,9 +35,9 @@ deinit += -d prj
depends: libbar
EOI
- $* 2>>/"EOE";
- fetching dir:$~/libbar \(complements dir:$~/prj\)
- fetching dir:$~/libfoo \(prerequisite of dir:$~/prj\)
+ $* 2>>/~%EOE%;
+ %fetching dir:.+/libbar \(complements dir:.+/prj\)%
+ %fetching dir:.+/libfoo \(prerequisite of dir:.+/prj\)%
EOE
$status libfoo libbar >>~%EOO%;
diff --git a/tests/status.testscript b/tests/status.testscript
index 49b5412..bf4339b 100644
--- a/tests/status.testscript
+++ b/tests/status.testscript
@@ -82,10 +82,10 @@ deinit += -d prj
depends: libprj
EOI
- $* --recursive >>EOO 2>>/"EOE"; # Note: implicitly fetches in cfg.
+ $* --recursive >>EOO 2>>/~%EOE%; # Note: implicitly fetches in cfg.
prj configured 0.1.0-a.0.19700101000000 available 0.1.0-a.0.19700101000000#1
EOO
- fetching dir:$~/libprj \(prerequisite of dir:$~/prj\)
+ %fetching dir:.+/libprj \(prerequisite of dir:.+/prj\)%
EOE
$sync;
diff --git a/tests/sync.testscript b/tests/sync.testscript
index 68a4c70..c03abbb 100644
--- a/tests/sync.testscript
+++ b/tests/sync.testscript
@@ -50,10 +50,10 @@ deinit += -d prj
}
EOI
- $* -d prj 2>>/~"%EOE%";
- fetching dir:$~/libprj \(prerequisite of dir:$~/prj\)
+ $* -d prj 2>>/~%EOE%;
+ %fetching dir:.+/libprj \(prerequisite of dir:.+/prj\)%
synchronizing:
- % new libprj.+ \\\(required by prj\\\)%
+ % new libprj.+ \(required by prj\)%
% upgrade prj.+19700101000000#1%
EOE
@@ -130,15 +130,15 @@ deinit += -d prj
# Sync the default (cfg1) configuration (via the package directory).
#
- $* -d prj/pkg2 2>>/~"%EOE%";
- fetching dir:$~/libprj \(prerequisite of dir:$~/prj\)
+ $* -d prj/pkg2 2>>/~%EOE%;
+ %fetching dir:.+/libprj \(prerequisite of dir:.+/prj\)%
synchronizing:
- % new libprj.+ \\\(required by pkg1\\\)%
+ % new libprj.+ \(required by pkg1\)%
% upgrade pkg1.+19700101000000#1%
% upgrade pkg2.+19700101000000#1%
EOE
- $status >>~%EOO% 2>>/~"%EOE%"; # Note: implicitly fetches into cfg2.
+ $status >>~%EOO% 2>>/~%EOE%; # Note: implicitly fetches into cfg2.
in configuration @cfg1:
pkg1 configured 0.1.0-a.0.19700101000000#1
% libprj configured 0.+%
@@ -148,7 +148,7 @@ deinit += -d prj
pkg1 configured 0.1.0-a.0.19700101000000 available 0.1.0-a.0.19700101000000#1
pkg2 configured 0.1.0-a.0.19700101000000 available 0.1.0-a.0.19700101000000#1
EOO
- fetching dir:$~/libprj \(prerequisite of dir:$~/prj\)
+ %fetching dir:.+/libprj \(prerequisite of dir:.+/prj\)%
EOE
# Sync all configurations (via the project directory).
diff --git a/tests/test.testscript b/tests/test.testscript
index 88dadaf..1079ccf 100644
--- a/tests/test.testscript
+++ b/tests/test.testscript
@@ -77,22 +77,22 @@ deinit += -d prj
tags: c++
EOI
- $* -d prj/pkg2 2>>/~"%EOE%"; # Default (cfg1).
- fetching dir:$~/libprj \(prerequisite of dir:$~/prj\)
+ $* -d prj/pkg2 2>>/~%EOE%; # Default (cfg1).
+ %fetching dir:.+/libprj \(prerequisite of dir:.+/prj\)%
synchronizing:
- % new libprj.+ \\\(required by pkg1\\\)%
+ % new libprj.+ \(required by pkg1\)%
% upgrade pkg1.+19700101000000#1%
% upgrade pkg2.+19700101000000#1%
- %\(mkdir|c\\+\\+|ld|test\) .+%{4}
+ %(mkdir|c\+\+|ld|test) .+%{4}
EOE
- $* @cfg2 -d prj/pkg2 2>>/~"%EOE%"; # By name (cfg2).
- fetching dir:$~/libprj \(prerequisite of dir:$~/prj\)
+ $* @cfg2 -d prj/pkg2 2>>/~%EOE%; # By name (cfg2).
+ %fetching dir:.+/libprj \(prerequisite of dir:.+/prj\)%
synchronizing:
- % new libprj.+ \\\(required by pkg1\\\)%
+ % new libprj.+ \(required by pkg1\)%
% upgrade pkg1.+19700101000000#1%
% upgrade pkg2.+19700101000000#1%
- %\(mkdir|c\\+\\+|ld|test\) .+%{4}
+ %(mkdir|c\+\+|ld|test) .+%{4}
EOE
$* -a --recursive -d prj/pkg1 2>>~%EOE% # All configs recursive.