diff --git a/debian/changelog b/debian/changelog index 87ba1f733682e07f4afcc7247c760c380fd8ad9b..7404d34e3a31a0fad5c0930f6e68a908fb8f9468 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,11 @@ -python-defaults (2.6.6-10) UNRELEASED; urgency=low +python-defaults (2.6.6-10) experimental; urgency=low * dh_python2: fix moving files from old debug locations (due to typo) * python-minimal now Breaks python-support << 1.0.12 (Python 2.7 support was added in 1.0.12) + * pycompile: skip dangling symlinks - -- Piotr Ożarowski <piotr@debian.org> Thu, 06 Jan 2011 16:12:25 +0100 + -- Piotr Ożarowski <piotr@debian.org> Mon, 10 Jan 2011 23:05:47 +0100 python-defaults (2.6.6-9) experimental; urgency=low diff --git a/pycompile b/pycompile index 544a97951531cfb0a06998daad5afa636b1380c1..de28868a20e043d1dd6a24e7ae6e62f83920920b 100755 --- a/pycompile +++ b/pycompile @@ -29,7 +29,7 @@ import optparse import os import sys from os import environ, listdir, walk -from os.path import abspath, exists, isdir, isfile, join +from os.path import abspath, exists, isdir, isfile, islink, join from subprocess import PIPE, STDOUT, Popen sys.path.insert(1, '/usr/share/python/') from debpython.version import SUPPORTED, debsorted, vrepr, \ @@ -192,13 +192,19 @@ def compile(files, versions, force, optimize, e_patterns=None): # byte compile files for fn, versions_to_compile in filter_files(files, e_patterns, versions): cfn = fn + 'c' if (__debug__ or not optimize) else 'o' + if not exists(fn): + # pycentral's hook should clean it later + if islink(fn): + log.warn('dangling symlink skipped: %s (%s)', fn, + os.readlink(fn)) + continue if exists(cfn) and not force: ftime = os.stat(fn).st_mtime try: ctime = os.stat(cfn).st_mtime except os.error: ctime = 0 - if (ctime > ftime): + if ctime > ftime: continue for version in versions_to_compile: try: