New -as mkisofs options -hide, -hide-joliet, -hide-list, -hide-joliet-list
This commit is contained in:
@ -811,7 +811,10 @@ int Xorriso_option_no_rc(struct XorrisO *xorriso, int flag)
|
||||
}
|
||||
|
||||
|
||||
/* Option -not_leaf */
|
||||
/* Option -not_leaf , (-hide_disk_leaf resp. -as mkisofs -hide) */
|
||||
/* @param flag bit0= add to iso_rr_hidings rather than disk_exclusions
|
||||
bit1= add to joliet_hidings rather than disk_exclusions
|
||||
*/
|
||||
int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag)
|
||||
{
|
||||
regex_t re;
|
||||
@ -823,10 +826,24 @@ int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag)
|
||||
Xorriso__bourne_to_reg(pattern, regexpr, 0);
|
||||
if(regcomp(&re, regexpr, 0)!=0)
|
||||
{ret= 0; goto cannot_add;}
|
||||
ret= Exclusions_add_not_leafs(xorriso->disk_exclusions, pattern, &re, 0);
|
||||
if(flag & 3) {
|
||||
if(flag & 1) {
|
||||
ret= Exclusions_add_not_leafs(xorriso->iso_rr_hidings, pattern, &re, 0);
|
||||
if(ret<=0)
|
||||
goto cannot_add;
|
||||
}
|
||||
if(flag & 2) {
|
||||
ret= Exclusions_add_not_leafs(xorriso->joliet_hidings, pattern, &re, 0);
|
||||
if(ret<=0)
|
||||
goto cannot_add;
|
||||
}
|
||||
} else {
|
||||
ret= Exclusions_add_not_leafs(xorriso->disk_exclusions, pattern, &re, 0);
|
||||
}
|
||||
if(ret<=0) {
|
||||
cannot_add:;
|
||||
sprintf(xorriso->info_text,"Cannot add pattern: -not_leaf %s",
|
||||
sprintf(xorriso->info_text,"Cannot add pattern: %s %s",
|
||||
(flag & 3) ? "-hide_disk_leaf" : "-not_leaf",
|
||||
Text_shellsafe(pattern, sfe, 0));
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(ret);
|
||||
@ -945,7 +962,12 @@ int Xorriso_option_not_mgt(struct XorrisO *xorriso, char *setting, int flag)
|
||||
}
|
||||
|
||||
|
||||
/* Option -not_paths */
|
||||
/* Option -not_paths , (-hide_disk_paths resp. -as mkisofs -hide) */
|
||||
/* @param flag bit0= add to iso_rr_hidings rather than disk_exclusions
|
||||
bit1= add to joliet_hidings rather than disk_exclusions
|
||||
bit2= enable disk pattern expansion regardless of -disk_pattern
|
||||
|
||||
*/
|
||||
int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv,
|
||||
int *idx, int flag)
|
||||
{
|
||||
@ -954,7 +976,7 @@ int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv,
|
||||
|
||||
|
||||
end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx,
|
||||
(xorriso->do_disk_pattern==1) | 2);
|
||||
(xorriso->do_disk_pattern == 1 || (flag & 4)) | 2);
|
||||
if(end_idx<=0)
|
||||
return(end_idx);
|
||||
num_descr= end_idx - *idx;
|
||||
@ -980,17 +1002,41 @@ no_memory:;
|
||||
goto no_memory;
|
||||
}
|
||||
|
||||
ret= Xorriso_opt_args(xorriso, "-not_paths",
|
||||
num_descr, descr, 0, &dummy, &optc, &optv, 2);
|
||||
ret= Xorriso_opt_args(xorriso, (flag & 3) ? "-hide_disk_paths" : "-not_paths",
|
||||
num_descr, descr, 0, &dummy, &optc, &optv,
|
||||
2 | ((flag & 4) << 7));
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
ret= Exclusions_add_not_paths(xorriso->disk_exclusions,
|
||||
num_descr, descr, optc, optv, 0);
|
||||
if(ret<=0) {
|
||||
sprintf(xorriso->info_text,"Cannot add path list: -not_paths %s%s %s",
|
||||
Text_shellsafe(argv[*idx], sfe, 0), (num_descr>1 ? " ..." : ""),
|
||||
xorriso->list_delimiter);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
if(flag & 3) {
|
||||
if(flag & 1) {
|
||||
ret= Exclusions_add_not_paths(xorriso->iso_rr_hidings,
|
||||
num_descr, descr, optc, optv, 0);
|
||||
if(ret<=0) {
|
||||
no_hide:;
|
||||
sprintf(xorriso->info_text,
|
||||
"Cannot add path list: -hide_disk_paths %s %s%s %s",
|
||||
Xorriso__hide_mode_text(flag & 3, 0),
|
||||
Text_shellsafe(argv[*idx], sfe, 0), (num_descr>1 ? " ..." : ""),
|
||||
xorriso->list_delimiter);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
goto ex;
|
||||
}
|
||||
}
|
||||
if(flag & 2) {
|
||||
ret= Exclusions_add_not_paths(xorriso->joliet_hidings,
|
||||
num_descr, descr, optc, optv, 0);
|
||||
if(ret<=0)
|
||||
goto no_hide;
|
||||
}
|
||||
} else {
|
||||
ret= Exclusions_add_not_paths(xorriso->disk_exclusions,
|
||||
num_descr, descr, optc, optv, 0);
|
||||
if(ret<=0) {
|
||||
sprintf(xorriso->info_text,"Cannot add path list: -not_paths %s%s %s",
|
||||
Text_shellsafe(argv[*idx], sfe, 0), (num_descr>1 ? " ..." : ""),
|
||||
xorriso->list_delimiter);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
}
|
||||
}
|
||||
ex:;
|
||||
(*idx)= end_idx;
|
||||
|
Reference in New Issue
Block a user