From d5dd6c96cdd85db45d54f684dbaeeddf9b0d1f7e Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 3 Mar 2012 18:29:01 +0000 Subject: [PATCH] New command -changes_pending --- libisoburn/libisoburn.ver | 1 + xorriso/opts_a_c.c | 30 +++++++++ xorriso/opts_d_h.c | 6 +- xorriso/parse_exec.c | 9 ++- xorriso/xorriso.1 | 20 +++++- xorriso/xorriso.h | 4 ++ xorriso/xorriso.info | 126 ++++++++++++++++++++---------------- xorriso/xorriso.texi | 22 ++++++- xorriso/xorriso_timestamp.h | 2 +- 9 files changed, 160 insertions(+), 60 deletions(-) diff --git a/libisoburn/libisoburn.ver b/libisoburn/libisoburn.ver index 5da4eea1..09a693ab 100644 --- a/libisoburn/libisoburn.ver +++ b/libisoburn/libisoburn.ver @@ -136,6 +136,7 @@ Xorriso_option_boot_image; Xorriso_option_calm_drive; Xorriso_option_cdi; Xorriso_option_cdx; +Xorriso_option_changes_pending; Xorriso_option_charset; Xorriso_option_check_md5; Xorriso_option_check_media; diff --git a/xorriso/opts_a_c.c b/xorriso/opts_a_c.c index c6b6e1b4..50c58b5d 100644 --- a/xorriso/opts_a_c.c +++ b/xorriso/opts_a_c.c @@ -1199,6 +1199,36 @@ ex:; } +/* Option -changes_pending */ +int Xorriso_option_changes_pending(struct XorrisO *xorriso, char *state, + int flag) +{ + if(strcmp(state, "no") == 0) + xorriso->volset_change_pending= 0; + else if(strcmp(state, "yes") == 0) + xorriso->volset_change_pending= 1; + else if(strcmp(state, "mkisofs_printed") == 0) + xorriso->volset_change_pending= 2; + else if(strcmp(state, "show_status") == 0) { + strcpy(xorriso->result_line, "-changes_pending "); + if(xorriso->volset_change_pending == 0) + strcat(xorriso->result_line, "no"); + else if(xorriso->volset_change_pending == 2) + strcat(xorriso->result_line, "mkisofs_printed"); + else + strcat(xorriso->result_line, "yes"); + strcat(xorriso->result_line, "\n"); + Xorriso_result(xorriso,0); + } else { + sprintf(xorriso->info_text, "-changes_pending: unknown state code '%s'", + state); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + return(0); + } + return(1); +} + + /* Option -charset */ /* @param flag bit0= set in_charset bit1= set out_charset diff --git a/xorriso/opts_d_h.c b/xorriso/opts_d_h.c index 20638be0..de3e068c 100644 --- a/xorriso/opts_d_h.c +++ b/xorriso/opts_d_h.c @@ -1763,7 +1763,11 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag) "Write-to-media options:", " -rollback Discard the manipulated ISO image and reload it.", "", -" -commit Perform the write operation and then perform -dev outdrive.", +" -changes_pending \"no\"|\"yes\"|\"mkisofs_printed\"|\"show_status\"", +" Override the automatically determined change status of the", +" loaded image, or show the current status.", +" -commit Perform the write operation if changes are pending.", +" Then perform -dev outdrive.", " Hint: To perform a final write operation with no new -dev", " and no new loading of image, execute option -end.", " -commit_eject \"in\"|\"out\"|\"all\"|\"none\"", diff --git a/xorriso/parse_exec.c b/xorriso/parse_exec.c index 90d16fd1..22d6b1a5 100644 --- a/xorriso/parse_exec.c +++ b/xorriso/parse_exec.c @@ -460,7 +460,8 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv, "abort_on","acl","add_plainly","application_id","auto_charset", "abstract_file", "backslash_codes","blank","biblio_file", - "calm_drive","cd","cdi","cdx","charset","close","close_damaged", + "calm_drive","cd","cdi","cdx","changes_pending","charset", + "close","close_damaged", "commit_eject","compliance","copyright_file", "dev","dialog","disk_dev_ino","disk_pattern","displacement", "dummy","dvd_obs","early_stdio_test", "eject", @@ -682,7 +683,7 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso, "* Writing the result, drive control:", "format", "blank", "close_damaged", - "rollback", "commit", "commit_eject", + "rollback", "changes_pending", "commit", "commit_eject", "eject", "* Evaluation of readability and recovery:", @@ -1008,6 +1009,10 @@ next_command:; (*idx)++; ret= Xorriso_option_cdx(xorriso, arg1, 0); + } else if(strcmp(cmd, "changes_pending")==0) { + (*idx)++; + ret= Xorriso_option_changes_pending(xorriso, arg1, 0); + } else if(strcmp(cmd,"charset")==0) { (*idx)++; ret= Xorriso_option_charset(xorriso, arg1, 3); diff --git a/xorriso/xorriso.1 b/xorriso/xorriso.1 index accdf1b5..69cef6df 100644 --- a/xorriso/xorriso.1 +++ b/xorriso/xorriso.1 @@ -9,7 +9,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH XORRISO 1 "Version 1.2.1, Feb 02, 2012" +.TH XORRISO 1 "Version 1.2.1, Feb 03, 2012" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -1980,6 +1980,24 @@ Like \-set_filter but affecting all data files below eventual directories. Discard the manipulated ISO image and reload it from \-indev. (Use \-rollback_end if immediate program end is desired.) .TP +\fB\-changes_pending\fR "no"|"yes"|"mkisofs_printed"|"show_status" +Write runs are performed only if a change of the image has been made +since the image was loaded or created blank. Vice versa the program will +start a write run for pending changes when it ends normally (i.e. not by abort +and not by command \-rollback_end). +.br +The command \-changes_pending can be used to override the automatically +determined state. This is mainly useful for setting state "yes" despite +no real changes were made. The sequence \-changes_pending "no" \-end +is equivalent to the command \-rollback_end. State "mkisofs_printed" +is caused by emulation command \-as mkisofs if option \-print\-size is present. +.br +The pseudo\-state "show_status" can be used to print the current state to result +channel. +.br +Image loading or manipulations which happen after this command will again +update automatically the change status of the image. +.TP \fB\-commit\fR Perform the write operation. Afterwards, if \-outdev is readable, make it the new \-dev and load the image from there. diff --git a/xorriso/xorriso.h b/xorriso/xorriso.h index 9773e913..d6555dc6 100644 --- a/xorriso/xorriso.h +++ b/xorriso/xorriso.h @@ -700,6 +700,10 @@ int Xorriso_option_cdi(struct XorrisO *xorriso, char *iso_rr_path, int flag); /* Option -cdx */ int Xorriso_option_cdx(struct XorrisO *xorriso, char *disk_path, int flag); +/* Option -changes_pending */ +int Xorriso_option_changes_pending(struct XorrisO *xorriso, char *state, + int flag); + /* Option -charset */ /* @param flag bit0= set in_charset bit1= set out_charset diff --git a/xorriso/xorriso.info b/xorriso/xorriso.info index 70f04702..2194fc7c 100644 --- a/xorriso/xorriso.info +++ b/xorriso/xorriso.info @@ -1774,6 +1774,22 @@ File: xorriso.info, Node: Writing, Next: SetWrite, Prev: Filter, Up: Options Discard the manipulated ISO image and reload it from -indev. (Use -rollback_end if immediate program end is desired.) +-changes_pending "no"|"yes"|"mkisofs_printed"|"show_status" + Write runs are performed only if a change of the image has been + made since the image was loaded or created blank. Vice versa the + program will start a write run for pending changes when it ends + normally (i.e. not by abort and not by command -rollback_end). + The command -changes_pending can be used to override the + automatically determined state. This is mainly useful for setting + state "yes" despite no real changes were made. The sequence + -changes_pending "no" -end is equivalent to the command + -rollback_end. State "mkisofs_printed" is caused by emulation + command -as mkisofs if option -print-size is present. + The pseudo-state "show_status" can be used to print the current + state to result channel. + Image loading or manipulations which happen after this command + will again update automatically the change status of the image. + -commit Perform the write operation. Afterwards, if -outdev is readable, make it the new -dev and load the image from there. Switch to @@ -4308,11 +4324,12 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -backslash_codes enables backslash conversion: Scripting. (line 67) * -ban_stdio_write demands real drive: Loading. (line 246) * -biblio_file sets biblio file name: SetWrite. (line 171) -* -blank erases media: Writing. (line 45) +* -blank erases media: Writing. (line 61) * -boot_image controls bootability: Bootable. (line 26) * -calm_drive reduces drive activity: Loading. (line 235) * -cd sets working directory in ISO: Navigate. (line 7) * -cdx sets working directory on disk: Navigate. (line 16) +* -changes_pending overrides change status: Writing. (line 13) * -charset sets input/output character set: Charset. (line 43) * -check_md5 verifies file checksum: Verify. (line 147) * -check_md5_r verifies file tree checksums: Verify. (line 163) @@ -4326,10 +4343,10 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -chown_r sets ownership in ISO image: Manip. (line 47) * -clone copies ISO directory tree: Insert. (line 171) * -close controls media closing: SetWrite. (line 266) -* -close_damaged closes damaged track and session: Writing. (line 136) +* -close_damaged closes damaged track and session: Writing. (line 152) * -close_filter_list bans filter registration: Filter. (line 52) -* -commit writes pending ISO image: Writing. (line 13) -* -commit_eject writes and ejects: Writing. (line 40) +* -commit writes pending ISO image: Writing. (line 29) +* -commit_eject writes and ejects: Writing. (line 56) * -compare reports ISO/disk differences: Navigate. (line 146) * -compare_l reports ISO/disk differences: Navigate. (line 164) * -compare_r reports ISO/disk differences: Navigate. (line 159) @@ -4357,7 +4374,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -dux show directory size on disk: Navigate. (line 97) * -dvd_obs set write block size: SetWrite. (line 242) * -early_stdio_test classifies stdio drives: Loading. (line 251) -* -eject ejects drive tray: Writing. (line 36) +* -eject ejects drive tray: Writing. (line 52) * -end writes pending session and ends program: Scripting. (line 156) * -errfile_log logs problematic disk files: Scripting. (line 118) * -error_behavior controls error workarounds: Exception. (line 96) @@ -4372,7 +4389,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -findx traverses disk tree: Navigate. (line 106) * -follow softlinks and mount points: SetInsert. (line 76) * -for_backup -acl,-xattr,-hardlinks,-md5: Loading. (line 184) -* -format formats media: Writing. (line 72) +* -format formats media: Writing. (line 88) * -fs sets size of fifo: SetWrite. (line 259) * -getfacl shows ACL in ISO image: Navigate. (line 70) * -getfacl_r shows ACL in ISO image: Navigate. (line 77) @@ -4393,9 +4410,9 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -list_delimiter replaces '--': Scripting. (line 60) * -list_extras lists compile time extra features: Scripting. (line 26) -* -list_formats lists available formats: Writing. (line 110) -* -list_profiles lists supported media: Writing. (line 150) -* -list_speeds lists available write speeds: Writing. (line 122) +* -list_formats lists available formats: Writing. (line 126) +* -list_profiles lists supported media: Writing. (line 166) +* -list_speeds lists available write speeds: Writing. (line 138) * -load addresses a particular session as input: Loading. (line 11) * -local_charset sets terminal character set: Charset. (line 47) * -logfile logs output channels to file: Frontend. (line 20) @@ -4539,7 +4556,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Create, new ISO image, _definiton: Methods. (line 6) * Cylinder alignment, _definiton: Bootable. (line 167) * Cylinder size, _definiton: Bootable. (line 156) -* Damaged track and session, close, -close_damaged: Writing. (line 136) +* Damaged track and session, close, -close_damaged: Writing. (line 152) * Delete, from ISO image, -rm: Manip. (line 21) * Delete, from ISO image, -rm_r: Manip. (line 28) * Delete, ISO directory, -rmdir: Manip. (line 32) @@ -4557,16 +4574,16 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Drive, accessability, -drive_class: Loading. (line 53) * Drive, classify stdio, -early_stdio_test: Loading. (line 251) * Drive, demand real MMC, -ban_stdio_write: Loading. (line 246) -* Drive, eject tray, -eject: Writing. (line 36) +* Drive, eject tray, -eject: Writing. (line 52) * Drive, for input and output, -dev: AqDrive. (line 12) * Drive, for input, -indev: AqDrive. (line 24) * Drive, for output, -outdev: AqDrive. (line 31) * Drive, get drive list, -device_links: Inquiry. (line 18) * Drive, get drive list, -devices: Inquiry. (line 7) -* Drive, list supported media, -list_profiles: Writing. (line 150) +* Drive, list supported media, -list_profiles: Writing. (line 166) * Drive, reduce activity, -calm_drive: Loading. (line 235) * Drive, report SCSI commands, -scsi_log: Scripting. (line 147) -* Drive, write and eject, -commit_eject: Writing. (line 40) +* Drive, write and eject, -commit_eject: Writing. (line 56) * EA, _definiton: Extras. (line 54) * El Torito, _definiton: Extras. (line 19) * Emulation, -as: Emulation. (line 13) @@ -4594,6 +4611,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Image, _definition: Model. (line 9) * Image, demand volume id, -assert_volid: Loading. (line 83) * Image, discard pending changes, -rollback: Writing. (line 9) +* Image, override change status, -changes_pending: Writing. (line 13) * Image, set abstract file name, -abstract_file: SetWrite. (line 164) * Image, set application id, -application_id: SetWrite. (line 123) * Image, set biblio file name, -biblio_file: SetWrite. (line 171) @@ -4634,10 +4652,10 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * MBR, _definiton: Extras. (line 26) * MBR, set, -boot_image system_area=: Bootable. (line 121) * MD5, control handling, -md5: Loading. (line 155) -* Media, erase, -blank: Writing. (line 45) -* Media, format, -format: Writing. (line 72) -* Media, list formats, -list_formats: Writing. (line 110) -* Media, list write speeds, -list_speeds: Writing. (line 122) +* Media, erase, -blank: Writing. (line 61) +* Media, format, -format: Writing. (line 88) +* Media, list formats, -list_formats: Writing. (line 126) +* Media, list write speeds, -list_speeds: Writing. (line 138) * MIPS boot file, activation: Bootable. (line 176) * mkisofs, Emulation: Emulation. (line 16) * Modifying, _definition: Methods. (line 27) @@ -4752,7 +4770,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Write, log problematic disk files, -errfile_log: Scripting. (line 118) * Write, log written sessions, -session_log: Scripting. (line 138) * Write, padding image, -padding: SetWrite. (line 272) -* Write, pending ISO image, -commit: Writing. (line 13) +* Write, pending ISO image, -commit: Writing. (line 29) * Write, predict image size, -print_size: Inquiry. (line 80) * Write, set speed, -speed: SetWrite. (line 215) * Write, simulation, -dummy: SetWrite. (line 255) @@ -4786,41 +4804,41 @@ Node: Manip62358 Node: CmdFind71091 Node: Filter83198 Node: Writing87536 -Node: SetWrite95537 -Node: Bootable109842 -Node: Jigdo123063 -Node: Charset127309 -Node: Exception130068 -Node: DialogCtl136181 -Node: Inquiry138776 -Node: Navigate143639 -Node: Verify151899 -Node: Restore160566 -Node: Emulation167472 -Node: Scripting177271 -Node: Frontend184423 -Node: Examples185723 -Node: ExDevices186900 -Node: ExCreate187559 -Node: ExDialog188842 -Node: ExGrowing190105 -Node: ExModifying190910 -Node: ExBootable191413 -Node: ExCharset191965 -Node: ExPseudo192785 -Node: ExCdrecord193683 -Node: ExMkisofs194000 -Node: ExGrowisofs195340 -Node: ExException196475 -Node: ExTime196929 -Node: ExIncBackup197388 -Node: ExRestore201374 -Node: ExRecovery202334 -Node: Files202904 -Node: Seealso204202 -Node: Bugreport204925 -Node: Legal205506 -Node: CommandIdx206436 -Node: ConceptIdx221678 +Node: SetWrite96495 +Node: Bootable110800 +Node: Jigdo124021 +Node: Charset128267 +Node: Exception131026 +Node: DialogCtl137139 +Node: Inquiry139734 +Node: Navigate144597 +Node: Verify152857 +Node: Restore161524 +Node: Emulation168430 +Node: Scripting178229 +Node: Frontend185381 +Node: Examples186681 +Node: ExDevices187858 +Node: ExCreate188517 +Node: ExDialog189800 +Node: ExGrowing191063 +Node: ExModifying191868 +Node: ExBootable192371 +Node: ExCharset192923 +Node: ExPseudo193743 +Node: ExCdrecord194641 +Node: ExMkisofs194958 +Node: ExGrowisofs196298 +Node: ExException197433 +Node: ExTime197887 +Node: ExIncBackup198346 +Node: ExRestore202332 +Node: ExRecovery203292 +Node: Files203862 +Node: Seealso205160 +Node: Bugreport205883 +Node: Legal206464 +Node: CommandIdx207394 +Node: ConceptIdx222709  End Tag Table diff --git a/xorriso/xorriso.texi b/xorriso/xorriso.texi index 3cb8d27c..fd699d11 100644 --- a/xorriso/xorriso.texi +++ b/xorriso/xorriso.texi @@ -50,7 +50,7 @@ @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) -@c man .TH XORRISO 1 "Version 1.2.1, Feb 02, 2012" +@c man .TH XORRISO 1 "Version 1.2.1, Feb 03, 2012" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @@ -2390,6 +2390,26 @@ Like -set_filter but affecting all data files below eventual directories. Discard the manipulated ISO image and reload it from -indev. (Use -rollback_end if immediate program end is desired.) @c man .TP +@item -changes_pending "no"|"yes"|"mkisofs_printed"|"show_status" +@kindex -changes_pending overrides change status +@cindex Image, override change status, -changes_pending +Write runs are performed only if a change of the image has been made +since the image was loaded or created blank. Vice versa the program will +start a write run for pending changes when it ends normally (i.e. not by abort +and not by command -rollback_end). +@* +The command -changes_pending can be used to override the automatically +determined state. This is mainly useful for setting state "yes" despite +no real changes were made. The sequence -changes_pending "no" -end +is equivalent to the command -rollback_end. State "mkisofs_printed" +is caused by emulation command -as mkisofs if option -print-size is present. +@* +The pseudo-state "show_status" can be used to print the current state to result +channel. +@* +Image loading or manipulations which happen after this command will again +update automatically the change status of the image. +@c man .TP @item -commit @kindex -commit writes pending ISO image @cindex Write, pending ISO image, -commit diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 0ed0a2c3..e5e6558f 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2012.03.03.134008" +#define Xorriso_timestamP "2012.03.03.182917"