Skip to content

Commit

Permalink
skip file set checks for COMPLETE file sets
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindrem committed Aug 30, 2023
1 parent bb4f5b6 commit 4c48a11
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 85 deletions.
43 changes: 27 additions & 16 deletions CommonResources
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,19 @@ restoreActiveFile ()
}


# checkFileSets validates the file sets used install package modifications
# checkFileSets validates the file sets used to install package modifications
#
# It attempts to create a file set for a new Venus version
# If a file set for the current Venus OS version exists, the replacement files in that file set
# are usable as is and no further checks are needed.
# The COMPLETE flag file indicates that the file set was validated on the computer creating
# the file sets and all replacement files (or symlinks to other file sets) exist.
# No checks are needed for a COMPLETE file set.
# If not, an attempt is made to create a file set for the current Venus OS version
# If the new active files for the new version all match another version
# the new file set is populated automatically and may be used with no further action
# If not, new version is marked for manual editing (NO_REPLACEMENT)
# and scriptAction is set to EXIT so incompatible files are not installed
# the new file set is populated automatically with replacement files from the other version
# and may be used with no further action
# If not, new file set is marked INCOMPLETE and scriptAction is set to EXIT
# The package can not be installed on this Venus OS version
#
# Replacement files that have no original specify an "alternate original" that is used
# for version comparisons that locate an appropriate replacement
Expand All @@ -299,14 +305,19 @@ _checkFileSets ()
return
fi

# no checks needed if all replacement files exist in the current file set
if [ -f "$fileSet/COMPLETE" ]; then
return
fi

# if incomplete file set exists - remove it and try again
if [ -f "$fileSet/INCOMPLETE" ]; then
rm -rf $fileSet
fi

# attempt to create file set if it doesn't exist
if [ ! -d "$fileSet" ]; then
logMessage "creating file set for $venusVersion"
logMessage "attempting to create a file set for $venusVersion"
mkdir "$fileSet"
fi

Expand Down Expand Up @@ -335,7 +346,15 @@ _checkFileSets ()

for file in $fileList ; do
baseName=$(basename "$file")
activeFile=$file

# skip checks if replacement file already exists
# or if there is no replacement file needed
if [ -f "$fileSet/$baseName" ] || [ -f "$fileSet/$baseName.USE_ORIGINAL" ]; then
rm -f "$fileSet/$baseName.NO_REPLACEMENT"
continue
fi

activeFile=$file

if [ -f "$pkgFileSets/$baseName.ALT_ORIG" ]; then
activeFile=$(cat "$pkgFileSets/$baseName.ALT_ORIG")
Expand All @@ -345,21 +364,14 @@ _checkFileSets ()
activeFile="$activeFile.orig"
fi

# can't process if no Venus file
# can't process if no original (aka active) file exists in the file set
if [ ! -f "$activeFile" ]; then
logMessage "ERROR $venusVersion $baseName no active file"
touch "$fileSet/$baseName.NO_ACTIVE_FILE"
touch "$fileSet/INCOMPLETE"
continue
fi

# skip checks if replacement file already exists in file set
# or if there is no replacement file for this version
if [ -f "$fileSet/$baseName" ] || [ -f "$fileSet/$baseName.USE_ORIGINAL" ]; then
rm -f "$fileSet/$baseName.NO_REPLACEMENT"
continue
fi

# if an active file exists look for a match in another file set
if [ ! -z "$activeFile" ]; then
matchFound=false
Expand Down Expand Up @@ -388,7 +400,6 @@ _checkFileSets ()

if $matchFound ;then
rm -f "$fileSet/$baseName.orig"
ln -s "../$otherVersion/$baseName.orig" "$fileSet/$baseName.orig"
rm -f "$fileSet/$baseName.NO_ORIG"
# if other file set contains a replacement file, link to it
if [ -f "$otherFile" ]; then
Expand Down
Binary file not shown.
Binary file modified Package development guidelines.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion blindInstall/SetupHelperVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.43
v5.0
9 changes: 9 additions & 0 deletions changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v5.0:
_checkFileSets in CommonResources:
if file set exists and contains the COMPLETE flag file, skip all checks
otherwise, proceed with file set validation
or attempt to create one for the current Venus OS version
updateFileSets now fills in all file sets with symlinks
so that the install does not have to search for a matching original
the search for a match has reportedly failed in a few cases for unknown reasons

v4.43:
fixed: PackageManager crashes when reinitializing database
fixed stuck Package Manager status messages
Expand Down
2 changes: 1 addition & 1 deletion setup
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if [ $scriptAction == 'INSTALL' ] ; then
origFile="$qmlDir/PageSettings.qml"
fi
if (( $(grep -c "PackageManager" $origFile) > 0)); then
logMessage "ERROR: PageSettings.qml already modified for PackageManager -- skipping that modification"
logMessage "WARNING: PageSettings.qml already modified for PackageManager -- skipping that modification"
else
rm -f "/var/volatile/tmp/PageSettings.qml"
echo "//////// modified to insert PackageManager menu" > "/var/volatile/tmp/PageSettings.qml"
Expand Down
Loading

0 comments on commit 4c48a11

Please sign in to comment.