From abb2ac74326085c4f895f501092fa317fb470b42 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 23 Nov 2010 20:04:08 +0000 Subject: [PATCH] Avoided to bother libjte if no output paths are given --- libisoburn/trunk/xorriso/base_obj.c | 1 + libisoburn/trunk/xorriso/lib_mgt.c | 13 +++++++++++++ libisoburn/trunk/xorriso/write_run.c | 8 ++++---- libisoburn/trunk/xorriso/xorriso_private.h | 7 ++++++- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/libisoburn/trunk/xorriso/base_obj.c b/libisoburn/trunk/xorriso/base_obj.c index 0cc9e9e3..d0d46e68 100644 --- a/libisoburn/trunk/xorriso/base_obj.c +++ b/libisoburn/trunk/xorriso/base_obj.c @@ -242,6 +242,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) m->jigdo_params= NULL; m->jigdo_values= NULL; + m->libjte_params_given= 0; m->loaded_boot_bin_lba= 0; m->loaded_boot_cat_path[0]= 0; m->allow_graft_points= 0; diff --git a/libisoburn/trunk/xorriso/lib_mgt.c b/libisoburn/trunk/xorriso/lib_mgt.c index 915f1233..4a98813a 100644 --- a/libisoburn/trunk/xorriso/lib_mgt.c +++ b/libisoburn/trunk/xorriso/lib_mgt.c @@ -610,6 +610,7 @@ int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg, libjte_destroy(&(xorriso->libjte_handle)); Xorriso_lst_destroy_all(&(xorriso->jigdo_params), 0); Xorriso_lst_destroy_all(&(xorriso->jigdo_values), 0); + xorriso->libjte_params_given= 0; return(1); } ret= Xorriso_assert_jte_handle(xorriso, 0); @@ -622,9 +623,11 @@ int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg, libjte_set_verbose(jte, 1); /* Direct libjte messages to stderr, rather than message list */ libjte_set_error_behavior(xorriso->libjte_handle, 1, 0); + xorriso->libjte_params_given|= 2; } else if(strcmp(arg, "off") == 0) { libjte_set_verbose(jte, 0); libjte_set_error_behavior(xorriso->libjte_handle, 0, 0); + xorriso->libjte_params_given&= ~2; } else goto bad_arg; } else if(strcmp(aspect, "template_path") == 0 || @@ -632,52 +635,62 @@ int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg, ret= libjte_set_template_path(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 4; } else if(strcmp(aspect, "jigdo_path") == 0 || strcmp(aspect, "-jigdo-jigdo") == 0) { ret= libjte_set_jigdo_path(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 8; } else if(strcmp(aspect, "md5_path") == 0 || strcmp(aspect, "-md5-list") == 0) { ret= libjte_set_md5_path(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 16; } else if(strcmp(aspect, "min_size") == 0 || strcmp(aspect, "-jigdo-min-file-size") == 0) { num= Scanf_io_size(arg, 0); ret= libjte_set_min_size(jte, num); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 32; } else if(strcmp(aspect, "checksum_iso") == 0 || strcmp(aspect, "-checksum_algorithm_iso") == 0) { ret= libjte_set_checksum_iso(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 64; } else if(strcmp(aspect, "checksum_template") == 0 || strcmp(aspect, "-checksum_algorithm_template") == 0) { ret= libjte_set_checksum_template(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 128; } else if(strcmp(aspect, "compression") == 0 || strcmp(aspect, "-jigdo-template-compress") == 0) { ret= libjte_set_compression(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 256; } else if(strcmp(aspect, "exclude") == 0 || strcmp(aspect, "-jigdo-exclude") == 0) { ret= libjte_add_exclude(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 512; } else if(strcmp(aspect, "demand_md5") == 0 || strcmp(aspect, "-jigdo-force-md5") == 0) { ret= libjte_add_md5_demand(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 1024; } else if(strcmp(aspect, "mapping") == 0 || strcmp(aspect, "-jigdo-map") == 0) { ret= libjte_add_mapping(jte, arg); if(ret <= 0) goto jte_failed; + xorriso->libjte_params_given|= 2048; } else { sprintf(xorriso->info_text, "-jigdo: unknown aspect '%s'", aspect); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); diff --git a/libisoburn/trunk/xorriso/write_run.c b/libisoburn/trunk/xorriso/write_run.c index 822425d6..acbac4b0 100644 --- a/libisoburn/trunk/xorriso/write_run.c +++ b/libisoburn/trunk/xorriso/write_run.c @@ -769,14 +769,14 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag) xorriso->vol_uuid); #ifdef Xorriso_with_libjtE - if(xorriso->libjte_handle) { + if(xorriso->libjte_handle && (xorriso->libjte_params_given & (4 | 8))) { + + /* >>> Check whether the mandatory parameters are set */; + ret= libjte_set_outfile(xorriso->libjte_handle, xorriso->outdev); Xorriso_process_msg_queues(xorriso, 0); if(ret <= 0) goto ex; - - /* >>> Check whether the mandatory parameters are set */; - isoburn_igopt_attach_jte(sopts, xorriso->libjte_handle); /* Padding to be done by libisofs, not by libburn */ diff --git a/libisoburn/trunk/xorriso/xorriso_private.h b/libisoburn/trunk/xorriso/xorriso_private.h index 52227ceb..21c537a1 100644 --- a/libisoburn/trunk/xorriso/xorriso_private.h +++ b/libisoburn/trunk/xorriso/xorriso_private.h @@ -359,7 +359,12 @@ struct XorrisO { /* the global context of xorriso */ /* List of -jigdo parameters since the most recent -jigdo clear */ struct Xorriso_lsT *jigdo_params; struct Xorriso_lsT *jigdo_values; - + int libjte_params_given; /* bits: 0= outfile , 1= verbosity , 2= template_path + 3= jigdo_path , 4= md5_path , 5= min_size + 6= checksum_iso , 7= checksum_template + 8= compression , 9= exclude , 10= demand_md5 + 11= mapping + */ /* LBA of boot image after image loading */ int loaded_boot_bin_lba; diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 2ce2e52f..ce6105ae 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2010.11.23.193708" +#define Xorriso_timestamP "2010.11.23.200346"