forked from nim-lang/nimble
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nim-lang#937 from bobeff/bugfix/symlinks-checksums
Fix a bug when including symbolic link files to the package's checksum.
- Loading branch information
Showing
3 changed files
with
56 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,7 +203,12 @@ proc getVcsRevision*(dir: Path): Sha1Hash = | |
proc getPackageFileListWithoutVcs(dir: Path): seq[string] = | ||
## Recursively walks the directory `dir` and returns a list of files in it and | ||
## its subdirectories. | ||
for file in walkDirRec($dir, relative = true): | ||
for file in walkDirRec($dir, yieldFilter = {pcFile, pcLinkToFile}, | ||
relative = true): | ||
when defined(windows): | ||
# On windows relative paths to files which are included in the calculation | ||
# of the package checksum must be the same as on POSIX systems. | ||
let file = file.replace('\\', '/') | ||
result.add file | ||
|
||
proc getPackageFileList*(dir: Path): seq[string] = | ||
|
@@ -1060,7 +1065,6 @@ username = John Doe <[email protected]> | |
check not isValidSha1Hash($getVcsRevision(testNoVcsDir)) | ||
|
||
test "getPackageFileList": | ||
check getPackageFileList(testNoVcsDir) == | ||
@[testFile, testSubDirFile.normalizedPath] | ||
check getPackageFileList(testNoVcsDir) == @[testFile, testSubDirFile] | ||
|
||
tearDownSuite(testNoVcsDir) |