]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-pythoneggs.patch
f328c88bf357f5e569c515236d2cbd9d16ba0d17
[packages/rpm.git] / rpm-pythoneggs.patch
1 --- rpm-5.4.10/scripts/pythoneggs.py.orig       2012-05-08 00:34:19.000000000 +0200
2 +++ rpm-5.4.10/scripts/pythoneggs.py    2013-05-09 13:22:26.000000000 +0200
3 @@ -16,7 +16,7 @@
4  from distutils.sysconfig import get_python_lib
5  from subprocess import Popen, PIPE, STDOUT
6  import os
7 -
8 +import re
9  
10  opts, args = getopt(argv[1:], 'hPRSCOEb:',
11          ['help', 'provides', 'requires', 'suggests', 'conflicts', 'obsoletes', 'extras','buildroot='])
12 @@ -29,6 +29,13 @@
13  Extras = False
14  buildroot = None
15  
16 +def make_pldver(raw):
17 +    if re.match(r'^[0-9\.]+$', raw) == None:
18 +       pldver = re.sub(r'([\d\.]+)(.+)', r'\1-0.\2', raw)
19 +    else:
20 +       pldver = raw
21 +    return pldver
22 +
23  for o, a in opts:
24      if o in ('-h', '--help'):
25          print '-h, --help\tPrint help'
26 @@ -125,11 +132,14 @@
27                  if not name in py_deps:
28                      py_deps[name] = []
29                  py_deps[name].append(('==', dist.py_version))
30 -            name = 'pythonegg(%s)' % dist.key
31 +            if dist.py_version .split(".")[0] == '3':
32 +                name = 'python3egg(%s)' % dist.key
33 +            else:
34 +                name = 'pythonegg(%s)' % dist.key
35              if not name in py_deps:
36                  py_deps[name] = []
37              if dist.version:
38 -                spec = ('==', dist.version)
39 +                spec = ('==', make_pldver(dist.version))
40                  if not spec in py_deps[name]:
41                      py_deps[name].append(spec)
42          if Requires or (Suggests and dist.extras):
43 @@ -155,13 +165,17 @@
44                  deps = depsextras
45              # add requires/suggests based on egg metadata
46              for dep in deps:
47 -                name = 'pythonegg(%s)' % dep.key
48 +                if dist.py_version .split(".")[0] == '3':
49 +                    name = 'python3egg(%s)' % dep.key
50 +                else:
51 +                    name = 'pythonegg(%s)' % dep.key
52                  for spec in dep.specs:
53                      if spec[0] != '!=':
54                          if not name in py_deps:
55                              py_deps[name] = []
56 -                        if not spec in py_deps[name]:
57 -                            py_deps[name].append(spec)
58 +                        plddep = (spec[0], make_pldver(spec[1]))
59 +                        if not plddep in py_deps[name]:
60 +                            py_deps[name].append(plddep)
61                  if not dep.specs:
62                      py_deps[name] = []
63          # Unused, for automatic sub-package generation based on 'extras' from egg metadata
This page took 0.021913 seconds and 2 git commands to generate.