Skip to content
Snippets Groups Projects
Commit f28420ec authored by Piotr Ożarowski's avatar Piotr Ożarowski
Browse files

dh_python2: replace a file with a symlink also if there's a matching one in...

dh_python2: replace a file with a symlink also if there's a matching one in pyshared directory already
parent eb6e5e26
No related branches found
No related tags found
No related merge requests found
python-defaults (2.6.6-11) UNRELEASED; urgency=low
* dh_python2: fix parsing .pyinstall files (a space between file name and
module name is now required)
* dh_python2:
- fix parsing .pyinstall files (a space between file name and
module name is now required)
- replace a file with a symlink also if there's a matching one in
pyshared directory already
-- Piotr Ożarowski <piotr@debian.org> Sat, 15 Jan 2011 21:14:38 +0100
......
......@@ -26,7 +26,7 @@ import logging
import os
import re
import sys
from filecmp import dircmp, cmpfiles
from filecmp import dircmp, cmpfiles, cmp as fcmp
from optparse import OptionParser, SUPPRESS_HELP
from os.path import isdir, islink, exists, join, realpath
from shutil import rmtree, copy as fcopy
......@@ -261,8 +261,12 @@ def share_2x(dir1, dir2, dc=None):
# do not touch symlinks created by previous loop or other tools
if dc and not islink(fpath1):
# replace with a link to pyshared
os.rename(fpath1, fpath3)
relative_symlink(fpath3, fpath1)
if not exists(fpath3):
os.rename(fpath1, fpath3)
relative_symlink(fpath3, fpath1)
elif fcmp(fpath3, fpath1, shallow=False):
os.remove(fpath1)
relative_symlink(fpath3, fpath1)
if dc is None: # guess/copy mode
if islink(fpath1):
# ralative links will work as well, it's always the same level
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment