~mitya57/ubuntu/trusty/dh-python/tests-dependencies

« back to all changes in this revision

Viewing changes to dh_python2

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-11-05 08:52:12 UTC
  • mfrom: (4.1.10 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131105085212-94bvsjcswdwvzuo7
Tags: 1.20131021-1ubuntu2
Add drop_nonexisting_versions.patch: In tests/Makefile, drop Python 2.6
and 3.2 as supported, we do not have them in Debian and Ubuntu any more.
(Closes: #727674)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
import sys
28
28
from filecmp import dircmp, cmpfiles, cmp as fcmp
29
29
from optparse import OptionParser, SUPPRESS_HELP
30
 
from os.path import isabs, isdir, islink, exists, join, normpath, realpath
 
30
from os.path import isabs, isdir, islink, exists, join, normpath, splitext,\
 
31
    realpath
31
32
from shutil import copy as fcopy
32
33
from dhpython.debhelper import DebHelper
33
34
from dhpython.depends import Dependencies
48
49
DEFAULT = default('cpython2')
49
50
SUPPORTED = supported('cpython2')
50
51
 
 
52
fext = lambda fname: splitext(fname)[-1][1:]
 
53
 
51
54
 
52
55
class Scanner(Scan):
53
56
    def handle_ext(self, fpath):
118
121
    dstdir = join(debian, package, 'usr/share/pyshared/',
119
122
                  '/'.join(dir1.split('/')[6:]))
120
123
 
121
 
    fext = lambda fname: fname.rsplit('.', 1)[-1]
122
 
 
123
124
    for i in os.listdir(dir1):
124
125
        fpath1 = join(dir1, i)
125
126
        if isdir(fpath1) and not islink(fpath1):
161
162
        fpath1 = join(dir1, i)
162
163
        if isdir(fpath1):
163
164
            create_ext_links(fpath1)
164
 
        elif i.rsplit('.', 1)[-1] == 'so':
 
165
        elif fext(i) == 'so':
165
166
            fpath2 = join(dstdir, i)
166
167
            if exists(fpath2):
167
168
                continue
222
223
        common_files = cmpfiles(dir1, dir2, common_files, shallow=False)[0]
223
224
 
224
225
    for fn in common_files:
225
 
        if 'so' in fn.split('.'):  # foo.so, bar.so.0.1.2, etc.
 
226
        if 'so' in fn.split('.') and not fn.startswith('so'):
 
227
            # foo.so, bar.so.0.1.2, etc.
226
228
            # in unlikely case where extensions are exactly the same
227
229
            continue
228
230
        fpath1 = join(dir1, fn)