mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
package: Implement installing packages in the component
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
2157cb33b7
commit
d1b040cdb6
2 files changed
+38
-1
No files matched your search
@@ -6,6 +6,7 @@ Framework for installing and updating distribution packages
|
||||
import json
|
||||
import logging
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
from typing import Union
|
||||
|
||||
@@ -50,6 +51,14 @@ class Packages(app.FollowerComponent):
|
||||
"""Return the list of packages managed by this component."""
|
||||
return self._packages
|
||||
|
||||
def setup(self, old_version):
|
||||
"""Install the packages."""
|
||||
# TODO: Drop the need for setup helper.
|
||||
module_name = self.app.__module__
|
||||
module = sys.modules[module_name]
|
||||
helper = module.setup_helper
|
||||
helper.install(self.packages, skip_recommends=self.skip_recommends)
|
||||
|
||||
|
||||
class PackageException(Exception):
|
||||
"""A package operation has failed."""
|
||||
|
||||
Reference in new issue
Block a user