aboutsummaryrefslogtreecommitdiff
path: root/bdep
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 /bdep
parent6b625bea1beee70c326e1e32936e66ecc23ba99c (diff)
Adapt to converting local repo canonical name path part to lower case on Windows
Diffstat (limited to 'bdep')
-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
6 files changed, 23 insertions, 4 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>