Skip to content

Commit 51b8057

Browse files
authored
[AzL3Tdnf] Refactoring TDNF Package Manager separating Azure Linux specializations in it's own implementation (#331)
Refactoring TDNFPackageManager with Azure Linux specializations added to AzL3TdnfPackageManager. This is a follow up PR based on the comments in: #318 1. #318 (comment) 2. #318 (comment) 3. #318 (comment) Tests Results: - AzL3 StrictSDP: [2.core.log](https://github.com/user-attachments/files/22669914/2.core.log) [2.status.txt](https://github.com/user-attachments/files/22669915/2.status.txt) - Mariner Base Support: [2.core.log](https://github.com/user-attachments/files/22670158/2.core.log) [2.status.txt](https://github.com/user-attachments/files/22670160/2.status.txt) - AzL3 Base Support: [2.core.log](https://github.com/user-attachments/files/22669923/2.core.log) [2.status.txt](https://github.com/user-attachments/files/22669924/2.status.txt)
1 parent 407f78c commit 51b8057

File tree

6 files changed

+1655
-1538
lines changed

6 files changed

+1655
-1538
lines changed

src/core/src/package_managers/AzL3TdnfPackageManager.py

Lines changed: 16 additions & 725 deletions
Large diffs are not rendered by default.

src/core/src/package_managers/PackageManager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,8 @@ def install_security_updates_azgps_coordinated(self):
349349

350350
@abstractmethod
351351
def try_meet_azgps_coordinated_requirements(self):
352-
# type: () -> bool
353352
""" Returns true if the package manager meets the requirements for azgps coordinated security updates """
354-
return False
353+
pass
355354
# endregion
356355

357356
# region Package Information

src/core/src/package_managers/TdnfPackageManager.py

Lines changed: 767 additions & 0 deletions
Large diffs are not rendered by default.

src/core/tests/Test_AzL3TdnfPackageManager.py

Lines changed: 0 additions & 811 deletions
Large diffs are not rendered by default.

src/core/tests/Test_TdnfPackageManager.py

Lines changed: 861 additions & 0 deletions
Large diffs are not rendered by default.

src/tools/Package-Core.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ def generate_compiled_script(source_code_path, merged_file_full_path, merged_fil
130130
continue
131131
elif os.path.basename(file_path) in ('PackageManager.py', 'Constants.py', 'LifecycleManager.py', 'SystemctlManager.py'):
132132
modules_to_be_merged.insert(0, file_path)
133+
elif os.path.basename(file_path) == 'TdnfPackageManager.py':
134+
# Insert before `AzL3PackageManager.py`; fallback to append.
135+
inserted = False
136+
for i, p in enumerate(modules_to_be_merged):
137+
if os.path.basename(p) == 'AzL3TdnfPackageManager.py':
138+
modules_to_be_merged.insert(i, file_path)
139+
inserted = True
140+
break
141+
if not inserted:
142+
modules_to_be_merged.append(file_path)
133143
else:
134144
if len(modules_to_be_merged) > 0 and '__main__.py' in modules_to_be_merged[-1]:
135145
modules_to_be_merged.insert(-1, file_path)

0 commit comments

Comments
 (0)