New option -md5, new -as mkisofs option --md5

This commit is contained in:
2009-08-10 19:37:47 +00:00
parent 1c3c8fa869
commit 6b1dac2161
5 changed files with 62 additions and 7 deletions

View File

@ -5265,6 +5265,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->ino_behavior= 7;
m->do_joliet= 0;
m->do_aaip= 0;
m->do_md5= 0;
m->relax_compliance= 0;
m->do_follow_pattern= 1;
m->do_follow_param= 0;
@ -7664,6 +7665,11 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((xorriso->do_md5 & (1 | 2 | 4)) == 0);
sprintf(line,"-md5 %s\n", (xorriso->do_md5 & 1 ? "on" : "off"));
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (Xorriso_get_relax_text(xorriso, sfe, 0) == 2);
sprintf(line,"-compliance %s\n", sfe);
if(!(is_default && no_defaults))
@ -11226,6 +11232,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
" --hardlinks Record eventual hard link relations of files",
" --acl Record eventual ACLs of files",
" --xattr Record eventual user space xattr of files",
" --md5 Compute and record MD5 checksums of data files",
" -V ID, -volid ID Set Volume ID",
" -b FILE, -eltorito-boot FILE",
" Set El Torito boot image name",
@ -11387,6 +11394,8 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
Xorriso_option_acl(xorriso, "on", 0);
} else if(strcmp(argv[i], "--xattr")==0) {
Xorriso_option_xattr(xorriso, "on", 0);
} else if(strcmp(argv[i], "--md5")==0) {
Xorriso_option_md5(xorriso, "on", 0);
} else if(strcmp(argv[i], "-z")==0 ||
strcmp(argv[i], "-transparent-compression")==0) {
Xorriso_option_zisofs(xorriso, "by_magic=on", 0);
@ -11600,6 +11609,8 @@ not_enough_args:;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--xattr")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--md5")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-z")==0 ||
strcmp(argv[i], "-transparent-compression")==0) {
/* was already handled in first argument scan */;
@ -15840,6 +15851,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -disk_dev_ino \"on\"|\"ino_only\"|\"off\"",
" Enable resp. disable recording of disk file dev_t and ino_t",
" and their use in file comparison.",
" -md5 \"on\"|\"off\"",
" Enable resp. disable processing of MD5 checksums.",
" -ban_stdio_write",
" Allow for writing only the usage of optical drives.",
" -blank \"fast\"|\"all\"|\"deformat\"|\"deformat_quickest\"",
@ -16885,6 +16898,22 @@ int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag)
}
/* Option -md5 "on"|"off" */
int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag)
{
if(strcmp(mode, "off")==0)
xorriso->do_md5&= ~7;
else if(strcmp(mode, "on")==0)
xorriso->do_md5|= (1 | 2 | 4);
else {
sprintf(xorriso->info_text, "-md5: unknown mode '%s'", mode);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
return(1);
}
/* Option -mkdir alias -mkdiri */
int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
@ -19014,7 +19043,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"dev","dialog","disk_dev_ino","disk_pattern","dummy","eject",
"iso_rr_pattern","follow","format","fs","gid","grow_blindly","hardlinks",
"history","indev","in_charset","joliet","list_delimiter","local_charset",
"mark","not_leaf","not_list","not_mgt",
"mark","md5","not_leaf","not_list","not_mgt",
"options_from_file","osirrox","outdev","out_charset","overwrite",
"pacifier","padding","path_list","pathspecs","pkt_output","print","prompt",
"prog","prog_help","publisher","quoted_not_list","quoted_path_list",
@ -19518,6 +19547,10 @@ next_command:;
(*idx)++;
ret= Xorriso_option_mark(xorriso, arg1, 0);
} else if(strcmp(cmd, "md5")==0) {
(*idx)++;
ret= Xorriso_option_md5(xorriso, arg1, 0);
} else if(strcmp(cmd, "mount") == 0 || strcmp(cmd, "mount_cmd") == 0) {
(*idx)+= 4;
if((*idx)>argc) {