Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
DIRACOS: allows for running mock without cleaning the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Jan 29, 2021
1 parent 9aeaaae commit 77a6b73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion diracos/diracoslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,17 +360,20 @@ def _buildFromSRPM(packageCfg):
logging.info('Finished')


def _mockRebuild(srpmFile, mockConfigFile):
def _mockRebuild(srpmFile, mockConfigFile, noClean=False):
"""
Rebuild RPMs from a SRPM using mock
:param srpmFile: path to the SRPM file
:param mockConfigFile: path to the mock config file. Otherwise, mock will use the system one
:param noClean: if True, will not clean the mock environment before building
"""

cmd = ['/usr/bin/mock']
if mockConfigFile:
cmd += ['-r', mockConfigFile]
if noClean:
cmd += ['--no-clean']
cmd += ['--rebuild', srpmFile]

logging.debug("Rebuild SRPM with %s", cmd)
Expand Down

0 comments on commit 77a6b73

Please sign in to comment.