Skip to content

Commit

Permalink
another bug that prevented downloads
Browse files Browse the repository at this point in the history
A SetupHelper download would be skipped the first pass after enabling auto-downloads. This meant it would take 10  + minutes to download it.
  • Loading branch information
kwindrem committed Dec 16, 2021
1 parent c47974d commit 41ff7bf
Show file tree
Hide file tree
Showing 48 changed files with 4,550 additions and 1,703 deletions.
Binary file modified .DS_Store
Binary file not shown.
318 changes: 210 additions & 108 deletions CommonResources

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions EssentialResources
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ fullScriptName="$scriptDir/$(basename "$0")"

venusVersion="$(cat /opt/victronenergy/version | head -n 1)"

installedVersionPrefix="/etc/venus/installedVersion-"
installedVersionFile="$installedVersionPrefix"$packageName

# obsolete - use installedVersion
installedFlagPrefix="/etc/venus/inInstalled-"
installedFlag="$installedFlagPrefix"$packageName

Expand All @@ -25,8 +29,18 @@ fileSet="$pkgFileSets/$venusVersion"
rcLocal="/data/rcS.local"

# defined exit codes - must be consistent between all setup scripts and reinstallMods
exitReboot=123
exitSuccess=0
# and PackageManager.py
EXIT_SUCCESS=0
EXIT_REBOOT=123
EXIT_ERROR=255 # unknown error
EXIT_INCOMPATIBLE_VERSION=254
EXIT_INCOMPATIBLE_PLATFOM=253
EXIT_FILE_SET_ERROR=252
EXIT_OPTIONS_NOT_SET=251
EXIT_RUN_AGAIN=250
# old variables - keep for compatibility
exitReboot=$EXIT_REBOOT
exitSuccess=$EXIT_SUCCESS

reinstallParam="reinstall"

Expand Down
164 changes: 138 additions & 26 deletions FileSets/MbDisplayPackageVersion.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,152 @@ MbItem {
id: root

property int versionIndex
property string bindPrefix
property string servicePrefix
property string settingsPrefix

function getBind(param)
VBusItem { id: packageName; bind: getSettingsBind ("PackageName") }
property VBusItem rebootNeededItem: VBusItem { bind: getServiceBind ( "RebootNeeded") }
property bool rebootNeeded: rebootNeededItem.valid && rebootNeededItem.value == 1

VBusItem { id: platformItem; bind: Utils.path("com.victronenergy.packageMonitor", "/Platform" ) }
VBusItem { id: incompatibleItem; bind: getServiceBind ( "Incompatible" ) }
property string incompatibleReason: incompatibleItem.valid ? incompatibleItem.value : ""
property bool compatible: incompatibleReason == ""
property string platform: platformItem.valid ? platformItem.value : "??"


function statusText ()
{
return Utils.path(bindPrefix, "/", versionIndex, "/", param)
if (rebootNeeded)
return (" REBOOT needed")
else if (incompatibleReason == 'PLATFORM')
return ( "not compatible with " + platform )
else if (incompatibleReason == 'VERSION')
return ( "not compatible with " + vePlatform.version )
else if (incompatibleReason == 'CMDLINE' && installedVersion.item.value == "")
return ( "must install from command line" )
else
return ""
}

VBusItem { id: packageName; bind: getBind ("PackageName") }
function getSettingsBind(param)
{
return Utils.path(settingsPrefix, "/", versionIndex, "/", param)
}
function getServiceBind(param)
{
return Utils.path(servicePrefix, "/Package/", versionIndex, "/", param)
}

function versionToNumber (item)
{
var parts=["x", "x", "x", "x", "x"]
var versionNumber = 0

if (item.valid && item.value.substring (0,1) == "v")
{
parts = item.value.split (/[v.~]+/ , 4)
{
if (parts.length >= 2)
versionNumber += parseInt(parts[1]) * 1000000
if (parts.length >= 3)
versionNumber += parseInt(parts[2]) * 1000
if (parts.length >= 4)
versionNumber += parseInt(parts[3])
else
versionNumber += 999
}
}
return versionNumber
}

MbRowSmall
{
description: ""

anchors.verticalCenter: parent.verticalCenter
height: 20

isCurrentItem: root.isCurrentItem
description: packageName.valid ? packageName.value : ""
MbTextBlock
{
id: gitUser
item { bind: getBind("GitHubUser") }
width: 100
show: packageName.valid && item.valid
}
MbTextBlock
{
item { bind: getBind("GitHubBranch") }
show: packageName.valid && gitUser.item.valid
width: 80
}
MbTextBlock
{
item { bind: getBind("PackageVersion") }
width: 80
show: packageName.valid
Column
{
width: root.width - gitHubVersion.width - packageVersion.width - installedVersion.width - 20
Text // puts a bit of space above package name
{
text: " "
font.pixelSize: 6
}
Text
{
text:packageName.valid ? packageName.value : ""
font.pixelSize: 14
horizontalAlignment: Text.AlignLeft
}
Text
{
text: statusText ()
font.pixelSize: 10
horizontalAlignment: Text.AlignLeft
}
}
Column
{
Text // puts a bit of space above version boxes
{
text: " "
font.pixelSize: 3
}
Text
{
text: "GitHub"
font.pixelSize: 10
}
MbTextBlock
{
id: gitHubVersion
item { bind: getServiceBind("GitHubVersion") }
height: 20; width: 80
}
Text // puts a bit of space below version boxes - only needed in one column
{
text: " "
font.pixelSize: 6
}
}
Column
{
Text // puts a bit of space above version boxes
{
text: " "
font.pixelSize: 3
}
Text
{
text: "Stored"
font.pixelSize: 10
}
MbTextBlock
{
id: packageVersion
item { bind: getServiceBind("PackageVersion") }
height: 20; width: 80
}
}
Column
{
Text // puts a bit of space above version boxes
{
text: " "
font.pixelSize: 3
}
Text
{
text: "Installed"
font.pixelSize: 10
}
MbTextBlock
{
id: installedVersion
item { bind: getServiceBind("InstalledVersion") }
height: 20; width: 80
}
}
}
}
43 changes: 0 additions & 43 deletions FileSets/PageSettingsPackageControl.qml

This file was deleted.

Loading

0 comments on commit 41ff7bf

Please sign in to comment.