New command -toc_info_type

This commit is contained in:
2024-06-28 16:42:28 +02:00
parent 2306175432
commit 7f1abc4174
14 changed files with 304 additions and 89 deletions

View File

@@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2022 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@@ -559,7 +559,8 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"session_log","setfattr_list","setfattr_listi",
"sh_style_result","signal_handling","sleep",
"speed","split_size","status","status_history_max",
"stdio_sync","stream_recording","system_id","temp_mem_limit","toc_of",
"stdio_sync","stream_recording","system_id","temp_mem_limit",
"toc_info_type", "toc_of",
"uid","unregister_filter","use_immed_bit","use_readline",
"volid","volset_id",
"write_type","xattr","zisofs",
@@ -709,7 +710,7 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"dev", "indev", "outdev",
"* Drive and media related inquiry actions (2):",
"list_profiles", "list_formats", "list_speeds",
"list_profiles", "list_formats", "list_speeds", "toc_info_type",
"toc", "toc_of", "pvd_info", "report_system_area", "report_el_torito",
"assess_indev_features",
@@ -1962,6 +1963,10 @@ if (0) {
} else if(strcmp(cmd,"toc")==0) {
Xorriso_option_toc(xorriso, 0);
} else if(strcmp(cmd,"toc_info_type")==0) {
(*idx)++;
Xorriso_option_toc_info_type(xorriso, arg1, 0);
} else if(strcmp(cmd,"toc_of")==0) {
(*idx)++;
Xorriso_option_toc_of(xorriso, arg1, 0);
@@ -2615,13 +2620,13 @@ ex:;
*/
int Xorriso_source_date_epoch(struct XorrisO *xorriso, int flag)
{
int ret;
/* num_text must be able to take the sprintf output of "%.f".
num_text + 12 must be able to take "%d" with a 64 bit int.
*/
char *sec_text, num_text[40];
double dsec= -1.0;
time_t tsec;
struct tm *gmt;
sec_text= getenv("SOURCE_DATE_EPOCH");
if(sec_text == NULL)
@@ -2641,17 +2646,10 @@ malformed:;
0, "HINT", 0);
return(0);
}
gmt= gmtime(&tsec);
if(gmt == NULL)
goto malformed;
sprintf(num_text, "%4.4d", 1900 + gmt->tm_year);
sprintf(num_text + 4, "%2.2d", gmt->tm_mon + 1);
sprintf(num_text + 6, "%2.2d", gmt->tm_mday);
sprintf(num_text + 8, "%2.2d", gmt->tm_hour);
sprintf(num_text + 10, "%2.2d", gmt->tm_min);
sprintf(num_text + 12, "%2.2d", gmt->tm_sec);
strcpy(num_text + 14, "00");
ret= Encode_ecma119_17byte(tsec, "00", num_text, 0);
if(ret <= 0)
goto malformed;
strcpy(xorriso->vol_uuid, num_text);
xorriso->gpt_guid_mode= 2; /* Disk GUID from vol_uuid */
strcpy(xorriso->all_file_dates, "set_to_mtime");