Ubuntu Pastebin

Paste from nacc at Wed, 26 Jul 2017 23:45:45 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/gitubuntu/versioning.py b/gitubuntu/versioning.py
index ad88cee..932305d 100644
--- a/gitubuntu/versioning.py
+++ b/gitubuntu/versioning.py
@@ -127,9 +127,12 @@ def _bump_sru_version_string(before, series, current, after, version,
     new_min = 1 if old_min is None else old_min + 1
 
     bumped_parts = ['ubuntu', str(new_maj), '.']
+
     if _series:
         bumped_parts.extend([_series, '.'])
-    elif version in [getattr(v, bump_attr) for v in before + after]:
+    elif any(x.startswith(version) for x in
+        [getattr(v, bump_attr) for v in before + after]
+    ):
         bumped_parts.extend([series, '.'])
     bumped_parts.append(str(new_min))
 
@@ -205,6 +208,9 @@ def test_next_development_version(test_input, expected):
     ([], '16.04', '1.0-1ubuntu1', ['1.0-1ubuntu1'], '1.0-1ubuntu1.16.04.1'),
     (['1.0-1ubuntu1'], '16.04', '1.0-1ubuntu1', ['1.0.1-ubuntu1'], '1.0-1ubuntu1.16.04.1'),
     (['1.0-1ubuntu1'], '16.04', '1.0-1ubuntu1', ['1.0.1-ubuntu2'], '1.0-1ubuntu1.16.04.1'),
+    (['1.0-1ubuntu1.14.04.1'], '16.04', '1.0-1ubuntu1.16.04.1', ['1.0-1ubuntu1.17.10.1'], '1.0-1ubuntu1.16.04.2'),
+    (['1.0-1ubuntu1.14.04.1'], '16.04', '1.0-1ubuntu1', ['1.0-1ubuntu1'], '1.0-1ubuntu1.16.04.1'),
+    (['1.0-1ubuntu1.14.04.1'], '16.04', '1.0-1ubuntu1', ['1.0-1ubuntu1.17.10.1'], '1.0-1ubuntu1.16.04.1'),
 ])
 def test_next_sru_version(before, series, current, after, expected):
     assert _next_sru_version(
Download as text