diff --git a/FileSets/PageSettingsPackageManager.qml b/FileSets/PageSettingsPackageManager.qml index e8cae44..4993f65 100644 --- a/FileSets/PageSettingsPackageManager.qml +++ b/FileSets/PageSettingsPackageManager.qml @@ -10,14 +10,12 @@ MbPage { property string settingsPrefix: "com.victronenergy.settings/Settings/PackageManager" property string servicePrefix: "com.victronenergy.packageManager" property string bindVrmloggerPrefix: "com.victronenergy.logger" - VBusItem { id: downloadStatus; bind: Utils.path(servicePrefix, "/GitHubUpdateStatus") } - VBusItem { id: installStatus; bind: Utils.path(servicePrefix, "/InstallStatus") } + VBusItem { id: pmStatus; bind: Utils.path(servicePrefix, "/PmStatus") } VBusItem { id: mediaStatus; bind: Utils.path(servicePrefix, "/MediaUpdateStatus") } VBusItem { id: actionNeeded; bind: Utils.path(servicePrefix, "/ActionNeeded") } VBusItem { id: editAction; bind: Utils.path(servicePrefix, "/GuiEditAction") } - property bool showInstallStatus: installStatus.valid && installStatus.value != "" property bool showMediaStatus: mediaStatus.valid && mediaStatus.value != "" - property bool showControls: installStatus.valid + property bool showControls: pmStatus.valid model: VisibleItemModel { @@ -27,15 +25,11 @@ MbPage { text: { if (! showControls) - return"Package manager not running" - else if (installStatus.valid && installStatus.value != "") - return installStatus.value + return "Package manager not running" else if (mediaStatus.valid && mediaStatus.value != "") return mediaStatus.value - else if (downloadStatus.valid && downloadStatus.value != "") - return downloadStatus.value else - return "idle" + return pmStatus.value } wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter diff --git a/FileSets/PageSettingsPmInitialize.qml b/FileSets/PageSettingsPmInitialize.qml index 723f100..8d322ad 100644 --- a/FileSets/PageSettingsPmInitialize.qml +++ b/FileSets/PageSettingsPmInitialize.qml @@ -10,8 +10,6 @@ MbPage { property string settingsPrefix: "com.victronenergy.settings/Settings/PackageManager" property bool pmRunning: installStatus.valid - property VBusItem editAction: VBusItem { bind: Utils.path(servicePrefix, "/GuiEditAction") } - VBusItem { id: installStatus; bind: Utils.path(servicePrefix, "/InstallStatus") } property bool showInProgress: false onPmRunningChanged: { showInProgress = false } diff --git a/PackageManager.py b/PackageManager.py index fc4ac1e..818c1fd 100755 --- a/PackageManager.py +++ b/PackageManager.py @@ -133,9 +133,7 @@ # # /GuiEditStatus a text message to report edit status to the GUI # -# /GitHubUpdateStatus as above for automatic GitHub update -# -# /InstallStatus as above for automatic install/uninstall +# /PmStatus as above for main Package Manager status # # /MediaUpdateStatus as above for SD/USB media transfers # @@ -450,7 +448,7 @@ def PushAction (command=None, source=None): parts = command.split (":") - queue = None + theQueue = None if len (parts) >= 1: action = parts[0] else: @@ -465,7 +463,7 @@ def PushAction (command=None, source=None): if package != None: package.DownloadPending = True DbusIf.UNLOCK () - queue = DownloadGitHub.DownloadQueue + theQueue = DownloadGitHub.DownloadQueue queueText = "Download" elif action == 'install' or action == 'uninstall': DbusIf.LOCK () @@ -473,10 +471,10 @@ def PushAction (command=None, source=None): if package != None: package.InstallPending = True DbusIf.UNLOCK () - queue = InstallPackages.InstallQueue + theQueue = InstallPackages.InstallQueue queueText = "Install" elif action == 'add' or action == 'remove': - queue = AddRemove.AddRemoveQueue + theQueue = AddRemove.AddRemoveQueue queueText = "AddRemove" elif action == 'reboot': logging.warning ( "received Reboot request from " + source) @@ -503,13 +501,13 @@ def PushAction (command=None, source=None): logging.error ("PushAction received unrecognized command: " + command) return - if queue != None: + if theQueue != None: try: - queue.put ( (command, source), block=False ) + theQueue.put ( (command, source), block=False ) except queue.Full: - logging.error ("command " + command + " from " + source + " lost - " + ququeText + " - queue full") + logging.error ("command " + command + " from " + source + " lost - " + queueText + " - queue full") except: - logging.error ("command " + command + " from " + source + " lost - " + ququeText + " - other queue error") + logging.error ("command " + command + " from " + source + " lost - " + queueText + " - other queue error") # end PushAction @@ -651,7 +649,7 @@ class AddRemoveClass (threading.Thread): def __init__(self): threading.Thread.__init__(self) - self.AddRemoveQueue = queue.Queue (maxsize = 10) + self.AddRemoveQueue = queue.Queue (maxsize = 50) self.threadRunning = True @@ -924,8 +922,7 @@ def TransferOldDbusPackageInfo (cls): # updates the status when the operation completes # the GUI provides three different areas to show status # where specifies which of these are updated - # 'Download' - # 'Install' + # 'PmStatus' # 'Editor' # 'Media' # which determines where status is sent @@ -947,10 +944,8 @@ def UpdateStatus ( self, message=None, where=None, logLevel=0 ): if where == 'Editor': DbusIf.SetEditStatus ( message ) - elif where == 'Install': - DbusIf.SetInstallStatus ( message ) - elif where == 'Download': - DbusIf.SetGitHubUpdateStatus (message) + elif where == 'PmStatus': + DbusIf.SetPmStatus ( message ) elif where == 'Media': DbusIf.SetMediaStatus (message) @@ -986,10 +981,8 @@ def GetAutoInstall (self): return self.DbusSettings['autoInstall'] def SetAutoInstall (self, value): self.DbusSettings['autoInstall'] = value - def SetGitHubUpdateStatus (self, value): - self.DbusService['/GitHubUpdateStatus'] = value - def SetInstallStatus (self, value): - self.DbusService['/InstallStatus'] = value + def SetPmStatus (self, value): + self.DbusService['/PmStatus'] = value def SetMediaStatus (self, value): self.DbusService['/MediaUpdateStatus'] = value @@ -1174,8 +1167,7 @@ def __init__(self): processname = 'PackageManager', processversion = 1.0, connection = 'none', deviceinstance = 0, productid = 1, productname = 'Package Manager', firmwareversion = 1, hardwareversion = 0, connected = 1) - self.DbusService.add_path ( '/GitHubUpdateStatus', "", writeable = True ) - self.DbusService.add_path ( '/InstallStatus', "", writeable = True ) + self.DbusService.add_path ( '/PmStatus', "", writeable = True ) self.DbusService.add_path ( '/MediaUpdateStatus', "", writeable = True ) self.DbusService.add_path ( '/GuiEditStatus', "", writeable = True ) @@ -2325,7 +2317,7 @@ def GitHubDownload (self, packageName= None, source=None): if source == 'GUI': where = 'Editor' elif source == 'AUTO': - where = 'Download' + where = 'PmStatus' else: where = None @@ -2565,7 +2557,7 @@ class InstallPackagesClass (threading.Thread): def __init__(self): threading.Thread.__init__(self) - DbusIf.SetInstallStatus ("") + DbusIf.SetPmStatus ("") self.threadRunning = True self.InstallQueue = queue.Queue (maxsize = 10) @@ -2596,7 +2588,7 @@ def InstallPackage ( self, packageName=None, source=None , direction='install' ) package.UpdateDoNotInstall (True) logging.warning (packageName + " was manually installed - allowing auto install for that package") elif source == 'AUTO': - sendStatusTo = 'Install' + sendStatusTo = 'PmStatus' packageDir = "/data/" + packageName if not os.path.isdir (packageDir): @@ -3573,11 +3565,11 @@ def mainLoop(): DbusIf.SetActionNeeded ('') if statusMessage != "": - DbusIf.UpdateStatus ( statusMessage, where='Download' ) + DbusIf.UpdateStatus ( statusMessage, where='PmStatus' ) elif actionMessage != "": - DbusIf.UpdateStatus ( actionMessage, where='Download' ) + DbusIf.UpdateStatus ( actionMessage, where='PmStatus' ) else: - DbusIf.UpdateStatus ( idleMessage, where='Download' ) + DbusIf.UpdateStatus ( idleMessage, where='PmStatus' ) elapsedTime = time.time() - startTime # enable the following line to report execution time of main loop @@ -3803,7 +3795,7 @@ def main(): # auto uninstall triggered by AUTO_UNINSTALL_PACKAGES flag file on removable media if MediaScan.AutoUninstall: - DbusIf.UpdateStatus ( message="UNINSTALLING ALL PACKAGES & REBOOTING ...", where='Download') + DbusIf.UpdateStatus ( message="UNINSTALLING ALL PACKAGES & REBOOTING ...", where='PmStatus') DbusIf.UpdateStatus ( message="UNINSTALLING ALL PACKAGES & REBOOTING ...", where='Editor' ) logging.warning (">>>> UNINSTALLING ALL PACKAGES & REBOOTING...") @@ -3813,7 +3805,7 @@ def main(): SetupHelperUninstall = removeAllPackages () elif SystemReboot: - DbusIf.UpdateStatus ( message="REBOOTING ...", where='Download') + DbusIf.UpdateStatus ( message="REBOOTING ...", where='PmStatus') DbusIf.UpdateStatus ( message="REBOOTING ...", where='Editor' ) logging.warning (">>>> REBOOTING: to complete package installation") diff --git a/blindInstall/SetupHelperVersion b/blindInstall/SetupHelperVersion index 229bd6e..f16cf0f 100644 --- a/blindInstall/SetupHelperVersion +++ b/blindInstall/SetupHelperVersion @@ -1 +1 @@ -v4.42 +v4.43 diff --git a/changes b/changes index dc64568..a4f72cb 100644 --- a/changes +++ b/changes @@ -1,3 +1,7 @@ +v4.43: + fixed: PackageManager crashes when reinitializing database + fixed stuck Package Manager status messages + v4.42: fixed: updated services are not always restarted add ExtTransferSwitch to default package list diff --git a/venus-data.UninstallPackages.tgz b/venus-data.UninstallPackages.tgz index b2762d1..4a5d76b 100644 Binary files a/venus-data.UninstallPackages.tgz and b/venus-data.UninstallPackages.tgz differ diff --git a/venus-data.tgz b/venus-data.tgz index a9b0525..e146a1e 100644 Binary files a/venus-data.tgz and b/venus-data.tgz differ diff --git a/version b/version index 229bd6e..f16cf0f 100644 --- a/version +++ b/version @@ -1 +1 @@ -v4.42 +v4.43