mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-10-04 16:08:29 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a46cb6a9d | ||
|
|
15c045de8d |
@@ -114,6 +114,7 @@ dist_check_SCRIPTS = \
|
|||||||
test/functional/full-run/test.bats \
|
test/functional/full-run/test.bats \
|
||||||
test/functional/fullfiles/test.bats \
|
test/functional/fullfiles/test.bats \
|
||||||
test/functional/include-version-bump/test.bats \
|
test/functional/include-version-bump/test.bats \
|
||||||
|
test/functional/includes-deduplicate/test.bats \
|
||||||
test/functional/no-delta/test.bats \
|
test/functional/no-delta/test.bats \
|
||||||
test/functional/pack/test.bats \
|
test/functional/pack/test.bats \
|
||||||
test/functional/state-file/test.bats \
|
test/functional/state-file/test.bats \
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ([2.66])
|
AC_PREREQ([2.66])
|
||||||
AC_INIT(swupd-server, 3.3.4, tudor.marcu@intel.com)
|
AC_INIT(swupd-server, 3.3.5, tudor.marcu@intel.com)
|
||||||
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
|
||||||
AM_SILENT_RULES([yes])
|
AM_SILENT_RULES([yes])
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|||||||
+17
-2
@@ -406,25 +406,40 @@ int main(int argc, char **argv)
|
|||||||
GList *name_includes;
|
GList *name_includes;
|
||||||
char *group = next_group();
|
char *group = next_group();
|
||||||
struct manifest *manifest;
|
struct manifest *manifest;
|
||||||
|
struct manifest *current = NULL;
|
||||||
|
|
||||||
if (!group) {
|
if (!group) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
manifest = g_hash_table_lookup(new_manifests, group);
|
manifest = g_hash_table_lookup(new_manifests, group);
|
||||||
name_includes = manifest->includes;
|
name_includes = manifest->includes;
|
||||||
|
|
||||||
while (name_includes) {
|
while (name_includes) {
|
||||||
char *name = name_includes->data;
|
char *name = name_includes->data;
|
||||||
name_includes = g_list_next(name_includes);
|
name_includes = g_list_next(name_includes);
|
||||||
manifest_includes = g_list_prepend(manifest_includes, g_hash_table_lookup(new_manifests, name));
|
|
||||||
|
current = g_hash_table_lookup(new_manifests, name);
|
||||||
|
|
||||||
|
// Avoid adding duplicate includes to the list
|
||||||
|
if (g_list_find(manifest_includes, current) == NULL) {
|
||||||
|
manifest_includes = g_list_prepend(manifest_includes, current);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
manifest->includes = manifest_includes;
|
manifest->includes = manifest_includes;
|
||||||
manifest_includes = NULL;
|
manifest_includes = NULL;
|
||||||
manifest = g_hash_table_lookup(old_manifests, group);
|
manifest = g_hash_table_lookup(old_manifests, group);
|
||||||
name_includes = manifest->includes;
|
name_includes = manifest->includes;
|
||||||
|
|
||||||
while (name_includes) {
|
while (name_includes) {
|
||||||
char *name = name_includes->data;
|
char *name = name_includes->data;
|
||||||
name_includes = g_list_next(name_includes);
|
name_includes = g_list_next(name_includes);
|
||||||
manifest_includes = g_list_prepend(manifest_includes, g_hash_table_lookup(old_manifests, name));
|
|
||||||
|
current = g_hash_table_lookup(old_manifests, name);
|
||||||
|
|
||||||
|
// Avoid adding duplicate includes to the list
|
||||||
|
if (g_list_find(manifest_includes, current) == NULL) {
|
||||||
|
manifest_includes = g_list_prepend(manifest_includes, current);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
manifest->includes = manifest_includes;
|
manifest->includes = manifest_includes;
|
||||||
}
|
}
|
||||||
|
|||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
# common functions
|
||||||
|
load "../swupdlib"
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
clean_test_dir
|
||||||
|
init_test_dir
|
||||||
|
|
||||||
|
init_server_ini
|
||||||
|
set_latest_ver 0
|
||||||
|
init_groups_ini os-core test-bundle1 test-bundle2
|
||||||
|
|
||||||
|
set_os_release 10 os-core
|
||||||
|
track_bundle 10 os-core
|
||||||
|
track_bundle 10 test-bundle1
|
||||||
|
track_bundle 10 test-bundle2
|
||||||
|
|
||||||
|
set_os_release 20 os-core
|
||||||
|
track_bundle 20 os-core
|
||||||
|
track_bundle 20 test-bundle1
|
||||||
|
track_bundle 20 test-bundle2
|
||||||
|
|
||||||
|
gen_file_plain 10 os-core test0
|
||||||
|
gen_file_plain 10 test-bundle1 test1
|
||||||
|
gen_file_plain 10 test-bundle2 test2
|
||||||
|
|
||||||
|
gen_includes_file test-bundle2 10 test-bundle1 test-bundle1
|
||||||
|
gen_includes_file test-bundle2 20 test-bundle1 test-bundle1
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "deduplicate bundle includes" {
|
||||||
|
sudo $CREATE_UPDATE --osversion 10 --statedir $DIR --format 3
|
||||||
|
set_latest_ver 10
|
||||||
|
sudo $CREATE_UPDATE --osversion 20 --statedir $DIR --format 3
|
||||||
|
|
||||||
|
# includes list should be deduplicated in both the old and new manifests
|
||||||
|
[[ 1 -eq $(grep '^includes: test-bundle1$' $DIR/www/10/Manifest.test-bundle2 | wc -l) ]]
|
||||||
|
[[ 1 -eq $(grep '^includes: test-bundle1$' $DIR/www/20/Manifest.test-bundle2 | wc -l) ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
|
||||||
Reference in New Issue
Block a user