befeleme / pyp2spec

Generate Fedora RPM spec files for Python packages
MIT License
11 stars 4 forks source link

Sanitize text fields (License, Summary) #19

Closed befeleme closed 2 years ago

befeleme commented 2 years ago

It can happen that License and Summary provided in the metadata are more than oneliners. Those inputs are not sanitized which breaks SRPM builds.

Example:

Assuming --license=GNU LESSER GENERAL PUBLIC LICENSE
               Version 2.1, February 1999

 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

[This is the first released version of the Lesser GPL.  It also counts
 as the successor of the GNU Library Public License, version 2, hence
 the version number 2.1.]
<snip>

**stderr: error: line 9: Unknown tag:              Version 2.1, February 1999**