Skip to content

Commit

Permalink
Let "*" match any version or branch. Fixes #151.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Mar 28, 2014
1 parent 1f4b9b7 commit 31fd5cb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions source/dub/dependency.d
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ struct Dependency {
bool matches(string vers) const { return matches(Version(vers)); }
bool matches(const(Version) v) const { return matches(v); }
bool matches(ref const(Version) v) const {
if (this == ANY) return true;
//logDebug(" try match: %s with: %s", v, this);
// Master only matches master
if(m_versA.isBranch) {
Expand All @@ -259,6 +260,8 @@ struct Dependency {
/// Merges to versions
Dependency merge(ref const(Dependency) o)
const {
if (this == ANY) return o;
if (o == ANY) return this;
if (!this.valid || !o.valid) return INVALID;
if (m_versA.isBranch != o.m_versA.isBranch) return INVALID;
if (m_versB.isBranch != o.m_versB.isBranch) return INVALID;
Expand Down
2 changes: 1 addition & 1 deletion test/path-subpackage-ref/dub.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test",
"dependencies": {
"test:subpack": "~master"
"test:subpack": "*"
},
"subPackages": [
"subpack/"
Expand Down
2 changes: 1 addition & 1 deletion test/subpackage-ref/dub.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "test",
"dependencies": {
"test:subpack": "~master"
"test:subpack": "*"
},
"subPackages": [
{
Expand Down

0 comments on commit 31fd5cb

Please sign in to comment.