diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-09-23 21:40:37 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-09-23 21:40:37 +0800 |
commit | 2a1a72508a37415cf74b4939fc6710e79bc83772 (patch) | |
tree | 632bc552e49994ee43a0a5d63d4af88632f85f9f | |
parent | fdf6693609e532c46a70a4da7f6e2ff8a55fbdb0 (diff) | |
download | mrust-2a1a72508a37415cf74b4939fc6710e79bc83772.tar.gz |
Minicargo - Look in the repo before path dependencies
-rw-r--r-- | tools/minicargo/manifest.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp index ef5beb24..e1478fb5 100644 --- a/tools/minicargo/manifest.cpp +++ b/tools/minicargo/manifest.cpp @@ -726,17 +726,6 @@ void PackageRef::load_manifest(Repository& repo, const ::helpers::path& base_pat // If the path isn't set, check for: // - Git (checkout and use) // - Version and repository (check vendored, check cache, download into cache) - if( this->has_path() ) - { - DEBUG("Load dependency " << m_name << " from path " << m_path); - // Search for a copy of this already loaded - auto path = base_path / ::helpers::path(m_path) / "Cargo.toml"; - if( ::std::ifstream(path.str()).good() ) - { - m_manifest = repo.from_path(path); - } - } - if( !m_manifest && this->has_git() ) { DEBUG("Load dependency " << this->name() << " from git"); @@ -747,14 +736,22 @@ void PackageRef::load_manifest(Repository& repo, const ::helpers::path& base_pat { DEBUG("Load dependency " << this->name() << " from repo"); m_manifest = repo.find(this->name(), this->get_version()); - if( !m_manifest ) { - throw ::std::runtime_error(::format("Unable to load manifest for ", this->name(), ":", this->get_version())); + } + if( !m_manifest && this->has_path() ) + { + DEBUG("Load dependency " << m_name << " from path " << m_path); + // Search for a copy of this already loaded + auto path = base_path / ::helpers::path(m_path) / "Cargo.toml"; + if( ::std::ifstream(path.str()).good() ) + { + m_manifest = repo.from_path(path); } } + if( !m_manifest ) { - throw ::std::runtime_error(::format( "Unable to find a manifest for ", this->name() )); + throw ::std::runtime_error(::format( "Unable to find a manifest for ", this->name(), ":", this->get_version() )); } } |