mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-10-04 07:58:32 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90c1c89183 | ||
|
|
010131eb85 |
+1
-1
@@ -2,7 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.66])
|
||||
AC_INIT(swupd-server, 3.7.1, matthew.johnson@intel.com)
|
||||
AC_INIT(swupd-server, 3.7.2, matthew.johnson@intel.com)
|
||||
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
||||
AM_SILENT_RULES([yes])
|
||||
AC_PROG_CC
|
||||
|
||||
+18
-3
@@ -336,7 +336,12 @@ int main(int argc, char **argv)
|
||||
apply_heuristics(new_full);
|
||||
match_manifests(old_full, new_full);
|
||||
|
||||
old_deleted = remove_deprecated_files(old_full, new_full, both_deleted);
|
||||
if (old_full->format < new_full->format) {
|
||||
old_deleted = remove_deprecated_files(old_full, new_full, both_deleted);
|
||||
} else {
|
||||
old_deleted = 0;
|
||||
}
|
||||
|
||||
if (old_deleted > 0) {
|
||||
LOG(NULL, "", "Old deleted files (%d) removed from full manifest", old_deleted);
|
||||
printf("Old deleted files (%d) removed from full manifest\n", old_deleted);
|
||||
@@ -402,7 +407,12 @@ int main(int argc, char **argv)
|
||||
/* Detect renamed files specifically for os-core */
|
||||
rename_detection(new_core);
|
||||
#endif
|
||||
old_deleted = remove_deprecated_files(old_core, new_core, both_deleted);
|
||||
if (old_core->format < new_core->format) {
|
||||
old_deleted = remove_deprecated_files(old_core, new_core, both_deleted);
|
||||
} else {
|
||||
old_deleted = 0;
|
||||
}
|
||||
|
||||
old_ghosted = remove_deprecated_files(old_core, new_core, both_ghosted);
|
||||
sort_manifest_by_version(new_core); /* sorts by filename */
|
||||
/* clean up orphaned renames by marking them as deleted */
|
||||
@@ -526,7 +536,12 @@ int main(int argc, char **argv)
|
||||
rename_detection(newm);
|
||||
#endif
|
||||
/* Step 6b: otherwise, write out the manifest */
|
||||
old_deleted = remove_deprecated_files(oldm, newm, both_deleted);
|
||||
if (oldm->format < newm->format) {
|
||||
old_deleted = remove_deprecated_files(oldm, newm, both_deleted);
|
||||
} else {
|
||||
old_deleted = 0;
|
||||
}
|
||||
|
||||
old_ghosted = remove_deprecated_files(oldm, newm, both_ghosted);
|
||||
sort_manifest_by_version(newm);
|
||||
type_change_detection(newm);
|
||||
|
||||
+7
-10
@@ -440,8 +440,11 @@ int match_manifests(struct manifest *m1, struct manifest *m2)
|
||||
file3->is_config = file1->is_config;
|
||||
file3->is_state = file1->is_state;
|
||||
file3->is_boot = file1->is_boot;
|
||||
file3->is_ghosted = file1->is_ghosted;
|
||||
/* ghost deleted boot files */
|
||||
file3->is_ghosted = file1->is_boot && file1->is_deleted;
|
||||
if (!file3->is_ghosted) {
|
||||
file3->is_ghosted = file1->is_boot && file1->is_deleted;
|
||||
}
|
||||
|
||||
if (file3->is_ghosted || file1->is_deleted) {
|
||||
/* if the new file is ghosted or the file was deleted, preserve
|
||||
@@ -983,10 +986,9 @@ bool changed_includes(struct manifest *old, struct manifest *new)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* For a format bump, it's convenient to remove deleted files from manifests
|
||||
* that last changed prior to the format bump, since they are no longer
|
||||
* considered for deletion as part of an update.
|
||||
*
|
||||
/* Remove files deprecated in this version as identified by the compfunc
|
||||
* function. This function can be used to remove old deleted files over a format
|
||||
* bump and remove deprecated ghosted files.
|
||||
* Note: this function should be called after match_manifests().
|
||||
*/
|
||||
int remove_deprecated_files(struct manifest *m1, struct manifest *m2, bool (*compfunc)(struct file *file1, struct file *file2))
|
||||
@@ -1005,11 +1007,6 @@ int remove_deprecated_files(struct manifest *m1, struct manifest *m2, bool (*com
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* This is the common case, so bail early, reporting no deletions */
|
||||
if (m1->format == m2->format) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* At this point, the manifest formats mismatch, and it's assumed that
|
||||
* m1 is the old manifest, and m2 is the new.
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@ setup() {
|
||||
# version 20: add a new boot file
|
||||
[ 1 -eq $(grep 'F\.b\. .* 20 /usr/lib/kernel/baz' $DIR/www/20/Manifest.full | wc -l) ]
|
||||
# version 30: old ghosted file /usr/lib/kernel/bar cleaned up
|
||||
[ 0 -eq $(grep '10 /usr/lib/kernel/bar' $DIR/www/30/Manifest.full | wc -l) ]
|
||||
[ 0 -eq $(grep '/usr/lib/kernel/bar' $DIR/www/30/Manifest.full | wc -l) ]
|
||||
# version 30: boot file added in version 20 ghosted
|
||||
[ 1 -eq $(grep '\.gb\. .* 30 /usr/lib/kernel/baz' $DIR/www/30/Manifest.full | wc -l) ]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user