Skip to content

Commit db7f8b3

Browse files
authored
Merge pull request #3374 from SUSE/third-rarty-repo
Add ThirdPartyRepoMixin
2 parents cdf5273 + bb29443 commit db7f8b3

File tree

8 files changed

+452
-290
lines changed

8 files changed

+452
-290
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ packages = [
1111
{ include = "bci_dockerfile_generator", from = "src" },
1212
{ include = "bci_build", from = "src" },
1313
{ include = "staging", from = "src" },
14-
{ include = "dotnet", from = "src" },
1514
]
1615
requires-python = ">=3.11,<4.0"
1716

src/bci_build/package/__init__.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -664,14 +664,11 @@ def kiwi_derived_from_entry(self) -> str:
664664

665665
@property
666666
def packages(self) -> str:
667-
"""The list of packages joined so that it can be appended to a
668-
:command:`zypper install`.
669-
670-
"""
667+
"""The packages list so that it can be appended to a :command:`zypper install`."""
671668
packages_to_install: list[str] = []
672669
for pkg in self.package_list:
673670
if isinstance(pkg, Package):
674-
if pkg.pkg_type == PackageType.DELETE:
671+
if pkg.pkg_type in (PackageType.DELETE, PackageType.BOOTSTRAP):
675672
continue
676673
if pkg.pkg_type != PackageType.IMAGE:
677674
raise ValueError(
@@ -680,9 +677,19 @@ def packages(self) -> str:
680677
packages_to_install.append(str(pkg))
681678
return " ".join(packages_to_install)
682679

680+
@property
681+
def packages_to_bootstrap(self) -> str:
682+
"""The packages list that is installed in the first stage in a multi stage image."""
683+
packages: list[str] = [
684+
str(pkg)
685+
for pkg in self.package_list
686+
if (isinstance(pkg, Package) and pkg.pkg_type == PackageType.BOOTSTRAP)
687+
]
688+
return " ".join(packages)
689+
683690
@property
684691
def packages_to_delete(self) -> str:
685-
"""The list of packages joined that can be passed to zypper -n rm after an install`."""
692+
"""The packages list that can be passed to zypper -n rm after an install`."""
686693
packages_to_delete: list[str] = [
687694
str(pkg)
688695
for pkg in self.package_list
@@ -1068,6 +1075,8 @@ async def write_files_to_folder(self, dest: str) -> list[str]:
10681075

10691076
self.prepare_template()
10701077

1078+
os.makedirs(dest, mode=0o755, exist_ok=True)
1079+
10711080
async def write_file_to_dest(fname: str, contents: str | bytes) -> None:
10721081
await write_to_file(os.path.join(dest, fname), contents)
10731082

@@ -1459,8 +1468,6 @@ def generate_disk_size_constraints(size_gb: int) -> str:
14591468
"""
14601469

14611470

1462-
from dotnet.updater import DOTNET_CONTAINERS # noqa: E402
1463-
14641471
from .apache_tomcat import TOMCAT_CONTAINERS # noqa: E402
14651472
from .appcontainers import ALERTMANAGER_CONTAINERS # noqa: E402
14661473
from .appcontainers import BLACKBOX_EXPORTER_CONTAINERS # noqa: E402
@@ -1480,6 +1487,7 @@ def generate_disk_size_constraints(size_gb: int) -> str:
14801487
from .basecontainers import MINIMAL_CONTAINERS # noqa: E402
14811488
from .bind import BIND_CONTAINERS # noqa: E402
14821489
from .cosign import COSIGN_CONTAINERS # noqa: E402
1490+
from .dotnet import DOTNET_CONTAINERS # noqa: E402
14831491
from .firefox import FIREFOX_CONTAINERS # noqa: E402
14841492
from .gcc import GCC_CONTAINERS # noqa: E402
14851493
from .git import GIT_CONTAINERS # noqa: E402

0 commit comments

Comments
 (0)