mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-10-04 16:08:29 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4f61cb023 | ||
|
|
379d5189fc | ||
|
|
6eca4601b0 | ||
|
|
4940d0cf83 | ||
|
|
04d2af2f64 | ||
|
|
1f98322737 |
+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.2.5, timothy.c.pepper@linux.intel.com)
|
AC_INIT(swupd-server, 3.2.7, timothy.c.pepper@linux.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
|
||||||
|
|||||||
+3
-1
@@ -36,6 +36,8 @@
|
|||||||
#define TAR_PERM_ATTR_ARGS_STRLIST TAR_XATTR_ARGS_STRLIST "--preserve-permissions"
|
#define TAR_PERM_ATTR_ARGS_STRLIST TAR_XATTR_ARGS_STRLIST "--preserve-permissions"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define SWUPD_HASH_DIRNAME "DIRECTORY"
|
||||||
|
|
||||||
#if SWUPD_WITH_STATELESS
|
#if SWUPD_WITH_STATELESS
|
||||||
#define OS_IS_STATELESS 1
|
#define OS_IS_STATELESS 1
|
||||||
#else
|
#else
|
||||||
@@ -242,7 +244,7 @@ extern void type_change_detection(struct manifest *manifest);
|
|||||||
|
|
||||||
extern void rename_detection(struct manifest *manifest, int last_change, GList *last_versions_list);
|
extern void rename_detection(struct manifest *manifest, int last_change, GList *last_versions_list);
|
||||||
extern void link_renames(GList *newfiles, struct manifest *from_manifest);
|
extern void link_renames(GList *newfiles, struct manifest *from_manifest);
|
||||||
extern void __create_delta(struct file *file, int from_version);
|
extern void __create_delta(struct file *file, int from_version, char *from_hash);
|
||||||
|
|
||||||
extern void account_delta_hit(void);
|
extern void account_delta_hit(void);
|
||||||
extern void account_delta_miss(void);
|
extern void account_delta_miss(void);
|
||||||
|
|||||||
+1
-1
@@ -222,7 +222,7 @@ int compute_hash(struct file *file, char *filename)
|
|||||||
hmac_sha256_for_string(file->hash,
|
hmac_sha256_for_string(file->hash,
|
||||||
(const unsigned char *)key,
|
(const unsigned char *)key,
|
||||||
key_len,
|
key_len,
|
||||||
file->filename); //file->filename not filename
|
SWUPD_HASH_DIRNAME); // Make independent of dirname
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-11
@@ -35,10 +35,9 @@
|
|||||||
#include "swupd.h"
|
#include "swupd.h"
|
||||||
#include "xattrs.h"
|
#include "xattrs.h"
|
||||||
|
|
||||||
void __create_delta(struct file *file, int from_version)
|
void __create_delta(struct file *file, int from_version, char *from_hash)
|
||||||
{
|
{
|
||||||
char *original, *newfile, *outfile, *dotfile, *testnewfile;
|
char *original, *newfile, *outfile, *dotfile, *testnewfile, *conf;
|
||||||
char *conf, *param1, *param2;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (file->is_link) {
|
if (file->is_link) {
|
||||||
@@ -62,9 +61,9 @@ void __create_delta(struct file *file, int from_version)
|
|||||||
|
|
||||||
conf = config_output_dir();
|
conf = config_output_dir();
|
||||||
|
|
||||||
string_or_die(&outfile, "%s/%i/delta/%i-%i-%s", conf, file->last_change, from_version, file->last_change, file->hash);
|
string_or_die(&outfile, "%s/%i/delta/%i-%i-%s-%s", conf, file->last_change, from_version, file->last_change, from_hash, file->hash);
|
||||||
string_or_die(&dotfile, "%s/%i/delta/.%i-%i-%s", conf, file->last_change, from_version, file->last_change, file->hash);
|
string_or_die(&dotfile, "%s/%i/delta/.%i-%i-%s-%s", conf, file->last_change, from_version, file->last_change, from_hash, file->hash);
|
||||||
string_or_die(&testnewfile, "%s/%i/delta/.%i-%i-%s.testnewfile", conf, file->last_change, from_version, file->last_change, file->hash);
|
string_or_die(&testnewfile, "%s/%i/delta/.%i-%i-%s-%s.testnewfile", conf, file->last_change, from_version, file->last_change, from_hash, file->hash);
|
||||||
|
|
||||||
LOG(file, "Making delta", "%s->%s", original, newfile);
|
LOG(file, "Making delta", "%s->%s", original, newfile);
|
||||||
|
|
||||||
@@ -109,12 +108,8 @@ void __create_delta(struct file *file, int from_version)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
string_or_die(¶m1, "%s", newfile);
|
char *const sanitycheck[] = { "cmp", "-s", newfile, testnewfile, NULL };
|
||||||
string_or_die(¶m2, "%s", testnewfile);
|
|
||||||
char *const sanitycheck[] = { "cmp", "-s", param1, param2, NULL };
|
|
||||||
ret = system_argv(sanitycheck);
|
ret = system_argv(sanitycheck);
|
||||||
free(param1);
|
|
||||||
free(param2);
|
|
||||||
if (ret == -1 || ret == 2) {
|
if (ret == -1 || ret == 2) {
|
||||||
printf("Sanity check system command failed %i. \n", ret);
|
printf("Sanity check system command failed %i. \n", ret);
|
||||||
printf("%s->%s via diff %s yielded %s\n", original, newfile, dotfile, testnewfile);
|
printf("%s->%s via diff %s yielded %s\n", original, newfile, dotfile, testnewfile);
|
||||||
|
|||||||
+7
-7
@@ -254,8 +254,8 @@ static GList *consolidate_packs_delta_files(GList *files, struct packdata *pack)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
string_or_die(&from, "%s/%i/delta/%i-%i-%s", staging_dir, file->last_change,
|
string_or_die(&from, "%s/%i/delta/%i-%i-%s-%s", staging_dir, file->last_change,
|
||||||
file->peer->last_change, file->last_change, file->hash);
|
file->peer->last_change, file->last_change, file->peer->hash, file->hash);
|
||||||
|
|
||||||
ret = stat(from, &stat_delta);
|
ret = stat(from, &stat_delta);
|
||||||
if (ret && !find_file_in_list(files, file)) {
|
if (ret && !find_file_in_list(files, file)) {
|
||||||
@@ -274,7 +274,7 @@ static void create_delta(gpointer data, __unused__ gpointer user_data)
|
|||||||
|
|
||||||
/* if the file was not found in the from version, skip delta creation */
|
/* if the file was not found in the from version, skip delta creation */
|
||||||
if (file->peer) {
|
if (file->peer) {
|
||||||
__create_delta(file, file->peer->last_change);
|
__create_delta(file, file->peer->last_change, file->peer->hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,11 +353,11 @@ static int make_final_pack(struct packdata *pack)
|
|||||||
|
|
||||||
/* for each file changed since <X> */
|
/* for each file changed since <X> */
|
||||||
/* locate delta, check if the diff it's from is >= <X> */
|
/* locate delta, check if the diff it's from is >= <X> */
|
||||||
string_or_die(&from, "%s/%i/delta/%i-%i-%s", staging_dir, file->last_change,
|
string_or_die(&from, "%s/%i/delta/%i-%i-%s-%s", staging_dir, file->last_change,
|
||||||
file->peer->last_change, file->last_change, file->hash);
|
file->peer->last_change, file->last_change, file->peer->hash, file->hash);
|
||||||
string_or_die(&to, "%s/%s/%i_to_%i/delta/%i-%i-%s", packstage_dir,
|
string_or_die(&to, "%s/%s/%i_to_%i/delta/%i-%i-%s-%s", packstage_dir,
|
||||||
pack->module, pack->from, pack->to, file->peer->last_change,
|
pack->module, pack->from, pack->to, file->peer->last_change,
|
||||||
file->last_change, file->hash);
|
file->last_change, file->peer->hash, file->hash);
|
||||||
string_or_die(&tarfrom, "%s/%i/files/%s.tar", staging_dir,
|
string_or_die(&tarfrom, "%s/%i/files/%s.tar", staging_dir,
|
||||||
file->last_change, file->hash);
|
file->last_change, file->hash);
|
||||||
string_or_die(&tarto, "%s/%s/%i_to_%i/staged/%s.tar", packstage_dir,
|
string_or_die(&tarto, "%s/%s/%i_to_%i/staged/%s.tar", packstage_dir,
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ setup() {
|
|||||||
[[ 1 -eq $(grep '/usr/share/clear$' $DIR/www/10/Manifest.os-core | wc -l) ]]
|
[[ 1 -eq $(grep '/usr/share/clear$' $DIR/www/10/Manifest.os-core | wc -l) ]]
|
||||||
[[ 1 -eq $(grep '/usr/share/clear/bundles$' $DIR/www/10/Manifest.os-core | wc -l) ]]
|
[[ 1 -eq $(grep '/usr/share/clear/bundles$' $DIR/www/10/Manifest.os-core | wc -l) ]]
|
||||||
[[ 4 -eq $(tar -tf $DIR/www/10/pack-test-bundle-from-0.tar | wc -l) ]]
|
[[ 4 -eq $(tar -tf $DIR/www/10/pack-test-bundle-from-0.tar | wc -l) ]]
|
||||||
[[ 9 -eq $(tar -tf $DIR/www/10/pack-os-core-from-0.tar | wc -l) ]]
|
[[ 5 -eq $(tar -tf $DIR/www/10/pack-os-core-from-0.tar | wc -l) ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
|
# vi: ft=sh ts=8 sw=2 sts=2 et tw=80
|
||||||
|
|||||||
Reference in New Issue
Block a user