Compare commits

..
21 Commits
Author SHA1 Message Date
Tudor Marcu ec31238e1a Release v3.3.0
This release contains various changes to fix segfaults and memory misuse,
simplifying logic when iterating directories and populating file structs
from manifests, and changing the secondary sort to be lexographically sorted
filenames for version-sorted manifests.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-11-17 01:14:42 -08:00
Tudor Marcu 74c8f86a94 Simplify logic for iterating directories
The file struct must be populated to contain the proper stats, so just
check if it is a directory and iterate, ignoring the case where d_type may
not be defined on the system.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-11-15 17:54:19 -08:00
Tudor Marcu a43964b110 Revert "Resort to lstat for FS not supporting dirent.d_type"
This reverts commit 983b17d68d.
2016-11-15 17:42:09 -08:00
Dmitry Rozhkov 983b17d68d Resort to lstat for FS not supporting dirent.d_type
According to POSIX.1 only d_name and d_ino fields of struct
dirent are standardized. d_type isn't always correctly set on file
systems like XFS. In such cases it makes sense to resort to
lstat(). Otherwise a user has hard time figuring out what's
wrong with her setup.

Also remove redundant populate_file_struct() as it's called
again in parallel threads.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2016-11-15 17:28:16 -08:00
Joshua Lock 5420a1ea1b Ensure os-core bundle is listed in groups.ini
If the os-core bundle is not listed in groups.ini we will run into
problems later on, including segfaults when processing bundle includes.

Check the os-core bundle is listed in the groups.ini during initialisation
and error gracefully when it is not.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
2016-11-15 17:26:45 -08:00
Patrick Ohly 1c75f53604 swupd_create_fullfiles: avoid segfault when nothing changes
In the (unlikely) case that nothing changed between two builds,
get_deduplicated_fullfile_list() segfaults because it uses
manifest->files without checking for NULL, aka the empty list.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2016-11-15 11:32:23 -08:00
Patrick Ohly 2890a11c5a delta.c: fix xattr test after patching
At the moment, swupd_create_pack fails when some files have xattrs and
get patched because the xattrs of the test file do not match the
original, unpatched file.

That's because xattrs_copy() was applied to the wrong target file.

Fixes: swupd-server/#35

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2016-11-15 11:28:26 -08:00
Tudor Marcu 2401aae76e Release v3.2.9
This release fixes the path where the server reads the bundle metadata from.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-09-29 17:17:30 -07:00
Patrick McCarty 30b46b9027 Update for new noship dir location
The bundle-chroot-builder changed the location where it stores bundle
includes metadata, so swupd-server needs to read from the new location.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-09-29 13:40:12 -07:00
Tudor Marcu c8ae097ed0 Release v3.2.8
This release updates the latest.version file, and provides minor cleanups
for useability.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-09-29 11:21:43 -07:00
Tudor Marcu 076a76fc4e Update for latest.version name change
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-09-29 11:21:43 -07:00
Tudor Marcu 63fb5fb61b Change strcmp to strncmp for consistency
Signed-off-by: John Andersen <john.s.andersen@intel.com>
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-09-29 10:54:07 -07:00
Auke Kok 7758a6bb77 Document and ship bundle status string.
This patch extracts the [STATUS] field from our bundle information
metadata, and stores it in groups.ini. From there we put the contents
of this string verbatim into the manifest.

We don't interpret, encode or convert the contents of the [STATUS]
field in the manifest. Instead, we just strip non-alphanumeric
characters and pass the contents on. This leaves it entirely to the
client to parse and interpret the value of this field in the manifest.

