Bug 966985

Summary: RFE: mock: please support stopping after the %prep stage
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fweimer, mebrown, msimacek, msuchy, williams
Target Milestone: ---Keywords: FutureFeature, Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-18 16:24:24 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:
Attachments:
Description Flags
mock-prep.py
none
mock-prep.py none

Description Florian Weimer 2013-05-24 13:01:26 UTC
Created attachment 752588 [details]
mock-prep.py

Unpacking source RPMs requires a build root with the build requires installed, so it makes sense to use mock for that.  But there is no direct support for copying the results of the %prep stage out of the build root, so I wrote the attached helper script.  It would be nice to have similar functionality directly in mock.

Comment 1 Florian Weimer 2013-05-24 13:43:16 UTC
Created attachment 752628 [details]
mock-prep.py

Fix target directory handling.

Comment 2 Miroslav Suchý 2014-10-01 19:57:07 UTC
--copyout does not help you here?

Comment 3 Florian Weimer 2014-10-01 20:39:46 UTC
(In reply to Miroslav Suchý from comment #2)
> --copyout does not help you here?

I'm already using that, but I don't see an option to stop the build after the %prep stage.

Comment 4 Miroslav Suchý 2014-10-01 21:09:09 UTC
Well, there is --short-circuit option:
       --short-circuit=STAGE
              Use rpmbuild's short-circuit mechanism to skip already executed stages of build.  It doesn't produce
              RPMs, it's useful only for debugging packaging. Implies --no-clean. STAGE specifies which stage will
              be executed as the first.  Available values: build, install, binary

I just extended it to allow 'prep' which translate to -bp.

Commit in msuchy-work branch as bd15c59

Comment 5 Miroslav Suchý 2014-10-12 21:18:15 UTC
Fixed in mock-1.2.0, which just landed in rawhide.

Comment 6 Michael Simacek 2014-10-14 09:03:34 UTC
Unfortunately, this doesn't work in mock-1.2.0-1, because the prep choice is missing in option parser, so although the code for it is OK, there's no way to invoke it with the commandline option. I sent patch upstream

Comment 7 Miroslav Suchý 2014-10-14 09:40:23 UTC
Commited as 9d7ad7b.

Comment 8 Miroslav Suchý 2014-11-18 16:24:24 UTC
mock-1.2.2 has been release