@@ -1320,58 +1320,58 @@ def finalize_default_initrd(
1320
1320
# Default values are assigned via the parser so we go via the argument parser to construct
1321
1321
# the config for the initrd.
1322
1322
cmdline = [
1323
- "--directory" , " " ,
1324
- "--distribution" , str ( config .distribution ) ,
1325
- "--release" , config .release ,
1326
- "--architecture" , str ( config .architecture ) ,
1327
- * (["--mirror" , config .mirror ] if config .mirror else []),
1328
- "--repository-key-check" , str ( config .repository_key_check ) ,
1329
- "--repository-key-fetch" , str ( config .repository_key_fetch ) ,
1323
+ "--directory= " ,
1324
+ f "--distribution= { config .distribution } " ,
1325
+ f "--release= { config .release } " ,
1326
+ f "--architecture= { config .architecture } " ,
1327
+ * ([f "--mirror= { config .mirror } " ] if config .mirror else []),
1328
+ f "--repository-key-check= { config .repository_key_check } " ,
1329
+ f "--repository-key-fetch= { config .repository_key_fetch } " ,
1330
1330
* ([f"--repositories={ repository } " for repository in config .repositories ]),
1331
1331
* ([f"--sandbox-tree={ tree } " for tree in config .sandbox_trees ]),
1332
1332
# Note that when compress_output == Compression.none == 0 we don't pass --compress-output
1333
1333
# which means the default compression will get picked. This is exactly what we want so that
1334
1334
# initrds are always compressed.
1335
- * (["--compress-output" , str ( config . compress_output ) ] if config .compress_output else []),
1336
- "--compress-level" , str ( config .compress_level ) ,
1337
- "--with-network" , str ( config .with_network ) ,
1338
- "--cache-only" , str ( config .cacheonly ) ,
1339
- * (["--output-directory" , os .fspath (output_dir )] if output_dir else []),
1340
- * (["--workspace-directory" , os .fspath (config .workspace_dir )] if config .workspace_dir else []),
1341
- * (["--cache-directory" , os .fspath (config .cache_dir )] if config .cache_dir else []),
1342
- "--cache-key" , config .cache_key or '-' ,
1343
- * (["--package-cache-directory" , os .fspath (config . package_cache_dir ) ] if config .package_cache_dir else []), # noqa: E501
1344
- * (["--local-mirror" , str ( config .local_mirror ) ] if config .local_mirror else []),
1345
- "--incremental" , str ( config .incremental ) ,
1335
+ * ([f "--compress-output= { c } " ] if ( c := config .compress_output ) else []),
1336
+ f "--compress-level= { config .compress_level } " ,
1337
+ f "--with-network= { config .with_network } " ,
1338
+ f "--cache-only= { config .cacheonly } " ,
1339
+ * ([f "--output-directory= { os .fspath (output_dir )} " ] if output_dir else []),
1340
+ * ([f "--workspace-directory= { os .fspath (config .workspace_dir )} " ] if config .workspace_dir else []),
1341
+ * ([f "--cache-directory= { os .fspath (config .cache_dir )} " ] if config .cache_dir else []),
1342
+ f "--cache-key= { config .cache_key or '-' } " ,
1343
+ * ([f "--package-cache-directory= { os .fspath (p ) } " ] if ( p := config .package_cache_dir ) else []),
1344
+ * ([f "--local-mirror= { config .local_mirror } " ] if config .local_mirror else []),
1345
+ f "--incremental= { config .incremental } " ,
1346
1346
* (f"--profile={ profile } " for profile in config .initrd_profiles ),
1347
1347
* (f"--package={ package } " for package in config .initrd_packages ),
1348
1348
* (f"--volatile-package={ package } " for package in config .initrd_volatile_packages ),
1349
1349
* (f"--package-directory={ d } " for d in config .package_directories ),
1350
1350
* (f"--volatile-package-directory={ d } " for d in config .volatile_package_directories ),
1351
- "--output" , " initrd" ,
1352
- * (["--image-id" , config .image_id ] if config .image_id else []),
1353
- * (["--image-version" , config .image_version ] if config .image_version else []),
1351
+ "--output= initrd" ,
1352
+ * ([f "--image-id= { config .image_id } " ] if config .image_id else []),
1353
+ * ([f "--image-version= { config .image_version } " ] if config .image_version else []),
1354
1354
* (
1355
- ["--source-date-epoch" , str ( config .source_date_epoch ) ]
1355
+ [f "--source-date-epoch= { config .source_date_epoch } " ]
1356
1356
if config .source_date_epoch is not None else
1357
1357
[]
1358
1358
),
1359
- * (["--locale" , config .locale ] if config .locale else []),
1360
- * (["--locale-messages" , config .locale_messages ] if config .locale_messages else []),
1361
- * (["--keymap" , config .keymap ] if config .keymap else []),
1362
- * (["--timezone" , config .timezone ] if config .timezone else []),
1363
- * (["--hostname" , config .hostname ] if config .hostname else []),
1364
- * (["--root-password" , rootpwopt ] if rootpwopt else []),
1359
+ * ([f "--locale= { config .locale } " ] if config .locale else []),
1360
+ * ([f "--locale-messages= { config .locale_messages } " ] if config .locale_messages else []),
1361
+ * ([f "--keymap= { config .keymap } " ] if config .keymap else []),
1362
+ * ([f "--timezone= { config .timezone } " ] if config .timezone else []),
1363
+ * ([f "--hostname= { config .hostname } " ] if config .hostname else []),
1364
+ * ([f "--root-password= { rootpwopt } " ] if rootpwopt else []),
1365
1365
* ([f"--environment={ k } ='{ v } '" for k , v in config .environment .items ()]),
1366
- * (["--tools-tree" , os .fspath (config .tools_tree )] if config .tools_tree and tools else []),
1367
- "--tools-tree-certificates" , str ( config .tools_tree_certificates ) ,
1366
+ * ([f "--tools-tree= { os .fspath (config .tools_tree )} " ] if config .tools_tree and tools else []),
1367
+ f "--tools-tree-certificates= { config .tools_tree_certificates } " ,
1368
1368
* ([f"--extra-search-path={ os .fspath (p )} " for p in config .extra_search_paths ]),
1369
- * (["--proxy-url" , config .proxy_url ] if config .proxy_url else []),
1369
+ * ([f "--proxy-url= { config .proxy_url } " ] if config .proxy_url else []),
1370
1370
* ([f"--proxy-exclude={ host } " for host in config .proxy_exclude ]),
1371
- * (["--proxy-peer-certificate" , os .fspath (p )] if (p := config .proxy_peer_certificate ) else []),
1372
- * (["--proxy-client-certificate" , os .fspath (p )] if (p := config .proxy_client_certificate ) else []),
1373
- * (["--proxy-client-key" , os .fspath (p )] if (p := config .proxy_client_key ) else []),
1374
- "--selinux-relabel" , str ( relabel ) ,
1371
+ * ([f "--proxy-peer-certificate= { os .fspath (p )} " ] if (p := config .proxy_peer_certificate ) else []),
1372
+ * ([f "--proxy-client-certificate= { os .fspath (p )} " ] if (p := config .proxy_client_certificate ) else []),
1373
+ * ([f "--proxy-client-key= { os .fspath (p )} " ] if (p := config .proxy_client_key ) else []),
1374
+ f "--selinux-relabel= { relabel } " ,
1375
1375
"--include=mkosi-initrd" ,
1376
1376
] # fmt: skip
1377
1377
@@ -4287,9 +4287,9 @@ def run_shell(args: Args, config: Config) -> None:
4287
4287
os .chown (addr , stat .st_uid , stat .st_gid )
4288
4288
stack .enter_context (start_journal_remote (config , sock .fileno ()))
4289
4289
cmdline += [
4290
- "--bind" , f" { addr } :/run/host/journal/socket" ,
4290
+ f "--bind= { addr } :/run/host/journal/socket" ,
4291
4291
"--set-credential=journal.forward_to_socket:/run/host/journal/socket" ,
4292
- ] # fmt: skip
4292
+ ]
4293
4293
4294
4294
for p in config .unit_properties :
4295
4295
cmdline += ["--property" , p ]
@@ -4521,35 +4521,35 @@ def finalize_default_tools(config: Config, *, resources: Path) -> Config:
4521
4521
)
4522
4522
4523
4523
cmdline = [
4524
- "--directory" , " " ,
4525
- "--distribution" , str ( config .tools_tree_distribution ) ,
4526
- * (["--release" , config .tools_tree_release ] if config .tools_tree_release else []),
4524
+ "--directory= " ,
4525
+ f "--distribution= { config .tools_tree_distribution } " ,
4526
+ * ([f "--release= { config .tools_tree_release } " ] if config .tools_tree_release else []),
4527
4527
* ([f"--profile={ profile } " for profile in config .tools_tree_profiles ]),
4528
- * (["--mirror" , config .tools_tree_mirror ] if config .tools_tree_mirror else []),
4528
+ * ([f "--mirror= { config .tools_tree_mirror } " ] if config .tools_tree_mirror else []),
4529
4529
* ([f"--repositories={ repository } " for repository in config .tools_tree_repositories ]),
4530
4530
* ([f"--sandbox-tree={ tree } " for tree in config .tools_tree_sandbox_trees ]),
4531
- "--repository-key-check" , str ( config .repository_key_check ) ,
4532
- "--repository-key-fetch" , str ( config .repository_key_fetch ) ,
4533
- "--cache-only" , str ( config .cacheonly ) ,
4534
- * (["--output-directory" , os .fspath (config . output_dir ) ] if config .output_dir else []),
4535
- * (["--workspace-directory" , os .fspath (config . workspace_dir ) ] if config .workspace_dir else []),
4536
- * (["--cache-directory" , os .fspath (config . cache_dir ) ] if config .cache_dir else []),
4531
+ f "--repository-key-check= { config .repository_key_check } " ,
4532
+ f "--repository-key-fetch= { config .repository_key_fetch } " ,
4533
+ f "--cache-only= { config .cacheonly } " ,
4534
+ * ([f "--output-directory= { os .fspath (p ) } " ] if ( p := config .output_dir ) else []),
4535
+ * ([f "--workspace-directory= { os .fspath (p ) } " ] if ( p := config .workspace_dir ) else []),
4536
+ * ([f "--cache-directory= { os .fspath (p ) } " ] if ( p := config .cache_dir ) else []),
4537
4537
"--cache-key=tools" ,
4538
- * (["--package-cache-directory" , os .fspath (config . package_cache_dir ) ] if config .package_cache_dir else []), # noqa: E501
4539
- "--incremental" , str ( config .incremental ) ,
4538
+ * ([f "--package-cache-directory= { os .fspath (p ) } " ] if ( p := config .package_cache_dir ) else []),
4539
+ f "--incremental= { config .incremental } " ,
4540
4540
* ([f"--package={ package } " for package in config .tools_tree_packages ]),
4541
4541
* ([f"--package-directory={ os .fspath (directory )} " for directory in config .tools_tree_package_directories ]), # noqa: E501
4542
4542
* ([f"--build-sources={ tree } " for tree in config .build_sources ]),
4543
- "--build-sources-ephemeral" , str ( config .build_sources_ephemeral ) ,
4543
+ f "--build-sources-ephemeral= { config .build_sources_ephemeral } " ,
4544
4544
* ([f"--prepare-script={ os .fspath (script )} " for script in config .tools_tree_prepare_scripts ]),
4545
4545
"--output=tools" ,
4546
- * (["--source-date-epoch" , str ( config . source_date_epoch ) ] if config .source_date_epoch is not None else []), # noqa: E501
4546
+ * ([f "--source-date-epoch= { e } " ] if ( e := config .source_date_epoch ) is not None else []),
4547
4547
* ([f"--environment={ k } ='{ v } '" for k , v in config .environment .items ()]),
4548
- * (["--proxy-url" , config .proxy_url ] if config .proxy_url else []),
4548
+ * ([f "--proxy-url= { config .proxy_url } " ] if config .proxy_url else []),
4549
4549
* ([f"--proxy-exclude={ host } " for host in config .proxy_exclude ]),
4550
- * (["--proxy-peer-certificate" , os .fspath (p )] if (p := config .proxy_peer_certificate ) else []),
4551
- * (["--proxy-client-certificate" , os .fspath (p )] if (p := config .proxy_client_certificate ) else []),
4552
- * (["--proxy-client-key" , os .fspath (p )] if (p := config .proxy_client_key ) else []),
4550
+ * ([f "--proxy-peer-certificate= { os .fspath (p )} " ] if (p := config .proxy_peer_certificate ) else []),
4551
+ * ([f "--proxy-client-certificate= { os .fspath (p )} " ] if (p := config .proxy_client_certificate ) else []),
4552
+ * ([f "--proxy-client-key= { os .fspath (p )} " ] if (p := config .proxy_client_key ) else []),
4553
4553
] # fmt: skip
4554
4554
4555
4555
_ , [tools ] = parse_config (
@@ -4980,7 +4980,7 @@ def run_verb(args: Args, images: Sequence[Config], *, resources: Path) -> None:
4980
4980
4981
4981
if args .verb == Verb .dependencies :
4982
4982
_ , [deps ] = parse_config (
4983
- ["--directory" , "" , " --repositories" , " " , * args .cmdline , "--include=mkosi-tools" , "build" ],
4983
+ ["--directory= " , "--repositories= " , * args .cmdline , "--include=mkosi-tools" , "build" ],
4984
4984
resources = resources ,
4985
4985
)
4986
4986
0 commit comments