You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.0 KiB
26 lines
1.0 KiB
6 years ago
|
From e1cfff321693432f19a9a1303431b2ce4ec4edc9 Mon Sep 17 00:00:00 2001
|
||
|
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
||
|
Date: Wed, 15 May 2019 20:00:59 +0200
|
||
|
Subject: [PATCH 10/14] Remove more common prefixes
|
||
|
|
||
|
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
||
|
---
|
||
|
rust2rpm/metadata.py | 1 +
|
||
|
1 file changed, 1 insertion(+)
|
||
|
|
||
|
diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
|
||
|
index e41902d..1b4faad 100644
|
||
|
--- a/rust2rpm/metadata.py
|
||
|
+++ b/rust2rpm/metadata.py
|
||
|
@@ -139,6 +139,7 @@ class Metadata:
|
||
|
self._description = self._summary = None
|
||
|
return
|
||
|
description = description.replace('\n\n', '\r').replace('\n', ' ').replace('\r', '\n').strip()
|
||
|
+ description = re.sub(rf'^(?:{self.name}|This(?:\s+\w+)?)(?:\s*,|\s+is|\s+provides)\s+', '', description, flags=re.I)
|
||
|
description = re.sub(r'^(?:a|an|the)\s+', '', description, flags=re.I)
|
||
|
description = f'{description[0].upper()}{description[1:]}'
|
||
|
if description[-1] != '.':
|
||
|
--
|
||
|
2.22.0.rc3
|
||
|
|