Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
iterate_dir: Include symlinks to dirs also (#97)
Browse files Browse the repository at this point in the history
Given:
`for root, subdirs, filelist in os.walk(dir):`

.. symlinks to directories are only returned in `subdirs`. So, they need
to handled explicitly.

This meant that when bockbuild tried to zip up the contents of mono and
msbuild to move to the staging directory, then such symlinks were not
picked up thus breaking the build.

(cherry picked from commit 5d818c1)
  • Loading branch information
radical authored Apr 15, 2019
1 parent d58b7a9 commit d30329d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bockbuild/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,12 @@ def iterate_dir(dir, with_links=False, with_dirs=False, summary=False):
dirs = dirs + 1
if with_dirs:
yield root
if with_dirs and with_links:
for subdir in subdirs:
path = os.path.join(root, subdir)
if os.path.islink(path):
links = links + 1
yield path
for file in filelist:
path = os.path.join(root, file)
if os.path.islink(path):
Expand Down

0 comments on commit d30329d

Please sign in to comment.