diff --git a/FileSets/PatchSource/PageSettings.qml.patch b/FileSets/PatchSource/PageSettings.qml.patch index 222b616..d62a8c8 100644 --- a/FileSets/PatchSource/PageSettings.qml.patch +++ b/FileSets/PatchSource/PageSettings.qml.patch @@ -1,5 +1,5 @@ ---- /Users/Kevin/GitHub/StockVenusOsFiles/v3.20~37//opt/victronenergy/gui/qml/PageSettings.qml 2023-12-19 16:21:11 -+++ PageSettings.qml 2024-01-08 16:51:07 +--- /Users/Kevin/GitHub/SetupHelper.copy/FileSets/PatchSource/PageSettings.qml.orig 2024-04-13 11:31:17 ++++ /Users/Kevin/GitHub/SetupHelper.copy/FileSets/PatchSource/PageSettings.qml 2024-04-13 11:31:17 @@ -1,3 +1,6 @@ +//////// modified to insert PackageManager menu +//////// auto-generated by SetupHelper setup script diff --git a/FileSets/VersionIndependent/PageSettingsPackageEdit.qml b/FileSets/VersionIndependent/PageSettingsPackageEdit.qml index e04d266..b286a94 100644 --- a/FileSets/VersionIndependent/PageSettingsPackageEdit.qml +++ b/FileSets/VersionIndependent/PageSettingsPackageEdit.qml @@ -42,7 +42,8 @@ MbPage { property bool navigate: ! actionPending && ! waitForAction property bool detailsExist: incompatibleDetails != "" property bool detailsResolvable: incompatibleResolvableItem.valid ? incompatibleResolvableItem.value : "" - property bool showProceed: ( ! detailsExist || detailsResolvable || actionPending ) && ! waitForAction + property bool showProceed: ( showDetails || actionPending ) && ! waitForAction + /////////property bool showProceed: ( ! detailsExist || detailsResolvable || actionPending ) && ! waitForAction property bool showDetails: false property string localError: "" @@ -209,8 +210,17 @@ MbPage { { if (showDetails) { - sendCommand ( 'resolveConflicts:' + packageName, true ) - showDetails = false + if (detailsResolvable) + { + sendCommand ( 'resolveConflicts:' + packageName, true ) + showDetails = false + } + // trigger setup script prechecks + else + { + sendCommand ( 'check:' + packageName, true ) + showDetails = false + } } else if (actionPending) sendCommand ( requestedAction + ':' + packageName, true ) @@ -220,6 +230,7 @@ MbPage { sendCommand ( 'reboot', true ) else if (actionNeeded.indexOf ( "restart" ) != -1 ) sendCommand ( 'restartGui', true ) + hideActionNeededTimer.start () } requestedAction = '' } @@ -341,9 +352,9 @@ MbPage { width: 92 anchors { right: cancelButton.left; bottom: statusMessage.bottom } description: "" - value: ( actionPending || showDetails ) ? qsTr("Proceed") : qsTr ("Now") + value: ( actionPending || detailsResolvable ) ? qsTr("Proceed") : showDetails ? qsTr ("Recheck") : qsTr ("Now") onClicked: confirm () - show: ( actionPending || (showDetails && detailsResolvable) || showActionNeeded ) && showProceed + show: ( actionPending || showDetails ) && showProceed || showActionNeeded writeAccessLevel: User.AccessInstaller } MbOK diff --git a/HelperResources/CommonResources b/HelperResources/CommonResources index 7c2397a..231f0f1 100755 --- a/HelperResources/CommonResources +++ b/HelperResources/CommonResources @@ -327,10 +327,7 @@ standardActionPrompt () fi echo " Uninstall (u) and restores all files to stock" echo " Quit (q) without further action" - echo " Display setup log (s) outputs the last 100 lines of the log" - if [ ! -z "$packageLogFile" ]; then - echo " Display Log (l) outputs the last 100 lines of the log" - fi + echo " Display log (l) outputs the last 100 lines of the log" echo response='' while true; do @@ -359,9 +356,6 @@ standardActionPrompt () exit $EXIT_SUCCESS ;; [lL]*) - displayLog $packageLogFile - ;; - [sS]*) displayLog $setupLogFile ;; *) @@ -627,7 +621,7 @@ updateActiveFile () cp "$currentPatchFile" "$previousPatchFile" # no patch file used for this update # make sure restoreActiveFile doesn't try to reverse patch for uninstall - else + elif [ -e "$previousPatchFile" ]; then rm -f "$previousPatchFile" fi updateRestartFlags "$activeFile" @@ -689,12 +683,15 @@ restoreActiveFile () # attempt to reverse patch the active file # if success, don't restore original previousPatchFile="$previousPatchesDir/$baseName.patch" - if [ -e "$previousPatchFile" ] && - $patch --reverse "$activeFile" "$previousPatchFile" &> /dev/null ; then + if ! [ -e "$previousPatchFile" ]; then + logMessage "CRITICAL: $packageName $baseName - no prevoius patch file" + unpatchError=true + elif $patch --reverse "$activeFile" "$previousPatchFile" &> /dev/null ; then restoreOriginal=false - # no previous patch file or reverse patch failed + # reverse patch failed # original will be restored else + logMessage "CRITICAL: $packageName $baseName - reverse patch failed" unpatchError=true fi fi @@ -710,15 +707,28 @@ restoreActiveFile () fi fi + #### TODO: DRASTIC but can't think of a way around this + #### TODO: how/when to erase this message for this package ????? if $unpatchError ; then - #### TODO: DRASTIC but can't think of a way around this - message="CRITICAL: $package $baseName could not be uninstalled" - logMessage "message" - echo "message" >> "$scriptDir/patchErrors" - message=" moodificataions by $remainingPackages were lost and must be reinstalled" - logMessage "message" - echo "message" >> "$scriptDir/patchErrors" + message1="CRITICAL: $package $baseName could not be uninstalled cleanly" + message2=" $remainingPackages must be uninstalled and reinstalled" + logMessage "$message1" + logMessage "$message2" + # remove previous patch errors - and report this error + rm -f "$scriptDir/patchErrors" + echo "$message1" >> "$scriptDir/patchErrors" + echo "$message2" >> "$scriptDir/patchErrors" + + rm -f "$packageList" + # report errors to other packages as well + for otherPackage in $remainingPackages ; do + otherPkgPatchErrors="$packageRoot/$otherPackage/patchErrors" + rm -f "$otherPkgPatchErrors" + echo "$message1" >> "$otherPkgPatchErrors" + echo "$otherPackage must be uninstalled and reinstalled" >> "$otherPkgPatchErrors" + rm -f "$setupOptionsRoot/$otherPackage/previousPatches/$baseName.patch" + done setInstallFailed $EXIT_PATCH_ERROR "patch error details were saved in $packageName/patchErrors" fi @@ -1454,7 +1464,6 @@ if $reinstall ; then # not running from reinstallMods else runningAtBoot=false - pruneSetupLogFile fi if [ ! -d "$setupOptionsDir" ]; then @@ -1589,14 +1598,14 @@ fi # if [ $scriptAction != 'UNINSTALL' ] if ! [ -z "$fileListPatched" ];then patchErrors=() - for file in ${fileListPatched[@]}; do - baseName=$( basename $file ) + for activeFile in ${fileListPatched[@]}; do + baseName=$( basename $activeFile ) tempActiveFile="$tempFileDir/$baseName" - if [ -e "$file" ] ; then + if [ -e "$activeFile" ] ; then previousPatchFile="$previousPatchesDir/$baseName.patch" # chek for this package and others in .package list - packageList="$file.package" + packageList="$activeFile.package" thisPackageInList=false otherPackagesInList=false if [ -f "$packageList" ]; then @@ -1615,8 +1624,8 @@ if ! [ -z "$fileListPatched" ];then if $thisPackageInList; then # only this package modified active flie - ignore any previous patch and patch .orig file if ! $otherPackagesInList ; then - if [ -e "$file.orig" ]; then - cp "$file.orig" "$tempActiveFile" + if [ -e "$activeFile.orig" ]; then + cp "$activeFile.orig" "$tempActiveFile" patchOk=true else patchErrors+=( "no original file for $baseName" ) @@ -1625,26 +1634,24 @@ if ! [ -z "$fileListPatched" ];then # attempt to remove the previous patch for this package # then patch the result else - if $patch --reverse -o "$tempActiveFile" "$file" "$previousPatchFile" &> /dev/null ; then + if $patch --reverse -o "$tempActiveFile" "$activeFile" "$previousPatchFile" &> /dev/null ; then patchOk=true # reverse patch failed else - patchErrors+=( "unable to remove previous patch for $baseName" ) + patchErrors+=( "unable to remove previous patch from active file $baseName" ) fi - rm "$previousPatchFile" fi # this package has not previously modified the active file # other packages have modified the active file # if not, there is no .orig file # either way, patch the active file else - cp "$file" "$tempActiveFile" + cp "$activeFile" "$tempActiveFile" patchOk=true fi patchSuccess=false forwardPatched="$tempFileDir/$baseName".patchedForInstall currentPatchFile="$tempFileDir/$baseName.currentPatch" - reversePatchTest="$tempFileDir/$baseName.reversePatchTest" # a suitable source for the patch was located above if $patchOk; then # attempt to patch the active file with any file ending in .patch @@ -1679,7 +1686,7 @@ if ! [ -z "$fileListPatched" ];then patchErrors+=( "$baseName no active file for patch" ) continue fi - done # for file + done # for activeFile # save errors in patchErrors file if ! [ -z "$patchErrors" ] ; then diff --git a/HelperResources/IncludeHelpers b/HelperResources/IncludeHelpers index 9d1c44a..0a574fb 100755 --- a/HelperResources/IncludeHelpers +++ b/HelperResources/IncludeHelpers @@ -1,43 +1,24 @@ #!/bin/sh -# this script selects the correct location for helper Resources -# and sources them into the setup script +# this script sources helper Resources into the setup script # # for backward compatibility, CommonResources in the SetupHelper directory # links to this file, not CommonResources # CommonResources previously sourced the other files # now sourcing all resource files is done from here # -# the helper files location is either the package directory or in the SetupHelper directory -# if both are present, the one with the newer version number is incorporated -# into the setup script +# only the helper files located is the SetupHelper directory are used +# previous versions chose between this and a helper file set in the package directory +# but changes in SetupHelper to use a local copy of patch made this not possible # # this script should be sourced in the setup script before any other activities -# NOTE: this script uses VersionResources ONLY -# it does source any other helper files since final location has not yet been chosen - pkgDir="$( cd "$(dirname $0)" >/dev/null 2>&1 ; /bin/pwd -P )" pkgRoot="$( dirname "$pkgDir")" pkgName=$( basename $pkgDir ) -shHelperDir="$pkgRoot/SetupHelper/HelperResources" -# assume helper files are in package directory - change below if not -helperResourcesDir="$pkgDir/HelperResources" +helperResourcesDir="$pkgRoot/SetupHelper/HelperResources" -if [ -e "$helperResourcesDir/version" ]; then - # both helper file sets are present - compare them and choose the newest - if [ -e "$shHelperDir" ]; then - # temporarily source the local VersionResources - source "$pkgDir/HelperResources/VersionResources" - # setup helper files are newer - switch to those helper files - compareVersions $( cat "$shHelperDir/version" ) $( cat "$pkgDir/HelperResources/version" ) - if (( $? == 1 )); then - helperResourcesDir="$shHelperDir" - fi - fi -elif [ -e "$shHelperDir" ]; then - helperResourcesDir="$shHelperDir" -else +if ! [ -e "$helperResourcesDir" ]; then echo "$pkgName: helper files not found - can't continue" | tee -a "/data/log/SetupHelper" exit 1 fi diff --git a/HelperResources/LogHandler b/HelperResources/LogHandler index 6cfa585..ed75905 100755 --- a/HelperResources/LogHandler +++ b/HelperResources/LogHandler @@ -1,17 +1,25 @@ #!/bin/bash # LogHandler for SetupHelper -# contains a functions and variables necessare=y to write to and output logs +# contains a functions and variables necessarey to write to and output logs # # Refer to the SetupHelper ReadMe file for details on how to use these resources # -# it is sourced by CommonResources and reinstall Mods -# -# there may be two logs associated with a setup script: -# the script helper log and optionally the package log -# logs are written to both places and additionally the command line if not running from reinstallMods -setupLogFile="/var/log/SetupHelper" +logDir="/var/log/PackageManager" +logFile="$logDir/current" +if ! [ "$logDir" ]; then + mkdir -P "$logDir" + touch "$logFile" +fi + +oldLogFile="/var/log/SetupHelper" +if [ -e "$oldLogFile" ]; then + if (( $( tail -5 "$oldLogFile" | grep -c "WARNING: this log file no longer used" ) == 0 )); then + echo "WARNING: this log file no longer used" >> "$oldLogFile" + echo " SetupHelper now logged to /var/log/PackageManager/current" >> "$oldLogFile" + fi +fi # enable logging to console # scripts can disable logging by setting @@ -21,26 +29,14 @@ logToConsole=true # output the last 100 lines of the log file to the console # the full path to the log file should be passed in $1 # converts the tai64 time stamp to human readable form -# -# $1 specifies the path to the log file -# $setupLogFile -# $packageLogFile is defined to point to the log file of the package if it exists displayLog () { - if [ ! -z "$1" ]; then - if [ -f "$1" ]; then - tail -100 "$1" | tai64nlocal - else - echo "no log File $1 found" - fi - else - echo "no log File specified" - fi + tail -100 "$logFile" | tai64nlocal } -# write a message to one or more log files +# write a message to log file and console logMessage () { @@ -50,31 +46,5 @@ logMessage () fi # to setup helper log - if [ ! -z $setupLogFile ]; then - echo "$shortScriptName: $*" | tai64n >> $setupLogFile - fi - - # to setup helper log - if [ ! -z $packageLogFile ]; then - # no log file yet - make enclosing directory - # if directory already exists mkdir will do nothing (silently) - if [ ! -f "$packageLogFile" ]; then - mkdir -p $(dirname "$packageLogFile") - fi - echo "$shortScriptName: $*" | tai64n >> $packageLogFile - fi -} - - -# truncates the log file if it's larger than 2000 lines -# it is called from the initialization code in CommonResources -# if NOT running at boot time - -pruneSetupLogFile () -{ - if [ $(wc -l $setupLogFile | awk '{print $1}') -gt 2000 ]; then - tail -1000 $setupLogFile > $setupLogFile.tmp - mv $setupLogFile.tmp $setupLogFile - logMessage "log file truncated to last 1000 lines" - fi + echo "$shortScriptName: $*" | tai64n >> $logFile } diff --git a/HelperResources/version b/HelperResources/version deleted file mode 100644 index 8c6f790..0000000 --- a/HelperResources/version +++ /dev/null @@ -1 +0,0 @@ -v8.0~25 diff --git a/HelperResources/version b/HelperResources/version new file mode 120000 index 0000000..1748d5b --- /dev/null +++ b/HelperResources/version @@ -0,0 +1 @@ +../version \ No newline at end of file diff --git a/PackageManager.py b/PackageManager.py index 0795f0d..60a9aae 100755 --- a/PackageManager.py +++ b/PackageManager.py @@ -2083,6 +2083,7 @@ def UpdateVersionsAndFlags (self, doConflictChecks=False, doScriptPreChecks=Fals with open ( packageDir + "/patchErrors" ) as file: for line in file: patchCheckErrors.append ( line ) + compatible = False patchCheckErrors = list ( set ( patchCheckErrors ) ) if patchCheckErrors != self.PatchCheckErrors: self.PatchCheckErrors = patchCheckErrors @@ -2092,7 +2093,6 @@ def UpdateVersionsAndFlags (self, doConflictChecks=False, doScriptPreChecks=Fals details += patchFailure + "\n" logging.warning (packageName + " patch check error: " + patchFailure + " ") self.SetIncompatible ("patch error", details,) - compatible = False else: logging.warning (packageName + " patch check reported no errors") diff --git a/blindInstall/SetupHelperVersion b/blindInstall/SetupHelperVersion index 3365887..c3be24b 100644 --- a/blindInstall/SetupHelperVersion +++ b/blindInstall/SetupHelperVersion @@ -1 +1 @@ -v8.0~29 +v8.0~31 diff --git a/blindInstall/blindInstall.sh b/blindInstall/blindInstall.sh index b280b7c..0f63a97 100755 --- a/blindInstall/blindInstall.sh +++ b/blindInstall/blindInstall.sh @@ -46,8 +46,9 @@ # to become available before running the package install script. # -source "/data/SetupHelper-blind/EssentialResources" -source "/data/SetupHelper-blind/LogHandler" +source "/data/SetupHelper-blind/HelperResources/EssentialResources" +source "/data/SetupHelper-blind/HelperResources/LogHandler" +logToConsole=false logMessage "starting" diff --git a/blindInstall/post-hook.sh b/blindInstall/post-hook.sh index 5caff8b..1ead35e 100755 --- a/blindInstall/post-hook.sh +++ b/blindInstall/post-hook.sh @@ -46,11 +46,15 @@ # to become available before running the package install script. # +logDir="/var/log/PackageManager" +logFile="$logDir/current" +if ! [ "$logDir" ]; then + mkdir -P "$logDir" +fi logMessage () { echo "$*" - - echo "blind install post-hook.sh: $*" | tai64n >> /data/log/SetupHelper + echo "blind install post-hook.sh: $*" | tai64n >> "$logFile" } diff --git a/blindInstall/pre-hook.sh b/blindInstall/pre-hook.sh index ffe0817..0cd0d52 100755 --- a/blindInstall/pre-hook.sh +++ b/blindInstall/pre-hook.sh @@ -46,11 +46,15 @@ # to become available before running the package install script. # +logDir="/var/log/PackageManager" +logFile="$logDir/current" +if ! [ "$logDir" ]; then + mkdir -P "$logDir" +fi logMessage () { echo "$*" - - echo "blind install pre-hook.sh: $*" | tai64n >> /data/log/SetupHelper + echo "blind install pre-hook.sh: $*" | tai64n >> "$logFile" } diff --git a/blindInstall/rcS.local b/blindInstall/rcS.local index 2fd8201..c7bf69f 100755 --- a/blindInstall/rcS.local +++ b/blindInstall/rcS.local @@ -46,9 +46,14 @@ # to become available before running the package install script. # +logDir="/var/log/PackageManager" +logFile="$logDir/current" +if ! [ "$logDir" ]; then + mkdir -P "$logDir" +fi logMessage () { - echo "blind install rcS.local: $*" | tai64n >> /data/log/SetupHelper + echo "blind install rcS.local: $*" | tai64n >> "$logFile" } logMessage "start" diff --git a/blindInstall/rcS.localForUninstall b/blindInstall/rcS.localForUninstall index 8369e24..2125647 100755 --- a/blindInstall/rcS.localForUninstall +++ b/blindInstall/rcS.localForUninstall @@ -6,10 +6,15 @@ # Venus OS will also be reinstalled if a suitable .swu file is found on removable media # log activity +logDir="/var/log/PackageManager" +logFile="$logDir/current" +if ! [ "$logDir" ]; then + mkdir -P "$logDir" +fi logMessage () { echo "blindUninstall: $*" - echo "blindUninstall: $*" | tai64n >> "/data/log/SetupHelper" + echo "blindUninstall: $*" | tai64n >> "$logDir" } logMessage "--- starting blind uninstall - all packages will be uninstalled" diff --git a/changes b/changes index cc525bb..b9535fd 100644 --- a/changes +++ b/changes @@ -19,6 +19,13 @@ v8.0: (beta) fixed: PackageManager hangs on Python 2 (Venus OS prior to v2.80) fixed: some patching errors fixed: PackageManager does not exit for reboot + updatePackage: prompt for helper resources update + don't use HelperResources from package directory (only from SetupHelper) + this was necessary because /data/SetupHelper/patch + is now used in place of the stock patch executable + moved SetupHelper logging to /var/log/PackageManager/current + fixed: uninstall of patched files failed + added manual recheck for errors discovered in setup script prechecks v7.18: fixed: only first service is uninstalled diff --git a/genericSetupScript b/genericSetupScript index 6c74463..03b802f 100755 --- a/genericSetupScript +++ b/genericSetupScript @@ -16,18 +16,8 @@ standardPromptAndActions='yes' -#### following lines incorporate helper resources into this script -pkgDir=$( dirname $0 ) -pkgName=$( basename $pkgDir ) -pkgRoot=$( dirname $pkgDir ) -if [ -e "$pkgDir/HelperResources/IncludeHelpers" ]; then - source "$pkgDir/HelperResources/IncludeHelpers" -elif [ -e "$pkgRoot/SetupHelper/HelperResources/IncludeHelpers" ]; then - source "$pkgRoot/SetupHelper/HelperResources/IncludeHelpers" -else - echo "$pkgName: helper files not found - can't continue" | tee -a "/data/log/SetupHelper" - exit 1 -fi +#### following line incorporates helper resources into this script +source "/data/SetupHelper/HelperResources/IncludeHelpers" #### end of lines to include helper resources # never returns from CommonResources ! diff --git a/packageManagerEnd.sh b/packageManagerEnd.sh index 32860bd..a84e859 100755 --- a/packageManagerEnd.sh +++ b/packageManagerEnd.sh @@ -24,7 +24,6 @@ # # reboot overrides a guiRestart since the reboot will restart the GUI -# PackageManager log file since this is an extension PM logFile=/data/log/PackageManager/current logMessage () { diff --git a/reinstallMods b/reinstallMods index 6f244b3..9dcdc22 100755 --- a/reinstallMods +++ b/reinstallMods @@ -7,9 +7,9 @@ scriptDir="$( cd "$(dirname $0)" >/dev/null 2>&1 ; /bin/pwd -P )" packageBase="$( dirname $scriptDir )" -helperFilesDir="$scriptDir/HelperResources" -source "$helperFilesDir/EssentialResources" -source "$helperFilesDir/LogHandler" +helperResourcesDir="$scriptDir/HelperResources" +source "$helperResourcesDir/EssentialResources" +source "$helperResourcesDir/LogHandler" # disable outputting log messages to console runningAtBoot=true @@ -19,7 +19,6 @@ logMessage "reinstallMods starting" # prevent PackageManager from conflicting with this script rm -f "/etc/venus/REINSTALL_PACKAGES" -# call setup script only if SetupHelper not currently installed and was not manually uninstalled rebootNeeded=false if [ -f "$setupOptionsDir/DO_NOT_AUTO_INSTALL" ]; then logMessage "CRITICAL: SetupHelper was manually uninstalled therefore it was not reinstalled" diff --git a/setup b/setup index 66dd4bb..500b93f 100755 --- a/setup +++ b/setup @@ -20,16 +20,6 @@ standardPromptAndActions='yes' -#### following lines incorporate helper resources into this script -pkgDir=$( dirname $0 ) -pkgName=$( basename $pkgDir ) -pkgRoot=$( dirname $pkgDir ) -if [ -e "$pkgDir/HelperResources/IncludeHelpers" ]; then - source "$pkgDir/HelperResources/IncludeHelpers" -elif [ -e "$pkgRoot/SetupHelper/HelperResources/IncludeHelpers" ]; then - source "$pkgRoot/SetupHelper/HelperResources/IncludeHelpers" -else - echo "$pkgName: helper resources not found - can't continue" | tee -a "/data/log/SetupHelper" - exit 1 -fi +#### following line incorporates helper resources into this script +source "/data/SetupHelper/HelperResources/IncludeHelpers" #### end of lines to include helper resources diff --git a/updatePackage b/updatePackage index 2db1d17..f5ae737 100755 --- a/updatePackage +++ b/updatePackage @@ -20,8 +20,6 @@ # # patched replacement files are created in CommonResources prior to returning control to the setup script # -# helper resources are copied from the HelperResources directory at the root of all packages to HelperResources in the package directory -# # This is a unix bash script and should be run on a host computer, not a GX device # Windows will not run this script natively. # However Windows 10 apparently supports bash: @@ -433,11 +431,7 @@ if [ "$globalEndAction" == "restore" ]; then fi logMessage "WARNING $package: restored from backup" deleteNestedDirectories "$sourceFiles" - deleteNestedDirectories "$sourceDirectory/HelperResources" mv "$backupFiles" "$sourceFiles" - if [ -e "$backupDirectory/HelperResources" ]; then - mv -f "$backupDirectory/HelperResources" "$sourceDirectory" - fi deleteNestedDirectories $backupDirectory done exit @@ -454,57 +448,6 @@ else fi -if [ -f "$packageRoot/SetupHelper/HelperResources/version" ]; then - shHelperVersion=$( cat "$packageRoot/SetupHelper/HelperResources/version" ) -else - shHelperVersion="" -fi -if [ "$shVersion" != "$shHelperVersion" ]; then - logMessage "WARNING: SetupHelper and it's HelperResources versions differ" - logMessage " updating HelperResources version from $shHelperVersion to $shVersion" - cp "$packageRoot/SetupHelper/version" "$packageRoot/SetupHelper/HelperResources/version" -fi -if [ -f "$packageRoot/HelperResources/version" ]; then - helperVersion=$( cat "$packageRoot/HelperResources/version" ) - versionStringToNumber $helperVersion - helperVersionNumber=$versionNumber -else - helperVersion="" - helperVersionNumber=0 -fi - -# update HelperResources main copy if SetuHelper is a released version -# and SetupHelper is newer or if file modificaitons are newer than main copy -if [[ $shVersion != *~* ]]; then - setupHelperIsReleased=false - updateHelperResources=false - if (( shVersionNumber > helperVersionNumber )); then - updateHelperResources=true - # if versions are the same, compare file mod dates - elif (( shVersionNumber == helperVersionNumber )); then - for file in $( ls "$packageRoot/HelperResources" ); do - baseName=$( basename $file ) - if [[ "$packageRoot/SetupHelper/HelperResources"/$baseName" -nt "$packageRoot/HelperResources"/$baseName" ]]; then - updateHelperResources=true - break - fi - done - fi - if $updateHelperResources ; then - logMessage "updating main copy of HelperResources from SetupHelper" -exit - rm -rf "$packageRoot/HelperResources" - cp -r "$packageRoot/SetupHelper/HelperResources" "$packageRoot" - cp "$packageRoot/SetupHelper/version" "$packageRoot/HelperResources" - helperVersion=$shVersion - helperVersionNumber=$shVersionNumber - fi -else - logMessage "WARNING: SetupHelper is not a released version - HelperResources NOT UPDATED" - setupHelperIsReleased=true -fi - - # make the version list from the directories in stock files # version lists are sorted so the most recent version is first tempList=() @@ -544,7 +487,7 @@ for package in $packageList; do versionIndependentFileSet="$workingFiles/VersionIndependent" if [ ! -d "$sourceDirectory" ] || [ ! -f "$sourceDirectory/version" ]; then - logMessage "$sourceDirectory - not a package directory" + logMessage "WARNING: $sourceDirectory - not a package directory - skipping" continue # next package fi if [ ! -d "$sourceFiles" ]; then @@ -614,9 +557,6 @@ for package in $packageList; do if [ -d "$sourceFiles" ]; then cp -pR "$sourceFiles" "$workingFiles" fi - if [ -e "$sourceDirectory/HelperResources" ]; then - cp -pR "$sourceDirectory/HelperResources" "$workingDirectory" - fi fi # clean up flag files from a previous run @@ -865,40 +805,6 @@ for package in $packageList; do done # for file in fileListPatched fi # check patch files - # update the package's copy of helper resources - if [ -f "$workingDirectory/HelperResources/version" ]; then - pkgHelperVersion=$( cat "$workingDirectory/HelperResources/version" ) - versionStringToNumber $pkgHelperVersion - pkgHelperVersionNumber=$versionNumber - else - pkgHelperVersion="" - pkgHelperVersionNumber=0 - fi - updateHelperResources=false - if (( helperVersionNumber > pkgHelperVersionNumber )); then - updateHelperResources=true - # if versions are the same, compare file mod dates - elif (( helperVersionNumber == pkgHelperVersionNumber )); then - for file in $( ls "$packageRoot/HelperResources" ); do - baseName=$( basename $file ) - if [[ "$packageRoot/HelperResources/$baseName" -nt "$workingDirectory/HelperResources/$baseName" ]]; then - updateHelperResources=true - break - fi - done - fi - if $updateHelperResources ; then - logMessage "$package: updating HelperResources to $helperVersion" - cp -r "$packageRoot/HelperResources" "$workingDirectory" - fi - - if ((packageErrors > 0 )); then - logMessage "$packageErrors errors so far" - if ! yesNoPrompt "continue with file set checks anyway (y/n)? " ; then - continue # next package - fi - fi - beginProgress "$package: updating file sets" # process only versioned files @@ -1223,7 +1129,6 @@ for package in $packageList; do # flag file set incomplete if [ -f "$replacement.CHECK_REPLACEMENT" ] || [ -f "$replacement.NO_ORIG" ] \ || [ -f "$replacement.BAD_LINK" ] ; then -echo "#### final checks INCOMPLETE" touch "$fileSet/INCOMPLETE" fi done # for file @@ -1321,10 +1226,6 @@ echo "#### final checks INCOMPLETE" if [ -d "$sourceFiles" ]; then mv "$sourceFiles" "$backupFiles" fi - if [ -e "$sourceDirectory/HelperResources" ]; then - rm -rf "$backupDirectory/HelperResources" - mv "$sourceDirectory/HelperResources" "$backupDirectory" - fi else logMessage "$package: $backupName unchanged" fi @@ -1334,11 +1235,11 @@ echo "#### final checks INCOMPLETE" deleteNestedDirectories "$sourceFiles" mv "$workingFiles" "$sourceFiles" fi - if [ -e "$workingDirectory/HelperResources" ]; then - rm -rf "$sourceDirectory/HelperResources" - mv "$workingDirectory/HelperResources" "$sourceDirectory" - deleteNestedDirectories $workingDirectory + if [ -e "$sourceDirectory/HelperResources" ]; then + logMessage "$package: removing HelperResources" + deleteNestedDirectories "$sourceDirectory/HelperResources" fi + deleteNestedDirectories "$workingDirectory" ;; *) logMessage "ERROR: invalid end action $endAction" diff --git a/venus-data-UninstallPackages.tgz b/venus-data-UninstallPackages.tgz index 12bce71..f1b912d 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 24c044b..295a7d8 100644 Binary files a/venus-data.tgz and b/venus-data.tgz differ diff --git a/version b/version index 3365887..c3be24b 100644 --- a/version +++ b/version @@ -1 +1 @@ -v8.0~29 +v8.0~31