rharwood@eesha:~/pesign.fedora/rawhide$ rpmdev-bumpspec pesign.spec error: Unable to open /home/rharwood/rpmbuild/SOURCES/pesign.patches: No such file or directory error: query of specfile pesign.spec failed, can't parse rharwood@eesha:~/pesign.fedora/rawhide$ ls -l pesign.patches -rw-r--r-- 1 rharwood rharwood 193 Mar 25 15:02 pesign.patches rharwood@eesha:~/pesign.fedora/rawhide$ To me, it looks like rpmdev-bumpspec is looking in the wrong place - somewhere below rpmbuild, which isn't where we are. (This is the `fedpkg clone pesign` directory.) The result, beyond that error, seems to be that rpmdev-bumpspec successfully updates Release, but misses the NVR in the changelog entry: +* Fri Mar 25 2022 Robbie Harwood <rharwood> +- rebuilt (which is the actual issue for me). rharwood@eesha:~/pesign.fedora/rawhide$ rpm -qv rpmdevtools rpmdevtools-9.6-1.fc34.noarch rharwood@eesha:~/pesign.fedora/rawhide$
It's your spec file that breaks "rpm" queries already. Run anything based on "rpm -q --specfile pesign.spec" to see.
> The result, beyond that error, seems to be that rpmdev-bumpspec successfully updates Release, but misses the NVR in the changelog entry: I think it would better to not write partial results when parsing the .spec file fails? I reported this issue with rpmdevtools here: https://pagure.io/rpmdevtools/issue/93 > (This is the `fedpkg clone pesign` directory.) Yes, but rpmdev-bumpspec cannot (or at least, *does not*) know that. Indeed, RPM is quite stupid here, and by default, it will look for files in /home/$USER/rpmbuild/SOURCES/ unless you specify otherwise. I think this is a terrible default nowadays, but changing it will break every user who uses the ~/rpmbuild directory structure. If you want RPM tools to behave in "one flat directory per package" / "dist-git-style", you can put these macros into ~/.rpmmacros, which will render the ~/rpmbuild directory unused, and make all RPM tools look for files only in %(pwd) instead: %_topdir %(pwd) %_rpmtopdir %{_topdir} %_builddir %{_rpmtopdir} %_buildrootdir %{_rpmtopdir} %_sourcedir %{_rpmtopdir} %_specdir %{_rpmtopdir} %_rpmdir %{_rpmtopdir} %_srcrpmdir %{_rpmtopdir}
> If you want RPM tools to behave in "one flat directory per package" / "dist-git-style", you can put these macros into ~/.rpmmacros, which will render the ~/rpmbuild directory unused, and make all RPM tools look for files only in %(pwd) instead: What I want is for there to be a tool I can run that bumps the version in the spec for fedora packages I work on. I don't really care what tool that is so long as it's available. Right now, collective wisdom says that it's rpmdev-bumpspec, but what you're saying suggests that rpmdevtools isn't interested in that use case. Maybe we need a `fedpkg bumpspec` that does all this instead.
> What I want is for there to be a tool I can run that bumps the version in the spec for fedora packages I work on. rpmdev-bumpspec *is* that tool, and it should work for ~99.95% of Fedora .spec files, in both dist-git folders and in ~/rpmbuild directory trees. The only reason it does not work for pesign.spec within its dist-git folder is because it uses the %include RPM macro (only for including a five-line list of Patches?). > but what you're saying suggests that rpmdevtools isn't interested in that use case Only 17 packages (~0.05%) in Fedora use the %include macro, so it's not well supported by our tools in all circumstances (i.e., calling rpmdev-bumpspec in a dist-git repository without having the local macro overrides). So I wouldn't say that rpmdevtools isn't interested, it's just *very low priority* because it affects such a small number of packages, and because most packagers just use the workaround I mentioned above. If you don't want to use the local macro overrides workaround for some reason, please file an RFE for an "fedpkg bumpspec" that automatically overrides "%_sourcedir" with "%(pwd)" when calling rpmdev-bumpspec. I don't think we should add a rather "heavy" and possibly error-prone "am I running within a dist-git repo" detection to rpmdev-bumpspec.
Automatically overriding %_sourcedir would break when using it within rpmbuild's default tree.