diff options
Diffstat (limited to 'backup-partition.rsc')
-rw-r--r-- | backup-partition.rsc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backup-partition.rsc b/backup-partition.rsc index a72dd0b..3c883f7 100644 --- a/backup-partition.rsc +++ b/backup-partition.rsc @@ -15,11 +15,13 @@ :do { :local ScriptName [ :jobname ]; + :global BackupPartitionCopyBeforeFeatureUpdate; :global PackagesUpdateBackupFailure; :global LogPrint; :global ScriptFromTerminal; :global ScriptLock; + :global VersionToNum; :local CopyTo do={ :local ScriptName [ :tostr $1 ]; @@ -67,6 +69,17 @@ :error false; } } + } else={ + :local Update [ /system/package/update/get ]; + :local NumInstalled [ $VersionToNum ($Update->"installed-version") ]; + :local NumLatest [ $VersionToNum ($Update->"latest-version") ]; + :if ($BackupPartitionCopyBeforeFeatureUpdate = true && $NumLatest > 0 && \ + ($NumInstalled & 0xffff0000) != ($NumLatest & 0xffff0000)) do={ + :if ([ $CopyTo $ScriptName $FallbackTo ] = false) do={ + :set PackagesUpdateBackupFailure true; + :error false; + } + } } } |