Skip to content

Commit

Permalink
Change default translation for py2 in RDO
Browse files Browse the repository at this point in the history
RDO does not have python2-foo packages for everything but python2-foo
packages usually Provides python-foo packages. So change the default
translation for python2 packages to python-foo (instead of
python2-foo).

Change-Id: I51cacf2de8fd108b224f442bd760fa8ba43daec9
  • Loading branch information
toabctl committed Oct 13, 2017
1 parent a5858ac commit 9eb8f76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pymod2pkg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def default_rdo_tr(mod):
pkg = pkg.replace('_', '-').replace('.', '-').lower()
if not pkg.startswith('python-'):
pkg = 'python-' + pkg
py2pkg = re.sub('python', 'python2', pkg)
py2pkg = pkg
py3pkg = re.sub('python', 'python3', pkg)
return (pkg, py2pkg, py3pkg)

Expand Down
6 changes: 5 additions & 1 deletion tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ def test_translation_py2py3_ubuntu(self):
def test_default_translation_py2py3_rdo(self):
self.assertEqual(pymod2pkg.module2package('oslo.db', 'fedora',
py_vers=['py2', 'py3']),
['python2-oslo-db', 'python3-oslo-db'])
['python-oslo-db', 'python3-oslo-db'])
self.assertEqual(pymod2pkg.module2package('foobar', 'fedora',
py_vers=['py', 'py2', 'py3']),
['python-foobar', 'python-foobar', 'python3-foobar'])

self.assertEqual(pymod2pkg.module2package('Babel', 'fedora',
py_vers=['py2', 'py3']),
['python-babel', 'python3-babel'])
Expand Down

0 comments on commit 9eb8f76

Please sign in to comment.