34#include "cmdhandler.h"
41#include "clientpipe.h"
42#include "longgetopt.h"
48static const char *module_str =
"update_all_cmd";
61 client_printf(sockfd,
"Perform policy import, update zonelist, and update repositorylist.\n\n");
68 char *zonelist = NULL;
69 char **replist = NULL;
70 char **policy_names = NULL;
76 &zonelist, &replist, &repcount,
77 (ods_log_verbosity() >= 3)))
78 ods_log_error_and_printf(sockfd, module_str,
79 "Unable to validate '%s' consistency.",
81 else if (
check_kasp(kasp, replist, repcount, 0, &policy_names, &policy_count))
82 ods_log_error_and_printf(sockfd, module_str,
83 "Unable to validate '%s' consistency.", kasp);
85 ods_log_error_and_printf(sockfd, module_str,
86 "Unable to validate '%s' consistency.", zonelist);
92 for (i = 0; i < repcount; i++) free(replist[i]);
96 for (i = 0; i < policy_count; i++) free(policy_names[i]);
102run(cmdhandler_ctx_type* context,
int argc,
char* argv[])
104 int sockfd = context->sockfd;
114 if (!(error = check_all(sockfd, engine))) {
136 "update all", &usage, &help, NULL, NULL, &run, NULL
db_connection_t * getconnectioncontext(cmdhandler_ctx_type *context)
engine_type * getglobalcontext(cmdhandler_ctx_type *context)
void engine_start_workers(engine_type *engine)
void engine_stop_workers(engine_type *engine)
int check_kasp(const char *kasp, char **repo_list, int repo_count, int verbose, char ***policy_names_out, int *policy_count_out)
int check_zonelist(const char *zonelist, int verbose, char **policy_names, int policy_count)
int check_conf(const char *conf, char **kasp, char **zonelist, char ***repo_listout, int *repo_countout, int verbose)
int policy_import(int sockfd, engine_type *engine, db_connection_t *dbconn, int do_delete)
pthread_mutex_t signal_lock
pthread_cond_t signal_cond
engineconfig_type * config
const char * cfg_filename
struct cmd_func_block update_all_funcblock
int zonelist_import(int sockfd, engine_type *engine, db_connection_t *dbconn, int do_delete, const char *zonelist_path)