aboutsummaryrefslogtreecommitdiff
path: root/bpkg/rep-fetch.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-02-22 15:02:15 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-02-22 17:27:41 +0300
commitf619db022734dff6b988c514e3a292a5c7babaf0 (patch)
tree73ab481eeb0ed524168e00f89d55dc2d3a91b9bd /bpkg/rep-fetch.cxx
parent6ec24eebcb42c0db205f9fff3f2716b84c6fcabf (diff)
Invent repository_state() function
Diffstat (limited to 'bpkg/rep-fetch.cxx')
-rw-r--r--bpkg/rep-fetch.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/bpkg/rep-fetch.cxx b/bpkg/rep-fetch.cxx
index fc59ed9..3956c5a 100644
--- a/bpkg/rep-fetch.cxx
+++ b/bpkg/rep-fetch.cxx
@@ -4,7 +4,6 @@
#include <bpkg/rep-fetch.hxx>
-#include <libbutl/sha256.mxx>
#include <libbutl/process.mxx>
#include <libbutl/process-io.mxx> // operator<<(ostream, process_path)
#include <libbutl/manifest-parser.mxx>
@@ -15,6 +14,7 @@
#include <bpkg/package-odb.hxx>
#include <bpkg/database.hxx>
#include <bpkg/diagnostics.hxx>
+#include <bpkg/manifest-utility.hxx>
using namespace std;
using namespace butl;
@@ -152,12 +152,9 @@ namespace bpkg
// Clone or fetch the repository.
//
- // If changing the repository directory naming scheme, then don't forget
- // to also update pkg_checkout().
- //
- dir_path h (sha256 (rl.canonical_name ()).abbreviated_string (16));
+ dir_path sd (repository_state (rl));
- auto_rmdir rm (temp_dir / h);
+ auto_rmdir rm (temp_dir / sd);
dir_path& td (rm.path);
if (exists (td))
@@ -170,7 +167,7 @@ namespace bpkg
bool fetch (false);
if (conf != nullptr)
{
- rd = *conf / repos_dir / h;
+ rd = *conf / repos_dir / sd;
if (exists (rd))
{