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

pycompile: skip dangling symlinks

parent 5b9181bf
No related branches found
Tags debian/2.6.6-10
No related merge requests found
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
......
......@@ -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:
......
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