#557 Preprocess spec files using rpmautospec features and use %autorelease when parsing spec files
Merged by onosek. Opened by nphilipp.
nphilipp/rpkg master--rpmautospec-preprocess  into  master

Download 557.patch

If spec files use rpmautospec features, preprocess them into a temporary directory and point rpmbuild at the pre-processed spec file.

Depends-On: https://pagure.io/fedora-infra/rpmautospec/pull-request/183

If the necessary rpmautospec features aren't present (i.e. before fedora-infra/rpmautospec#183 is merged and release), all this will be skipped.

Also, calculate the release number and pass it to the macro when parsing the spec file which should make fedpkg/rpkg commands display/expect the right NVR when working on rpmautospec-enabled packages.

rebased onto 391813f72cc976a97f3e53967ea09712801b61af

pretty please pagure-ci rebuild

3 new commits added

  • Reflect %autorelease when parsing spec files
  • Preprocess spec files using rpmautospec features
  • Detect generic use of rpmautospec features

@onosek This blocks wider adaptation of rpmautospec and I would really like to start using that. Can I do anything to make this land faster? I can do code review or testing.

rebased onto 4dd9be94443fcec843cf13460fa8ff564388effa

I checked the code (without visible issues) and I can merge it. It would be nice to have one or two simple unittests added.
How urgent releasing of the functionality is?
1) There might be a regular release of rpkg+fedpkg in ~3 weeks (Bodhi waiting is not included).
2) Make a patch of the rpkg package. I suppose it should go out together with the previous PR https://pagure.io/rpkg/pull-request/548# I can possibly work on it on this Thu/Fri.

If we patch the rpkh package, it will be easier to test before the release and we can get some fixes in before the 3 weeks ETA.

I can add unit tests. In order not to require rpmautospec for testing I'll mock its functions.

rebased onto d5e895d13e95bfc1c3ca2e5d9c61ff8d368aebb8

@onosek the latest push adds and augments tests, and fixes some unrelated small things (explicitly sets git repo default branch name in tests, doesn't use deprecated SafeConfigParser with Python 3.x).

Thanks for the tests and extra ConfigParser's fix.

Pull-Request has been merged by onosek

Hello @nphilipp, @churchyard I built a rpkg-1.62-6 packages for testing purposes (for F33, F34, rawhide).
Just a rpkg patch with two PRs:
https://pagure.io/rpkg/pull-request/557
https://pagure.io/rpkg/pull-request/548
Updates are waiting in Bodhi.

I had to remove one of your commits from the build - it caused unit tests to fail in epel8 and epel8-playground:
https://kojipkgs.fedoraproject.org//work/tasks/4827/71484827/build.log
Maybe, I will have to revert the commit later
https://pagure.io/fork/nphilipp/rpkg/c/d5e895d13e95bfc1c3ca2e5d9c61ff8d368aebb8

Hi @onosek, there's an easy fix for old git versions where git init doesn't accept the -b/--initial-branch parameter. I'll submit a PR.

Hi @onosek, here's the PR which should fix tests on EL8: #563

Metadata