diff --git a/docs/apt-layer/ostree.md b/docs/apt-layer/ostree.md index 38afd42..377fe42 100644 --- a/docs/apt-layer/ostree.md +++ b/docs/apt-layer/ostree.md @@ -1,3 +1,5 @@ +https://ostreedev.github.io/ostree/ + You've hit on the core of what makes `rpm-ostree` (and systems like it) unique. While `rpm-ostree` adds the RPM layer, `OSTree` itself is the underlying technology that handles the immutable filesystem and atomic updates. Let's break down how OSTree works, covering both the client and server sides. diff --git a/src/apt-ostree.py/python/__init__.py b/src/apt-ostree.py/python/__init__.py index 42f4fc0..3b24e33 100644 --- a/src/apt-ostree.py/python/__init__.py +++ b/src/apt-ostree.py/python/__init__.py @@ -6,6 +6,6 @@ __version__ = "0.1.0" __author__ = "Particle-OS Team" __email__ = "team@particle-os.org" -from .apt_ostree import main +from apt_ostree import main __all__ = ['main'] \ No newline at end of file diff --git a/src/apt-ostree.py/python/__pycache__/__init__.cpython-313.pyc b/src/apt-ostree.py/python/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..5937728 Binary files /dev/null and b/src/apt-ostree.py/python/__pycache__/__init__.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/__pycache__/apt_ostree.cpython-313.pyc b/src/apt-ostree.py/python/__pycache__/apt_ostree.cpython-313.pyc index 96a8304..bae51d7 100644 Binary files a/src/apt-ostree.py/python/__pycache__/apt_ostree.cpython-313.pyc and b/src/apt-ostree.py/python/__pycache__/apt_ostree.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/apt_ostree.egg-info/SOURCES.txt b/src/apt-ostree.py/python/apt_ostree.egg-info/SOURCES.txt index 55a50c9..b971d74 100644 --- a/src/apt-ostree.py/python/apt_ostree.egg-info/SOURCES.txt +++ b/src/apt-ostree.py/python/apt_ostree.egg-info/SOURCES.txt @@ -6,13 +6,13 @@ apt_ostree.egg-info/dependency_links.txt apt_ostree.egg-info/entry_points.txt apt_ostree.egg-info/requires.txt apt_ostree.egg-info/top_level.txt +apt_ostree_dbus/__init__.py +apt_ostree_dbus/interface.py core/__init__.py core/client_manager.py core/daemon.py core/sysroot.py core/transaction.py -dbus/__init__.py -dbus/interface.py tests/test_basic.py utils/__init__.py utils/config.py diff --git a/src/apt-ostree.py/python/apt_ostree.egg-info/entry_points.txt b/src/apt-ostree.py/python/apt_ostree.egg-info/entry_points.txt index 89be9ff..df7dbd3 100644 --- a/src/apt-ostree.py/python/apt_ostree.egg-info/entry_points.txt +++ b/src/apt-ostree.py/python/apt_ostree.egg-info/entry_points.txt @@ -1,2 +1,2 @@ [console_scripts] -apt-ostree = apt_ostree:main +apt-ostree = __init__:main diff --git a/src/apt-ostree.py/python/apt_ostree.egg-info/top_level.txt b/src/apt-ostree.py/python/apt_ostree.egg-info/top_level.txt index 8779cf3..a9a6978 100644 --- a/src/apt-ostree.py/python/apt_ostree.egg-info/top_level.txt +++ b/src/apt-ostree.py/python/apt_ostree.egg-info/top_level.txt @@ -1,3 +1,3 @@ +apt_ostree_dbus core -dbus utils diff --git a/src/apt-ostree.py/python/apt_ostree.py b/src/apt-ostree.py/python/apt_ostree.py index ba3e01b..42b7250 100644 --- a/src/apt-ostree.py/python/apt_ostree.py +++ b/src/apt-ostree.py/python/apt_ostree.py @@ -16,11 +16,11 @@ import os from gi.repository import GLib, GObject from typing import Dict, Optional -# Import our modules -from .core.daemon import AptOstreeDaemon -from .utils.config import ConfigManager -from .utils.logging import AptOstreeLogger -from .utils.security import PolicyKitAuth +# Import our modules - use correct package names +from core.daemon import AptOstreeDaemon +from utils.config import ConfigManager +from utils.logging import AptOstreeLogger +from utils.security import PolicyKitAuth class AptOstreeDaemonApp: """Main daemon application class""" diff --git a/src/apt-ostree.py/python/apt_ostree_dbus/__pycache__/interface.cpython-313.pyc b/src/apt-ostree.py/python/apt_ostree_dbus/__pycache__/interface.cpython-313.pyc index f6fc2e1..215f840 100644 Binary files a/src/apt-ostree.py/python/apt_ostree_dbus/__pycache__/interface.cpython-313.pyc and b/src/apt-ostree.py/python/apt_ostree_dbus/__pycache__/interface.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/apt_ostree_dbus/interface.py b/src/apt-ostree.py/python/apt_ostree_dbus/interface.py index f8d4cd2..c2fdace 100644 --- a/src/apt-ostree.py/python/apt_ostree_dbus/interface.py +++ b/src/apt-ostree.py/python/apt_ostree_dbus/interface.py @@ -123,9 +123,8 @@ class AptOstreeSysrootInterface(dbus.service.Object): str(e) ) - @dbus.service.property("org.debian.aptostree1.Sysroot", - signature="o", - emits_change=True) + # TODO: Expose as D-Bus properties using Get/Set pattern if needed + @property def Booted(self): """Get booted OS object path""" booted_deployment = self.daemon.sysroot.get_booted_deployment() @@ -134,16 +133,12 @@ class AptOstreeSysrootInterface(dbus.service.Object): return f"{self.daemon.BASE_DBUS_PATH}/OS/debian" return "/" - @dbus.service.property("org.debian.aptostree1.Sysroot", - signature="s", - emits_change=True) + @property def Path(self): """Get sysroot path""" return self.daemon.sysroot.path - @dbus.service.property("org.debian.aptostree1.Sysroot", - signature="(sss)", - emits_change=True) + @property def ActiveTransaction(self): """Get active transaction info""" if self.daemon.has_active_transaction(): @@ -155,9 +150,7 @@ class AptOstreeSysrootInterface(dbus.service.Object): ) return ("", "", "") - @dbus.service.property("org.debian.aptostree1.Sysroot", - signature="s", - emits_change=True) + @property def ActiveTransactionPath(self): """Get active transaction D-Bus address""" if self.daemon.has_active_transaction(): @@ -273,9 +266,9 @@ class AptOstreeOSInterface(dbus.service.Object): ) @dbus.service.method("org.debian.aptostree1.OS", - in_signature="asa{sv}", + in_signature="a{sv}", out_signature="o") - def PkgChange(self, packages_added: List[str], packages_removed: List[str], options: Dict[str, Any]): + def PkgChange(self, options: Dict[str, Any]): """Add/remove packages""" try: # Check authorization @@ -286,6 +279,10 @@ class AptOstreeOSInterface(dbus.service.Object): "Not authorized to change packages" ) + # Extract packages from options + packages_added = options.get('packages_added', []) + packages_removed = options.get('packages_removed', []) + # Start transaction operation = "package-change" title = f"Package change: +{len(packages_added)}/-{len(packages_removed)}" @@ -368,47 +365,59 @@ class AptOstreeOSInterface(dbus.service.Object): str(e) ) - @dbus.service.property("org.debian.aptostree1.OS", - signature="a{sv}", - emits_change=True) + # TODO: Expose as D-Bus properties using Get/Set pattern if needed + @property def BootedDeployment(self): - """Get booted deployment""" - return self.daemon.sysroot.get_booted_deployment() or {} + """Get booted deployment info""" + deployment = self.daemon.sysroot.get_booted_deployment() + if deployment: + return { + 'id': deployment.id, + 'osname': deployment.osname, + 'version': deployment.version, + 'timestamp': deployment.timestamp + } + return {} - @dbus.service.property("org.debian.aptostree1.OS", - signature="a{sv}", - emits_change=True) + @property def DefaultDeployment(self): - """Get default deployment""" - # Implementation would get default deployment + """Get default deployment info""" + deployment = self.daemon.sysroot.get_default_deployment() + if deployment: + return { + 'id': deployment.id, + 'osname': deployment.osname, + 'version': deployment.version, + 'timestamp': deployment.timestamp + } return {} - @dbus.service.property("org.debian.aptostree1.OS", - signature="a{sv}", - emits_change=True) + @property def RollbackDeployment(self): - """Get rollback deployment""" - # Implementation would get rollback deployment + """Get rollback deployment info""" + deployment = self.daemon.sysroot.get_rollback_deployment() + if deployment: + return { + 'id': deployment.id, + 'osname': deployment.osname, + 'version': deployment.version, + 'timestamp': deployment.timestamp + } return {} - @dbus.service.property("org.debian.aptostree1.OS", - signature="a{sv}", - emits_change=True) + @property def CachedUpdate(self): - """Get cached update information""" - # Implementation would get cached update + """Get cached update info""" + # Implementation depends on sysroot capabilities return {} - @dbus.service.property("org.debian.aptostree1.OS", - signature="b", - emits_change=True) + @property def HasCachedUpdateRpmDiff(self): - """Whether cached update has RPM diff""" + """Check if cached update has RPM diff""" + # Implementation depends on sysroot capabilities return False - @dbus.service.property("org.debian.aptostree1.OS", - signature="s", - emits_change=True) + @property def Name(self): """Get OS name""" return self.os_name diff --git a/src/apt-ostree.py/python/core/__init__.py b/src/apt-ostree.py/python/core/__init__.py index cd74ec0..bfd9809 100644 --- a/src/apt-ostree.py/python/core/__init__.py +++ b/src/apt-ostree.py/python/core/__init__.py @@ -2,7 +2,7 @@ Core components for apt-ostree daemon """ -from .daemon import AptOstreeDaemon +from core.daemon import AptOstreeDaemon from .transaction import AptOstreeTransaction from .client_manager import ClientManager, ClientInfo from .sysroot import AptOstreeSysroot diff --git a/src/apt-ostree.py/python/core/__pycache__/__init__.cpython-313.pyc b/src/apt-ostree.py/python/core/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..7f74786 Binary files /dev/null and b/src/apt-ostree.py/python/core/__pycache__/__init__.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/core/__pycache__/client_manager.cpython-313.pyc b/src/apt-ostree.py/python/core/__pycache__/client_manager.cpython-313.pyc new file mode 100644 index 0000000..94ecbe1 Binary files /dev/null and b/src/apt-ostree.py/python/core/__pycache__/client_manager.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/core/__pycache__/daemon.cpython-313.pyc b/src/apt-ostree.py/python/core/__pycache__/daemon.cpython-313.pyc new file mode 100644 index 0000000..caa90b8 Binary files /dev/null and b/src/apt-ostree.py/python/core/__pycache__/daemon.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/core/__pycache__/sysroot.cpython-313.pyc b/src/apt-ostree.py/python/core/__pycache__/sysroot.cpython-313.pyc new file mode 100644 index 0000000..50135a0 Binary files /dev/null and b/src/apt-ostree.py/python/core/__pycache__/sysroot.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/core/__pycache__/transaction.cpython-313.pyc b/src/apt-ostree.py/python/core/__pycache__/transaction.cpython-313.pyc new file mode 100644 index 0000000..9a0407e Binary files /dev/null and b/src/apt-ostree.py/python/core/__pycache__/transaction.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/core/daemon.py b/src/apt-ostree.py/python/core/daemon.py index 725893f..b2308dd 100644 --- a/src/apt-ostree.py/python/core/daemon.py +++ b/src/apt-ostree.py/python/core/daemon.py @@ -11,11 +11,11 @@ from gi.repository import GLib, GObject from typing import Dict, Optional, List, Any import logging -from .transaction import AptOstreeTransaction -from .client_manager import ClientManager -from .sysroot import AptOstreeSysroot -from ..dbus.interface import AptOstreeSysrootInterface -from ..utils.security import PolicyKitAuth +from core.transaction import AptOstreeTransaction +from core.client_manager import ClientManager +from core.sysroot import AptOstreeSysroot +from apt_ostree_dbus.interface import AptOstreeSysrootInterface +from utils.security import PolicyKitAuth class AptOstreeDaemon(GObject.Object): """Main daemon object - singleton pattern""" diff --git a/src/apt-ostree.py/python/core/transaction.py b/src/apt-ostree.py/python/core/transaction.py index 3cdebcf..b94348e 100644 --- a/src/apt-ostree.py/python/core/transaction.py +++ b/src/apt-ostree.py/python/core/transaction.py @@ -358,16 +358,13 @@ class AptOstreeTransactionInterface(dbus.service.Object): str(e) ) - @dbus.service.property("org.debian.aptostree1.Transaction", - signature="s", - emits_change=True) + # TODO: Expose as D-Bus properties using Get/Set pattern if needed + @property def Title(self): """Get transaction title""" return self.transaction.title - @dbus.service.property("org.debian.aptostree1.Transaction", - signature="s", - emits_change=True) + @property def InitiatingClientDescription(self): """Get initiating client description""" return self.transaction.client_description diff --git a/src/apt-ostree.py/python/setup.py b/src/apt-ostree.py/python/setup.py index 38e055d..69d3b2c 100644 --- a/src/apt-ostree.py/python/setup.py +++ b/src/apt-ostree.py/python/setup.py @@ -37,7 +37,7 @@ setup( python_requires=">=3.8", entry_points={ 'console_scripts': [ - 'apt-ostree=apt_ostree:main', + 'apt-ostree=__init__:main', ], }, classifiers=[ diff --git a/src/apt-ostree.py/python/utils/__pycache__/__init__.cpython-313.pyc b/src/apt-ostree.py/python/utils/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..1a1feb8 Binary files /dev/null and b/src/apt-ostree.py/python/utils/__pycache__/__init__.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/utils/__pycache__/config.cpython-313.pyc b/src/apt-ostree.py/python/utils/__pycache__/config.cpython-313.pyc new file mode 100644 index 0000000..3921567 Binary files /dev/null and b/src/apt-ostree.py/python/utils/__pycache__/config.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/utils/__pycache__/logging.cpython-313.pyc b/src/apt-ostree.py/python/utils/__pycache__/logging.cpython-313.pyc new file mode 100644 index 0000000..3ab9eec Binary files /dev/null and b/src/apt-ostree.py/python/utils/__pycache__/logging.cpython-313.pyc differ diff --git a/src/apt-ostree.py/python/utils/__pycache__/security.cpython-313.pyc b/src/apt-ostree.py/python/utils/__pycache__/security.cpython-313.pyc new file mode 100644 index 0000000..3fcc8d0 Binary files /dev/null and b/src/apt-ostree.py/python/utils/__pycache__/security.cpython-313.pyc differ