summarylogtreecommitdiffstats
path: root/setuptools-replace-newlines-in-description.patch
blob: 9482d84150fc61c80d1f571130741519fcaa1fcc (plain)
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
29
30
31
--- catkin_pkg-0.4.24/src/catkin_pkg/python_setup.py
+++ catkin_pkg-0.4.24/src/catkin_pkg/python_setup.py
@@ -58,7 +58,10 @@
 
     The "description" is taken from the eponymous tag if it does not
     exceed 200 characters. If it does "description" contains the
-    truncated text while "description_long" contains the complete.
+    truncated text while "long_description" contains the complete.
+
+    The description shouldn't contain newlines, remove them automatically
+    here and leave them in long_description.
 
     All licenses are merged into the "license" field.
 
@@ -98,10 +101,13 @@
     elif package.urls:
         data['url'] = package.urls[0].url
 
-    if len(package.description) <= 200:
-        data['description'] = package.description
+    description = package.description.replace('\n', ' ')
+    if len(description) <= 200:
+        data['description'] = description
     else:
-        data['description'] = package.description[:197] + '...'
+        data['description'] = description[:197] + '...'
+
+    if data['description'] != package.description:
         data['long_description'] = package.description
 
     data['license'] = ', '.join(package.licenses)