If the bundle file, or the groups.ini file omits any status, nothing
is output to the Manifest file.
2016-09-29 10:45:03 -07:00
Tudor Marcu 36c4e6324f Change version file to more appropriate name
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-09-07 17:21:09 -07:00
Tudor Marcu c4f61cb023 Release v3.2.7
Bump release version to provide a new server for a format bump.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-09-06 14:15:52 -07:00
Tudor Marcu 379d5189fc Release v3.2.6
This release introduces a change to the hashing scheme regarding delta names,
and directory hashes, as well as minor fixes to support the new hashing.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-08-22 03:23:22 -07:00
Tudor Marcu 6eca4601b0 Update argument passed to system_argv
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-08-22 03:22:14 -07:00
Tudor Marcu 4940d0cf83 Fix functional test for server changes
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-08-22 02:47:16 -07:00
Tudor Marcu 04d2af2f64 Change delta's name from FROM-TO-HASH2 to FROM-TO-HASH1-HASH2 format.
There is an issue when two different files in a newer release have same hash:
This is, when swupd updates a file by applying a delta, it takes the HASH2 to
know the file where delta must be applyed. If files are different in current
release (before updating), there must be 2 deltas, one for each file but as
the two files have same hash in new release delta's name are the same:
FROM-TO-HASH2 and it is when issue arises due to just the last delta file is
kept when swupd server creates files and packs. So when swupd client tries to
apply the delta to one of the file that does not corresponds it will fail and
generates an error. At the first look it will seem like delta file is corrupted
however the issue is that delta file was created for another file.
To solve this issue we include the hash for the original file in the delta's
name so that swupd client can take the correct delta and apply it:
FROM-TO-HASH1-HASH2.

Signed-off-by: Jose R Guzman <jose.r.guzman.mosqueda@intel.com>
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-08-19 17:17:20 -07:00
Tudor Marcu 1f98322737 Make directory hashes independent on filename
Calculate the hash for directories is desiderable to be independent
on the dirname due to the subsequent calculation on the staged/HASH
file. Here is used const "DIRECTORY" string for input name for
all folders.

