diff --git a/src/babel.nim b/src/babel.nim index da2b493..8de3625 100644 --- a/src/babel.nim +++ b/src/babel.nim @@ -272,6 +272,8 @@ proc processDeps(pkginfo: TPackageInfo, options: TOptions): seq[string] = else: echo("Dependency already satisfied.") result.add(pkg.mypath.splitFile.dir) + # Process the dependencies of this dependency. + result.add(processDeps(pkg, options)) # Check if two packages of the same name (but different version) are listed # in the path. diff --git a/tests/issue27/a/issue27a.babel b/tests/issue27/a/issue27a.babel new file mode 100644 index 0000000..cfe8493 --- /dev/null +++ b/tests/issue27/a/issue27a.babel @@ -0,0 +1,9 @@ +[Package] +name = "issue27a" +version = "0.1.0" +author = "Dominik Picheta" +description = "Dependency A for Issue 27" +license = "BSD" + +[Deps] +Requires: "nimrod >= 0.9.3, issue27b" diff --git a/tests/issue27/a/issue27a.nim b/tests/issue27/a/issue27a.nim new file mode 100644 index 0000000..0019ab8 --- /dev/null +++ b/tests/issue27/a/issue27a.nim @@ -0,0 +1 @@ +import issue27b diff --git a/tests/issue27/b/issue27b.babel b/tests/issue27/b/issue27b.babel new file mode 100644 index 0000000..6942a35 --- /dev/null +++ b/tests/issue27/b/issue27b.babel @@ -0,0 +1,9 @@ +[Package] +name = "issue27b" +version = "0.1.0" +author = "Dominik Picheta" +description = "Dependency B for Issue 27" +license = "BSD" + +[Deps] +Requires: "nimrod >= 0.9.3" diff --git a/tests/issue27/b/issue27b.nim b/tests/issue27/b/issue27b.nim new file mode 100644 index 0000000..0b4a370 --- /dev/null +++ b/tests/issue27/b/issue27b.nim @@ -0,0 +1 @@ +proc test(): int = 4 diff --git a/tests/issue27/issue27.babel b/tests/issue27/issue27.babel new file mode 100644 index 0000000..13aeb45 --- /dev/null +++ b/tests/issue27/issue27.babel @@ -0,0 +1,11 @@ +[Package] +name = "issue27" +version = "0.1.0" +author = "Dominik Picheta" +description = "Test package for Issue 27" +license = "BSD" + +bin = "issue27" + +[Deps] +Requires: "nimrod >= 0.9.3, issue27a" diff --git a/tests/issue27/issue27.nim b/tests/issue27/issue27.nim new file mode 100644 index 0000000..012e88a --- /dev/null +++ b/tests/issue27/issue27.nim @@ -0,0 +1 @@ +import issue27a diff --git a/tests/tester.nim b/tests/tester.nim index 97e141f..132aff7 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -1,9 +1,17 @@ -import osproc, unittest, strutils +import osproc, unittest, strutils, os const path = "../src/babel" discard execCmdEx("nimrod c " & path) +template cd*(dir: string, body: stmt) = + ## Sets the current dir to ``dir``, executes ``body`` and restores the + ## previous working dir. + let lastDir = getCurrentDir() + setCurrentDir(dir) + body + setCurrentDir(lastDir) + test "can install packagebin2": let (outp, exitCode) = execCmdEx(path & " install -y https://github.com/babel-test/packagebin2.git") check exitCode == QuitSuccess @@ -19,3 +27,15 @@ test "can reject same version dependencies": test "can update": let (outp, exitCode) = execCmdEx(path & " update") check exitCode == QuitSuccess + +test "issue #27": + # Install b + cd "issue27/b": + check execCmdEx("../../" & path & " install -y").exitCode == QuitSuccess + + # Install a + cd "issue27/a": + check execCmdEx("../../" & path & " install -y").exitCode == QuitSuccess + + cd "issue27": + check execCmdEx("../" & path & " install -y").exitCode == QuitSuccess