force build

This commit is contained in:
Louis Abel 2022-07-11 16:01:19 -07:00
parent cee688b2c2
commit 1ba76a849a
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
2 changed files with 14 additions and 0 deletions

View File

@ -16,6 +16,7 @@ parser.add_argument('--logger', type=str)
parser.add_argument('--live-iso-mode', type=str, default='local')
parser.add_argument('--hashed', action='store_true')
parser.add_argument('--just-copy-it', action='store_true', help="Just copy the images to the compose dir")
parser.add_argument('--force-build', action='store_true', help="Just build and overwrite the images")
results = parser.parse_args()
rlvars = rldict[results.release]
major = rlvars['major']
@ -30,6 +31,7 @@ a = LiveBuild(
compose_dir_is_here=results.local_compose,
hashed=results.hashed,
justcopyit=results.just_copy_it,
force_build=results.force_build,
logger=results.logger
)

View File

@ -1426,6 +1426,7 @@ class LiveBuild:
hashed: bool = False,
image=None,
justcopyit: bool = False,
force_build: bool = False,
logger=None
):
@ -1449,6 +1450,7 @@ class LiveBuild:
self.live_result_root = config['mock_work_root'] + "/lmc"
self.mock_isolation = isolation
self.force_download = force_download
self.force_build = force_build
self.live_iso_mode = live_iso_mode
self.checksum = rlvars['checksum']
self.profile = rlvars['profile']
@ -1863,6 +1865,16 @@ class LiveBuild:
self.major_version,
arch
)
if self.justcopyit:
if os.path.exists(os.path.join(live_res_dir, isoname)):
self.log.warn(Color.WARN + 'Image already exists.')
if self.force_build:
self.log.warn(Color.WARN + 'Building anyway.')
else:
self.log.warn(Color.WARN + 'Skipping.')
return
live_iso_cmd = '/bin/bash {}/liveisobuild-{}-{}.sh'.format(entries_dir, arch, image)
self.log.info('Starting mock build...')
p = subprocess.call(shlex.split(live_iso_cmd))