Bug 1762469
Summary: | RFE: fedpkg import SRPM handles <package_name>.rpmlintrc | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Gerald Cox <gbcox> |
Component: | fedpkg | Assignee: | Ondřej Nosek <onosek> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | cqi, dennis, jkeating, lsedlar, onosek, s |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-01-15 00:39:49 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Gerald Cox
2019-10-16 20:01:49 UTC
Changed title to make this into an RFE to request fedpkg import handle processing for <package_name>.rpmlintrc if it exists. I found a method that appears to work. I'm just wondering if that is what the creators of fedpkg intended. 1. Add an additional source statement in the spec file: Source1: <package.name>.rpmlintrc 2. Place the <package.name>.rpmlintrc file in the local fedpkg <package.name> directory 3. Create srpm: fedpkg srpm 4. $ git add -u 5. $ fedpkg clog 6. $ git commit -F clog 7. $ fedpkg import updated.srpm fedpkg responds: diff --git a/<package.name>.rpmlintrc b/<package.name>.rpmlintrc new file mode 100644 index 0000000..ea84abe --- /dev/null +++ b/<package.name>.rpmlintrc @@ -0,0 +1,3 @@ +# SPELLING ERRORS +addFilter(r" spelling-error .* (word") +addFilter(r" no-manual-page-for-binary <package.name>") -------------------------------------------- New content staged and new sources uploaded. Commit if happy or revert with: 'git reset --hard HEAD' (warning: it reverts also eventual user changes). 8. $ git commit --am This package has changed maintainer in the Fedora. Reassigning to the new maintainer of this component. Hello. I wonder why every time to use 'import' command for one repository. Maybe I didn't understand the purpose. I am not the author of the concept. But I suppose the "typical" use is: Create a new project by importing the srpm. And then, iteratively, just update tarball (manually, spectool, ...) and/or other files(s) containing sources (not srpm), bump the version of the specfile, do other eventual changes and build. But your scenario might be different, of course. During import command, all unneeded committed files are removed. Which files are needed is specified in srpm. Therefore .rpmlintrc file is removed. There are more approaches to go: 1) Use 'import' and then add .rpmlintrc and commit it. But after another import, .rpmlintrc will be removed again. 2) Your method listed in your comment can be used. Generally, make the .rpmlintrc part of the srpm. 3) You can also try the method I found: Just add .rpmlintrc file and list the filename in .gitignore. Commit both of them. Next 'import' command should not remove the .rpmlintrc. 4) There is a possibility to patch the code itself. But I am quite cautious to add this kind of exception for everyone. diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 52dcee3..35bc99c 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -1795,7 +1795,7 @@ class Commands(object): # while importing a SRPM. # The list also contains files, that are important and should # not be removed by import command. - reserved_ourfiles = ['README.md', 'gating.yaml', 'tests/*'] + reserved_ourfiles = ['README.md', 'gating.yaml', 'tests/*', '*.rpmlintrc'] # Get a list of files we're currently tracking ourfiles = self.repo.git.ls_files().split('\n') I am not going to change the code now. I hope other listed methods might be sufficient. If there is a demand for it, please, reopen. (In reply to Ondřej Nosek from comment #4) > Hello. > > I wonder why every time to use 'import' command for one repository. Maybe I > didn't understand the purpose. I am not the author of the concept. But I > suppose the "typical" use is: Create a new project by importing the srpm. > And then, iteratively, just update tarball (manually, spectool, ...) and/or > other files(s) containing sources (not srpm), bump the version of the > specfile, do other eventual changes and build. > But your scenario might be different, of course. > > During import command, all unneeded committed files are removed. Which files > are needed is specified in srpm. Therefore .rpmlintrc file is removed. There > are more approaches to go: > > 1) Use 'import' and then add .rpmlintrc and commit it. But after another > import, .rpmlintrc will be removed again. > > 2) Your method listed in your comment can be used. Generally, make the > .rpmlintrc part of the srpm. > > 3) You can also try the method I found: Just add .rpmlintrc file and list > the filename in .gitignore. Commit both of them. Next 'import' command > should not remove the .rpmlintrc. > > 4) There is a possibility to patch the code itself. But I am quite cautious > to add this kind of exception for everyone. > > diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py > index 52dcee3..35bc99c 100644 > --- a/pyrpkg/__init__.py > +++ b/pyrpkg/__init__.py > @@ -1795,7 +1795,7 @@ class Commands(object): > # while importing a SRPM. > # The list also contains files, that are important and should > # not be removed by import command. > - reserved_ourfiles = ['README.md', 'gating.yaml', 'tests/*'] > + reserved_ourfiles = ['README.md', 'gating.yaml', 'tests/*', > '*.rpmlintrc'] > > # Get a list of files we're currently tracking > ourfiles = self.repo.git.ls_files().split('\n') Thanks for taking the time to reply. I've been using the method in comment #2. It seems to be working fine, although it seems to be a bit of a hack. The reason for using fedpkg import srpm is explained in the following thread, in case you are interested. From what I gather, it was created to automate and error-proof the process as much as possible. Since that was the case, I was hoping something could be done to automagically handle rpmlintrc, if it exists. https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/2ZZYKYDD24LCFO6ST6O6RQBCEGKE6WAS/#BC65GAULZEJFR4O5HRT2EPRASESCLBU6 |