Skip to content

Commit

Permalink
fixed: package conflict message disappears
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindrem committed Apr 12, 2024
1 parent c886b20 commit cdd49b0
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 47 deletions.
2 changes: 1 addition & 1 deletion FileSets/VersionIndependent/PageSettingsPackageEdit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ MbPage {
property bool navigate: ! actionPending && ! waitForAction
property bool detailsExist: incompatibleDetails != ""
property bool detailsResolvable: incompatibleResolvableItem.valid ? incompatibleResolvableItem.value : ""
property bool showProceed: ( ! detailsExist || detailsResolvable) && ! waitForAction
property bool showProceed: ( ! detailsExist || detailsResolvable || actionPending ) && ! waitForAction
property bool showDetails: false
property string localError: ""

Expand Down
88 changes: 44 additions & 44 deletions PackageManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,6 @@ def __init__( self, section, packageName = None ):

self.lastConflictCheck = 0
self.lastPatchCheck = 0
self.lastSetupCheckTime = 0

self.lastGitHubRefresh = 0

Expand Down Expand Up @@ -1797,7 +1796,6 @@ def RemovePackage (cls, packageName=None, packageIndex=None, isDuplicate=False )
toPackage.Conflicts = fromPackage.Conflicts
toPackage.lastConflictCheck = fromPackage.lastConflictCheck
toPackage.lastPatchCheck = fromPackage.lastPatchCheck
toPackage.lastSetupCheckTime = fromPackage.lastSetupCheckTime
toPackage.lastGitHubRefresh = fromPackage.lastGitHubRefresh
toPackage.ActionNeeded = fromPackage.ActionNeeded

Expand Down Expand Up @@ -1905,6 +1903,7 @@ def UpdateVersionsAndFlags (self, doConflictChecks=False):
if Platform[0:4] != 'Rasp':
self.SetIncompatible ("incompatible with " + Platform)
compatible = False
doConflictChecks = False

# update local auto install flag based on DO_NOT_AUTO_INSTALL
flagFile = "/data/setupOptions/" + packageName + "/DO_NOT_AUTO_INSTALL"
Expand Down Expand Up @@ -1933,6 +1932,7 @@ def UpdateVersionsAndFlags (self, doConflictChecks=False):
if VenusVersionNumber < firstVersionNumber or VenusVersionNumber >= obsoleteVersionNumber:
self.SetIncompatible ("incompatible with " + VenusVersion)
compatible = False
doConflictChecks = False

# check to see if command line is needed for install
# the optionsRequired flag in the package directory indicates options must be set before a blind install
Expand All @@ -1943,6 +1943,7 @@ def UpdateVersionsAndFlags (self, doConflictChecks=False):
if not os.path.exists ( "/data/setupOptions/" + packageName + "/optionsSet"):
self.SetIncompatible ("install from command line" )
compatible = False
doConflictChecks = False

# check to see if file set has errors
if compatible:
Expand All @@ -1951,21 +1952,24 @@ def UpdateVersionsAndFlags (self, doConflictChecks=False):
if os.path.exists (fileSet + "/INCOMPLETE"):
self.SetIncompatible ("incomplete file set for " + str (VenusVersion) )
compatible = False
doConflictChecks = False

if compatible and os.path.exists (packageDir + "/patchErrors"):
if os.path.getmtime ( packageDir + "/patchErrors" ) > self.lastPatchCheck:
patchFailures = ""
with open ( packageDir + "/patchErrors" ) as file:
for line in file:
logging.warning (packageName + " patch error " + line.strip() + " ")
patchFailures += line
self.SetIncompatible ("patch errors", patchFailures )
compatible = False
# used to prevent repeaded checks
self.lastPatchCheck = time.time ()
patchFailures = ""
logErrors = os.path.getmtime ( packageDir + "/patchErrors" ) > self.lastPatchCheck
with open ( packageDir + "/patchErrors" ) as file:
for line in file:
patchFailures += line
if logErrors:
logging.warning (packageName + " patch error: " + line.strip() + " ")
self.SetIncompatible ("patch errors", patchFailures )
compatible = False

# used to prevent repeaded log entries
self.lastPatchCheck = time.time ()

# check for package conflicts
if compatible and doConflictChecks:
if doConflictChecks:
conflicts = []
# skip checks while operations are pending
if not self.InstallPending and not self.DownloadPending:
Expand Down Expand Up @@ -2030,7 +2034,7 @@ def UpdateVersionsAndFlags (self, doConflictChecks=False):
continue
# here if previously updated file was from a different package
baseName = os.path.basename (replacementFile)
# log conflict only if this is the first time it was logged
# log conflict only if this is the first time it was discovered
if os.path.getmtime ( packageFile ) > self.lastConflictCheck:
logging.warning ("package file conflict " + baseName + " " + packageName + " " + previousPackage)

Expand Down Expand Up @@ -2063,37 +2067,36 @@ def UpdateVersionsAndFlags (self, doConflictChecks=False):
else:
self.Conflicts = []

# run setup script to check for errors that can't be checked here
# the packageCheckVersion file is updated by CommonResources during its prechecks
if compatible and doConflictChecks:
doChecks = False
packageCheckFile = "/data/" + packageName + "/packageCheckVersion"
# no checks have been done recently so do them now
if time.time() > self.lastSetupCheckTime + 30:
# no check file exists, do checks
if not os.path.exists ( packageCheckFile ):
doChecks = True
# check file exists - check which firmware version was checked
# and if not the current version, do checks
else:
try:
with open ( packageCheckFile ) as file:
for line in file:
if not VenusVersion in line:
doChecks = True
# couldn't read the file, attempt check again
except:
doChecks = True
if doChecks:
# avoid starting a new check if there is something pending
if not self.InstallPending and not self.DownloadPending \
and os.path.exists ("/data/" + packageName + "/setup"):
PushAction ( command='check' + ':' + packageName, source='AUTO' )

# if no incompatibilities found, clear incompatible dbus parameters
# so the GUI will allow installs
if compatible:
self.SetIncompatible ("")

# run setup script to check for errors that can't be checked here
# the packageCheckVersion file is updated by CommonResources during its prechecks
# only do checks every 30 seconds
doCheck = False
if doConflictChecks:
packageCheckFile = "/data/" + packageName + "/packageCheckVersion"

# no check file exists, do checks
if not os.path.exists ( packageCheckFile ):
doCheck = True
# check file exists - check which firmware version was checked
# and if not the current version, do checks
else:
try:
with open ( packageCheckFile ) as file:
for line in file:
if not VenusVersion in line:
doCheck = True
# couldn't read the file, attempt check again
except:
doCheck = True
# don't start a new check if there is something pending
if doCheck and not self.InstallPending and not self.DownloadPending \
and os.path.exists ("/data/" + packageName + "/setup"):
PushAction ( command='check' + ':' + packageName, source='AUTO' )
# end UpdateVersionsAndFlags
# end Package

Expand Down Expand Up @@ -2841,9 +2844,6 @@ def InstallPackage ( self, packageName=None, source=None , action='install' ):
if source == 'GUI':
DbusIf.AcknowledgeGuiEditAction ( 'ERROR' )

# conflict report will be generated but setting lastSetupCheckTime
# will prevent setup script checks again since they were just run !
package.lastSetupCheckTime = time.time ()
package.UpdateVersionsAndFlags (doConflictChecks=True)

DbusIf.UNLOCK ("InstallPackage - update status")
Expand Down
2 changes: 1 addition & 1 deletion blindInstall/SetupHelperVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.0~15
v8.0~16
1 change: 1 addition & 0 deletions changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ v8.0: (beta)
multiple patch files for each active file are permitted
add TailscaleGX to default package list
fixed: PackageManager hangs if there is no setup script in package directory
fixed: package conflict message disappears

v7.16:
fixed: PackageManager hangs with package add
Expand Down
Binary file modified venus-data-UninstallPackages.tgz
Binary file not shown.
Binary file modified venus-data.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.0~15
v8.0~16

0 comments on commit cdd49b0

Please sign in to comment.