/breezy-debian/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy-debian/trunk

« back to all changes in this revision

Viewing changes to util.py

  • Committer: Jelmer Vernooij
  • Date: 2020-01-20 02:18:12 UTC
  • Revision ID: jelmer@jelmer.uk-20200120021812-sdrjkeq0cf7tn7yj
Don't follow symlinks when exporting directories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
                os.mkdir(tosubdir)
154
154
            recursive_copy(path, tosubdir)
155
155
        else:
156
 
            shutil.copy(path, todir)
 
156
            # Python 3 has a follow_symlinks argument to shutil.copy, but
 
157
            # Python 2 does not...
 
158
            if os.path.islink(path):
 
159
                os.symlink(os.readlink(path), os.path.join(todir, entry))
 
160
            else:
 
161
                shutil.copy(path, todir)
157
162
 
158
163
 
159
164
def find_changelog(t, subpath='', merge=False, max_blocks=1):