528
528
/**********************************************************************/
530
int upda_products (cpl_frameset * frameset)
531
_upda_products (cpl_frameset *frameset, unsigned int flags)
541
reto = cpl_dfs_update_product_header(frameset);
542
if (reto != CPL_ERROR_NONE)
544
cpl_msg_error (er_func, "could not update the product header...");
539
reto = cpl_dfs_update_product_header(frameset);
543
unsigned int _flags = CPL_DFS_SIGNATURE_DATAMD5 | CPL_DFS_SIGNATURE_CHECKSUM;
544
reto = cpl_dfs_sign_products(frameset, _flags);
546
reto = cpl_dfs_sign_products(frameset, flags);
551
if (reto != CPL_ERROR_NONE)
553
cpl_msg_error (er_func, "could not update the product header...");
578
587
/**********************************************************************/
580
/* int move_products (char * plugin_name, */
581
int move_products (cpl_frameset * frameset,
582
char * output_directory,
583
char * output_prefix,
584
char * link_directory,
585
int flag_noprefix, int flag_nolink, int flag_readonly)
590
_move_products (cpl_frameset * frameset,
591
char * output_directory,
592
char * output_prefix,
593
char * link_directory,
594
unsigned int signature_mask,
595
int flag_noprefix, int flag_nolink, int flag_readonly)
588
598
cpl_frame *frame = NULL; /* The current frame being processed */
1416
1430
/* Check if we don't want to cleanup after processing (for debugging) */
1418
p = cpl_parameterlist_find (caller_parameters,PACKAGE_RESOURCE ".unload-plugin");
1419
f_val_unload_plugin = cpl_parameter_get_bool (p);
1420
/* printf("f_val_unload_plugin = %d\n",f_val_unload_plugin); */
1432
p = cpl_parameterlist_find(caller_parameters, PACKAGE_RESOURCE ".unload-plugin");
1433
f_val_unload_plugin = cpl_parameter_get_bool(p);
1437
* Set product signature bit mask
1440
p = cpl_parameterlist_find(caller_parameters, PACKAGE_RESOURCE ".no-checksum");
1442
if (cpl_parameter_get_bool(p) == TRUE) {
1443
signature_mask &= ~CPL_DFS_SIGNATURE_CHECKSUM;
1446
p = cpl_parameterlist_find(caller_parameters, PACKAGE_RESOURCE ".no-datamd5");
1448
if (cpl_parameter_get_bool(p) == TRUE) {
1449
signature_mask &= ~CPL_DFS_SIGNATURE_DATAMD5;
1427
1457
if (e_code == 0)
1429
plugin_func_exec = cpl_plugin_get_exec ((cpl_plugin *) trecipe);
1431
if (plugin_func_exec != NULL)
1432
{ /* We have a pointer, so run the plugin */
1433
const char *recipe_name;
1435
recipe_name = cpl_plugin_get_name ((cpl_plugin *) trecipe);
1436
cpl_msg_set_domain (recipe_name);
1437
e_code = plugin_func_exec ((cpl_plugin *) trecipe);
1438
cpl_msg_set_domain (PACKAGE);
1441
cpl_msg_error (er_func,"Execution of recipe '%s' failed, status = %d",
1442
recipe_name,e_code);
1445
else /* NULL-pointer, so we simply set an error */
1446
e_code = CPL_ERROR_INCOMPATIBLE_INPUT;
1459
plugin_func_exec = cpl_plugin_get_exec ((cpl_plugin *) trecipe);
1461
if (plugin_func_exec != NULL)
1462
{ /* We have a pointer, so run the plugin */
1463
const char *recipe_name;
1465
recipe_name = cpl_plugin_get_name ((cpl_plugin *) trecipe);
1466
cpl_msg_set_domain (recipe_name);
1467
e_code = plugin_func_exec ((cpl_plugin *) trecipe);
1468
cpl_msg_set_domain (PACKAGE);
1471
cpl_msg_error (er_func,"Execution of recipe '%s' failed, status = %d",
1472
recipe_name,e_code);
1477
/* NULL-pointer, so we simply set an error */
1478
e_code = CPL_ERROR_INCOMPATIBLE_INPUT;
1449
1482
if (e_code == 0) /* successful execution of recipe */
1478
1511
/* Move all product files to output directory */
1480
e_code = move_products (trecipe->frames, (char *)val_output_dir,
1481
(char *)val_output_mask,
1482
(char *)val_link_dir, flag_noprefix,
1483
flag_nolink, flag_readonly);
1513
e_code = _move_products(trecipe->frames, (char *)val_output_dir,
1514
(char *)val_output_mask, (char *)val_link_dir,
1516
flag_noprefix, flag_nolink, flag_readonly);
1485
1518
if (e_code != 0) cpl_msg_error (er_func,
1486
1519
"An error occurred while trying to move the output products");
1489
1522
else /* recipe failed, only get correct MD5 sum */
1490
{ /* for all product files created anyway */
1491
if (e_code != -99999) ii = upda_products (trecipe->frames);
1523
{ /* for all product files created anyway */
1524
if (e_code != -99999)
1526
ii = _upda_products (trecipe->frames, signature_mask);
1494
1530
/* Run PAF creation */
1495
1531
p = cpl_parameterlist_find (caller_parameters,