feat: release v2.0.0 with tab completion, package filtering, db health checks, flatpak and logrotate
Build and Publish Release / Build Packages and Publish (push) Successful in 27s
Build and Publish Release / Build Packages and Publish (push) Successful in 27s
This commit is contained in:
1 parent
8d4157b42d
commit
8bec4ed932
27 files changed
+1053
-69
No files matched your search
@@ -29,8 +29,17 @@ class DnfManager(PackageManager):
|
||||
cmd = [self.binary, "makecache"]
|
||||
return self.runner.run(cmd)
|
||||
|
||||
def check_updates(self) -> List[PackageUpdate]:
|
||||
def check_updates(
|
||||
self,
|
||||
exclude: Optional[List[str]] = None,
|
||||
security_only: bool = False,
|
||||
) -> List[PackageUpdate]:
|
||||
cmd = [self.binary, "check-update"]
|
||||
if security_only:
|
||||
cmd.append("--security")
|
||||
if exclude:
|
||||
for pat in exclude:
|
||||
cmd.extend(["-x", pat])
|
||||
res = self.runner.run(cmd)
|
||||
|
||||
# DNF returns exit code 100 when updates are found, 0 when clean
|
||||
@@ -56,6 +65,8 @@ class DnfManager(PackageManager):
|
||||
def apply_updates(
|
||||
self,
|
||||
packages: Optional[List[str]] = None,
|
||||
exclude: Optional[List[str]] = None,
|
||||
security_only: bool = False,
|
||||
dry_run: bool = False,
|
||||
non_interactive: bool = False,
|
||||
) -> CommandResult:
|
||||
@@ -65,6 +76,13 @@ class DnfManager(PackageManager):
|
||||
else:
|
||||
cmd.append("-y")
|
||||
|
||||
if security_only:
|
||||
cmd.append("--security")
|
||||
|
||||
if exclude:
|
||||
for pat in exclude:
|
||||
cmd.extend(["-x", pat])
|
||||
|
||||
if packages:
|
||||
cmd.extend(packages)
|
||||
|
||||
@@ -412,3 +430,13 @@ class DnfManager(PackageManager):
|
||||
Path("/var/lib/rpm/.rpm.lock"),
|
||||
Path("/var/run/dnf.pid"),
|
||||
]
|
||||
|
||||
def verify_db_consistency(self) -> Tuple[bool, str]:
|
||||
check_res = self.runner.run([self.binary, "check"])
|
||||
if check_res.return_code != 0:
|
||||
msg = check_res.stderr.strip() or check_res.stdout.strip() or "Transaction database issues found"
|
||||
return False, f"dnf check found package database issues: {msg[:100]}"
|
||||
return True, "RPM database is consistent."
|
||||
|
||||
def repair_db(self) -> CommandResult:
|
||||
return self.runner.run([self.binary, "clean", "all"])
|
||||
Reference in new issue
Block a user