Add archiving option, fix exceptions, caused by multiline content in rpm spec files, remove shebangs, fix missing provides_extra field#215
Closed
huakim wants to merge 6 commits intoopenSUSE:masterfrom
huakim:master
Closed
Add archiving option, fix exceptions, caused by multiline content in rpm spec files, remove shebangs, fix missing provides_extra field#215huakim wants to merge 6 commits intoopenSUSE:masterfrom huakim:master
huakim wants to merge 6 commits intoopenSUSE:masterfrom
huakim:master
Conversation
…rpm spec files, remove shebangs, fix missing provides_extra field
danigm
requested changes
Jan 9, 2025
Contributor
danigm
left a comment
There was a problem hiding this comment.
Looks mostly good. I think that the optional libarchive dep can be avoided using the python standard library.
Also the sanitize of multiline fields can be done in the fix_data function instead of in templates.
py2pack/__init__.py
Outdated
|
|
||
|
|
||
| def pypi_archive_file(file_path): | ||
| if libarchive is None: |
Contributor
Contributor
Author
There was a problem hiding this comment.
we can add if libarchive is None: pypi_archive_file_using_tarfile_or_zipfile(file_path) later here
py2pack/templates/fedora.spec
Outdated
| Version: {{ version }} | ||
| Release: %autorelease | ||
| Summary: {{ summary }} | ||
| Summary: {{ summary|replace('\n','') }} |
Contributor
There was a problem hiding this comment.
I think it's not needed to modify the templates, you have defined the new fix_data function, what if we do this sanitize operation there instead of doing it in the templates? We can add to the fix_data function something like:
single_line_fields = ['summary', 'license', 'home_page', 'source_url']
for field in single_line_fields:
if field not in data_info:
continue
# remove line breaks to avoid multiline rpm spec file
data_info[field] = data_info[field].replace('\n', ' ')
Contributor
There was a problem hiding this comment.
Why are you removing these example files?
Co-authored-by: danigm <daniel.garcia@suse.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.