Signed-off-by: Jose R Guzman <jose.r.guzman.mosqueda@intel.com>
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-08-19 17:15:56 -07:00
Tudor Marcu ddca171dad Release v3.2.5
This release includes a fix to replace system calls by local system_argv
functions, cleanup patches for error output and code style, adding delta
manifests to delta packs, consistency changes for tar and string allocation,
and removes creation of delta manifests out of create_update.
This is a re-roll of release 3.2.4 to fix a time skew issue that caused some
build failures.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-07-19 16:32:20 -07:00
15 changed files with 86 additions and 45 deletions
+2
View File
@@ -37,6 +37,7 @@ swupd_make_pack_SOURCES = \
src/config.c \ src/config.c \
src/delta.c \ src/delta.c \
src/globals.c \ src/globals.c \
src/groups.c \
src/helpers.c \ src/helpers.c \
src/log.c \ src/log.c \
src/make_packs.c \ src/make_packs.c \
@@ -53,6 +54,7 @@ swupd_make_fullfiles_SOURCES = \
src/delta.c \ src/delta.c \
src/fullfiles.c \ src/fullfiles.c \
src/globals.c \ src/globals.c \
src/groups.c \
src/helpers.c \ src/helpers.c \
src/log.c \ src/log.c \
src/make_fullfiles.c \ src/make_fullfiles.c \
+2 -2
View File
@@ -15,7 +15,7 @@ error() {
# eg: all of openstack, pnp, bat, cloud stuff, non-basic scripting language bundles # eg: all of openstack, pnp, bat, cloud stuff, non-basic scripting language bundles
${SWUPDREPO}/mk_groups_ini.sh ${SWUPDREPO}/mk_groups_ini.sh
PREVREL=`cat ${UPDATEDIR}/image/latest.version` PREVREL=`cat ${UPDATEDIR}/image/LAST_VER`
export SWUPD_CERTS_DIR=${SWUPD_CERTS_DIR:-"/root/swupd-certs"} export SWUPD_CERTS_DIR=${SWUPD_CERTS_DIR:-"/root/swupd-certs"}
export LEAF_KEY="leaf.key.pem" export LEAF_KEY="leaf.key.pem"
@@ -46,7 +46,7 @@ for job in $(jobs -p); do
done done
# expose the new build to staging / testing # expose the new build to staging / testing
echo ${VER} > ${UPDATEDIR}/image/latest.version echo ${VER} > ${UPDATEDIR}/image/LAST_VER
STAGING_FILE="${UPDATEDIR}/www/version/formatstaging/latest" STAGING_FILE="${UPDATEDIR}/www/version/formatstaging/latest"
if [ ! -f "${STAGING_FILE}" ]; then if [ ! -f "${STAGING_FILE}" ]; then
+1 -1
View File
@@ -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.4, timothy.c.pepper@linux.intel.com) AC_INIT(swupd-server, 3.3.0, 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
+4 -1
View File
@@ -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
@@ -219,6 +221,7 @@ extern void read_group_file(char *filename);
extern void release_group_file(void); extern void release_group_file(void);
extern char *group_groups(char *group); extern char *group_groups(char *group);
extern char *group_packages(char *group); extern char *group_packages(char *group);
extern char *group_status(char *group);
extern char *next_group(void); extern char *next_group(void);
extern void apply_heuristics(struct manifest *manifest); extern void apply_heuristics(struct manifest *manifest);
@@ -242,7 +245,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);
+6 -2
View File
@@ -18,8 +18,8 @@ if [ ! -f "$SWUPD_SERVER_INI" ]; then
sed -i "s|/var/lib/update|$UPDATEDIR|" $SWUPD_SERVER_INI sed -i "s|/var/lib/update|$UPDATEDIR|" $SWUPD_SERVER_INI
fi fi
if [ ! -f "$UPDATEDIR/image/latest.version" ]; then if [ ! -f "$UPDATEDIR/image/LAST_VER" ]; then
echo "0" > $UPDATEDIR/image/latest.version echo "0" > $UPDATEDIR/image/LAST_VER
fi fi
echo "rebuilding $SWUPD_GROUPS_INI based on $BUNDLEREPO" echo "rebuilding $SWUPD_GROUPS_INI based on $BUNDLEREPO"
@@ -27,7 +27,11 @@ rm -f $SWUPD_GROUPS_INI
for bundle in $(ls $BUNDLEREPO/bundles) for bundle in $(ls $BUNDLEREPO/bundles)
do do
status=$(awk -F: '/^# .STATUS/ {print $2}' $BUNDLEREPO/$bundle | tr -cd '[[:alnum:]]')
echo "[$bundle]" >> $SWUPD_GROUPS_INI echo "[$bundle]" >> $SWUPD_GROUPS_INI
echo "group=$bundle" >> $SWUPD_GROUPS_INI echo "group=$bundle" >> $SWUPD_GROUPS_INI
if [ -n "$status" ]; then
echo "status=$status" >> $SWUPD_GROUPS_INI
fi
echo "" >> $SWUPD_GROUPS_INI echo "" >> $SWUPD_GROUPS_INI
done done
+3 -3
View File
@@ -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;
} }
@@ -353,7 +353,7 @@ static void iterate_directory(struct manifest *manifest, char *pathprefix,
populate_file_struct(file, fullname); populate_file_struct(file, fullname);
free(fullname); free(fullname);
if (entry->d_type == DT_DIR) { if (file->is_dir) {
iterate_directory(manifest, pathprefix, file->filename, do_hash); iterate_directory(manifest, pathprefix, file->filename, do_hash);
} }
@@ -418,7 +418,7 @@ GList *get_sub_manifest_includes(char *component, int version)
char *included; char *included;
char line[8192]; char line[8192];
conf = config_output_dir(); conf = config_image_base();
if (conf == NULL) { if (conf == NULL) {
assert(0); assert(0);
} }
+27 -3
View File
@@ -146,7 +146,7 @@ static void populate_dirs(int version)
if ((access(newversiondir, F_OK | R_OK) != 0) && (version == 0)) { if ((access(newversiondir, F_OK | R_OK) != 0) && (version == 0)) {
char *latestpath = NULL; char *latestpath = NULL;
string_or_die(&latestpath, "%s/latest.version", image_dir); string_or_die(&latestpath, "%s/LAST_VER", image_dir);
printf("** %s does not exist... creating and populating\n", newversiondir); printf("** %s does not exist... creating and populating\n", newversiondir);
if (mkdir(newversiondir, 0755) != 0) { if (mkdir(newversiondir, 0755) != 0) {
@@ -212,6 +212,25 @@ static int check_build_env(void)
return 0; return 0;
} }
static int check_group_file(void)
{
int ret = -1;
// Ensure the os-core group is defined
while (1) {
char *group = next_group();
if (!group) {
break;
}
if (strcmp(group, "os-core") == 0) {
ret = 0;
break;
}
}
return ret;
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
struct manifest *new_core = NULL; struct manifest *new_core = NULL;
@@ -270,8 +289,13 @@ int main(int argc, char **argv)
string_or_die(&file_path, "%s/groups.ini", state_dir); string_or_die(&file_path, "%s/groups.ini", state_dir);
read_group_file(file_path); read_group_file(file_path);
free(file_path); free(file_path);
ret = check_group_file();
if (ret != 0) {
printf("os-core bundle is not listed in groups.ini, this is required.\n");
goto exit;
}
read_current_version("latest.version"); read_current_version("LAST_VER");
printf("Last processed version is %i\n", current_version); printf("Last processed version is %i\n", current_version);
populate_dirs(newversion); populate_dirs(newversion);
@@ -502,7 +526,7 @@ int main(int argc, char **argv)
exit: exit:
if (exit_status == EXIT_SUCCESS) { if (exit_status == EXIT_SUCCESS) {
write_cookiecrumbs_to_download_area(newversion); write_cookiecrumbs_to_download_area(newversion);
//write_new_version("latest.version", newversion); //write_new_version("LAST_VER", newversion);
} }
release_configuration_data(); release_configuration_data();
release_group_file(); release_group_file();
+7 -12
View File
@@ -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);
@@ -98,7 +97,7 @@ void __create_delta(struct file *file, int from_version)
ret = 0; ret = 0;
goto out; goto out;
} }
xattrs_copy(original, newfile); xattrs_copy(original, testnewfile);
/* does xattrs have been correctly copied?*/ /* does xattrs have been correctly copied?*/
if (xattrs_compare(original, testnewfile) != 0) { if (xattrs_compare(original, testnewfile) != 0) {
@@ -109,12 +108,8 @@ void __create_delta(struct file *file, int from_version)
goto out; goto out;
} }
string_or_die(&param1, "%s", newfile); char *const sanitycheck[] = { "cmp", "-s", newfile, testnewfile, NULL };
string_or_die(&param2, "%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);
+1 -1
View File
@@ -252,7 +252,7 @@ static GList *get_deduplicated_fullfile_list(struct manifest *manifest)
manifest->files = g_list_sort(manifest->files, file_sort_hash); manifest->files = g_list_sort(manifest->files, file_sort_hash);
list = g_list_first(manifest->files); list = g_list_first(manifest->files);
while (prev == NULL) { while (prev == NULL && list != NULL) {
tmp = list->data; tmp = list->data;
list = g_list_next(list); list = g_list_next(list);
+7
View File
@@ -51,6 +51,13 @@ char *group_groups(char *group)
return g_key_file_get_value(groupfile, group, "groups", NULL); return g_key_file_get_value(groupfile, group, "groups", NULL);
} }
char *group_status(char *group)
{
assert(groupfile != NULL);
return g_key_file_get_value(groupfile, group, "status", NULL);
}
void read_group_file(char *filename) void read_group_file(char *filename)
{ {
GError *error = NULL; GError *error = NULL;
+9 -9
View File
@@ -44,15 +44,15 @@ static void runtime_state_heuristics(struct file *file)
{ {
/* these are shipped directories that are not themselves state, /* these are shipped directories that are not themselves state,
* rather only their contents are state */ * rather only their contents are state */
if ((strcmp(file->filename, "/usr/src/debug") == 0) || if ((strncmp(file->filename, "/usr/src/debug", 14) == 0) ||
(strcmp(file->filename, "/dev") == 0) || (strncmp(file->filename, "/dev", 4) == 0) ||
(strcmp(file->filename, "/home") == 0) || (strncmp(file->filename, "/home", 5) == 0) ||
(strcmp(file->filename, "/proc") == 0) || (strncmp(file->filename, "/proc", 5) == 0) ||
(strcmp(file->filename, "/root") == 0) || (strncmp(file->filename, "/root", 5) == 0) ||
(strcmp(file->filename, "/run") == 0) || (strncmp(file->filename, "/run", 4) == 0) ||
(strcmp(file->filename, "/sys") == 0) || (strncmp(file->filename, "/sys", 4) == 0) ||
(strcmp(file->filename, "/tmp") == 0) || (strncmp(file->filename, "/tmp", 4) == 0) ||
(strcmp(file->filename, "/var") == 0)) { (strncmp(file->filename, "/var", 4) == 0)) {
return; return;
} }
+5
View File
@@ -728,6 +728,7 @@ static int write_manifest_plain(struct manifest *manifest)
char *base = NULL, *dir; char *base = NULL, *dir;
char *conf = config_output_dir(); char *conf = config_output_dir();
char *filename = NULL; char *filename = NULL;
char *status = NULL;
char *submanifest_filename = NULL; char *submanifest_filename = NULL;
char *manifest_tempdir = NULL; char *manifest_tempdir = NULL;
char *tempmanifest = NULL; char *tempmanifest = NULL;
@@ -762,6 +763,10 @@ static int write_manifest_plain(struct manifest *manifest)
compute_content_size(manifest); compute_content_size(manifest);
fprintf(out, "contentsize:\t%llu\n", (long long unsigned int)manifest->contentsize); fprintf(out, "contentsize:\t%llu\n", (long long unsigned int)manifest->contentsize);
includes = manifest->includes; includes = manifest->includes;
status = group_status(manifest->component);
if (status) {
fprintf(out, "status:\t%s\n", status);
}
while (includes) { while (includes) {
struct manifest *sub = includes->data; struct manifest *sub = includes->data;
includes = g_list_next(includes); includes = g_list_next(includes);
+7 -7
View File
@@ -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,
+1 -1
View File
@@ -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
+4 -3
View File
@@ -27,7 +27,7 @@ init_server_ini() {
} }
set_latest_ver() { set_latest_ver() {
echo "$1" > $DIR/image/latest.version echo "$1" > $DIR/image/LAST_VER
} }
init_groups_ini() { init_groups_ini() {
@@ -35,6 +35,7 @@ init_groups_ini() {
cat >> $DIR/groups.ini << EOF cat >> $DIR/groups.ini << EOF
[$bundle] [$bundle]
group=$bundle group=$bundle
status=ACTIVE
EOF EOF
done done
} }
@@ -57,9 +58,9 @@ gen_includes_file() {
local bundle=$1 local bundle=$1
local ver=$2 local ver=$2
local includes="${@:3}" local includes="${@:3}"
mkdir -p $DIR/www/$ver/noship mkdir -p $DIR/image/$ver/noship
for b in $includes; do for b in $includes; do
cat >> $DIR/www/$ver/noship/"$bundle"-includes << EOF cat >> $DIR/image/$ver/noship/"$bundle"-includes << EOF
$b $b
EOF EOF
done done