|
84 | 84 | yes_no, |
85 | 85 | ) |
86 | 86 | from mkosi.context import Context |
87 | | -from mkosi.distributions import Distribution, detect_distribution |
| 87 | +from mkosi.distributions import Distribution, DistributionRelease, detect_distribution |
88 | 88 | from mkosi.documentation import show_docs |
89 | 89 | from mkosi.installer import clean_package_manager_metadata |
90 | 90 | from mkosi.kmod import gen_required_kernel_modules, loaded_modules, process_kernel_modules |
@@ -595,7 +595,7 @@ def run_configure_scripts(config: Config) -> Config: |
595 | 595 |
|
596 | 596 | env = dict( |
597 | 597 | DISTRIBUTION=str(config.distribution), |
598 | | - RELEASE=config.release, |
| 598 | + RELEASE=str(config.release), |
599 | 599 | ARCHITECTURE=str(config.architecture), |
600 | 600 | QEMU_ARCHITECTURE=config.architecture.to_qemu(), |
601 | 601 | DISTRIBUTION_ARCHITECTURE=config.distribution.architecture(config.architecture), |
@@ -641,7 +641,7 @@ def run_sync_scripts(config: Config) -> None: |
641 | 641 |
|
642 | 642 | env = dict( |
643 | 643 | DISTRIBUTION=str(config.distribution), |
644 | | - RELEASE=config.release, |
| 644 | + RELEASE=str(config.release), |
645 | 645 | ARCHITECTURE=str(config.architecture), |
646 | 646 | DISTRIBUTION_ARCHITECTURE=config.distribution.architecture(config.architecture), |
647 | 647 | SRCDIR="/work/src", |
@@ -754,7 +754,7 @@ def run_prepare_scripts(context: Context, build: bool) -> None: |
754 | 754 |
|
755 | 755 | env = dict( |
756 | 756 | DISTRIBUTION=str(context.config.distribution), |
757 | | - RELEASE=context.config.release, |
| 757 | + RELEASE=str(context.config.release), |
758 | 758 | ARCHITECTURE=str(context.config.architecture), |
759 | 759 | DISTRIBUTION_ARCHITECTURE=context.config.distribution.architecture(context.config.architecture), |
760 | 760 | BUILDROOT="/buildroot", |
@@ -822,7 +822,7 @@ def run_build_scripts(context: Context) -> None: |
822 | 822 |
|
823 | 823 | env = dict( |
824 | 824 | DISTRIBUTION=str(context.config.distribution), |
825 | | - RELEASE=context.config.release, |
| 825 | + RELEASE=str(context.config.release), |
826 | 826 | ARCHITECTURE=str(context.config.architecture), |
827 | 827 | DISTRIBUTION_ARCHITECTURE=context.config.distribution.architecture(context.config.architecture), |
828 | 828 | BUILDROOT="/buildroot", |
@@ -897,7 +897,7 @@ def run_postinst_scripts(context: Context) -> None: |
897 | 897 |
|
898 | 898 | env = dict( |
899 | 899 | DISTRIBUTION=str(context.config.distribution), |
900 | | - RELEASE=context.config.release, |
| 900 | + RELEASE=str(context.config.release), |
901 | 901 | ARCHITECTURE=str(context.config.architecture), |
902 | 902 | DISTRIBUTION_ARCHITECTURE=context.config.distribution.architecture(context.config.architecture), |
903 | 903 | BUILDROOT="/buildroot", |
@@ -966,7 +966,7 @@ def run_finalize_scripts(context: Context) -> None: |
966 | 966 |
|
967 | 967 | env = dict( |
968 | 968 | DISTRIBUTION=str(context.config.distribution), |
969 | | - RELEASE=context.config.release, |
| 969 | + RELEASE=str(context.config.release), |
970 | 970 | ARCHITECTURE=str(context.config.architecture), |
971 | 971 | DISTRIBUTION_ARCHITECTURE=context.config.distribution.architecture(context.config.architecture), |
972 | 972 | BUILDROOT="/buildroot", |
@@ -1035,7 +1035,7 @@ def run_postoutput_scripts(context: Context) -> None: |
1035 | 1035 |
|
1036 | 1036 | env = dict( |
1037 | 1037 | DISTRIBUTION=str(context.config.distribution), |
1038 | | - RELEASE=context.config.release, |
| 1038 | + RELEASE=str(context.config.release), |
1039 | 1039 | ARCHITECTURE=str(context.config.architecture), |
1040 | 1040 | DISTRIBUTION_ARCHITECTURE=context.config.distribution.architecture(context.config.architecture), |
1041 | 1041 | SRCDIR="/work/src", |
@@ -3408,12 +3408,14 @@ def make_image( |
3408 | 3408 | cmdline += ["--definitions", workdir(d)] |
3409 | 3409 | opts += ["--ro-bind", d, workdir(d)] |
3410 | 3410 |
|
3411 | | - def can_orphan_file(distribution: Optional[Distribution], release: Optional[str]) -> bool: |
| 3411 | + def can_orphan_file( |
| 3412 | + distribution: Optional[Distribution], release: Optional[DistributionRelease] |
| 3413 | + ) -> bool: |
3412 | 3414 | if distribution is None: |
3413 | 3415 | return True |
3414 | 3416 |
|
3415 | 3417 | return not ( |
3416 | | - (distribution == Distribution.centos and release and GenericVersion(release) == 9) |
| 3418 | + (distribution == Distribution.centos and release and release == 9) |
3417 | 3419 | or (distribution == Distribution.ubuntu and release == "jammy") |
3418 | 3420 | ) |
3419 | 3421 |
|
@@ -4149,7 +4151,7 @@ def run_sandbox(args: Args, config: Config) -> None: |
4149 | 4151 | if hd: |
4150 | 4152 | env |= {"MKOSI_HOST_DISTRIBUTION": str(hd)} |
4151 | 4153 | if hr: |
4152 | | - env |= {"MKOSI_HOST_RELEASE": hr} |
| 4154 | + env |= {"MKOSI_HOST_RELEASE": str(hr)} |
4153 | 4155 | if config.tools() != Path("/"): |
4154 | 4156 | env |= {"MKOSI_DEFAULT_TOOLS_TREE_PATH": os.fspath(config.tools())} |
4155 | 4157 |
|
@@ -4580,7 +4582,7 @@ def run_clean_scripts(config: Config) -> None: |
4580 | 4582 |
|
4581 | 4583 | env = dict( |
4582 | 4584 | DISTRIBUTION=str(config.distribution), |
4583 | | - RELEASE=config.release, |
| 4585 | + RELEASE=str(config.release), |
4584 | 4586 | ARCHITECTURE=str(config.architecture), |
4585 | 4587 | DISTRIBUTION_ARCHITECTURE=config.distribution.architecture(config.architecture), |
4586 | 4588 | SRCDIR="/work/src", |
|
0 commit comments