New options -map and -map_single

This commit is contained in:
Thomas Schmitt 2008-05-15 15:00:39 +00:00
parent c66cfdf72c
commit 74da4d1749
6 changed files with 130 additions and 60 deletions

View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "May, 13, 2008" .TH XORRISO 1 "May, 15, 2008"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -166,10 +166,10 @@ capabilities.
suitable for xorriso. suitable for xorriso.
.br .br
Blank is the state of newly purchased optical media. Blank is the state of newly purchased optical media.
With used CD-RW and DVD-RW it can be achieved by action -blank "fast". With used CD-RW and DVD-RW it can be achieved by action -blank "as_needed".
Overwriteable media are considered blank unless they contain an ISO image Overwriteable media are considered blank unless they contain an ISO image
suitable for xorriso. Action -blank "fast" can be used to invalidate the image suitable for xorriso. Action -blank "as_needed" can be used to invalidate the
on overwriteable media. image on overwriteable media, or to apply eventual mandatory formatting.
.br .br
\fBAppendable\fR media accept further sessions. Either they are MMC \fBAppendable\fR media accept further sessions. Either they are MMC
multi-session media in appendable state, or they are overwriteable media multi-session media in appendable state, or they are overwriteable media
@ -599,22 +599,12 @@ Like -add but read the parameter words from file disk_path
or standard input if disk_path is "-". or standard input if disk_path is "-".
The list must contain exactly one pathspec resp. disk_path pattern per line. The list must contain exactly one pathspec resp. disk_path pattern per line.
.TP .TP
\fB\-cpr\fR disk_path [***] iso_rr_path \fB\-map\fR disk_path iso_rr_path
Insert the given files or directory trees from filesystem Insert file object disk_path into the ISO image as iso_rr_path. If disk_path
into the ISO image. is a directory then its whole sub tree is inserted into the ISO image.
.br .TP
The rules for generating the ISO addresses are similar as with \fB\-map_single\fR disk_path iso_rr_path
shell command cp -r. Nevertheless, directories of the iso_rr_path Like -map, but if disk_path is a directory then its sub tree is not inserted.
are created if necessary. Especially a not yet existing iso_rr_path
will be handled as directory if multiple disk_paths are present.
The leafnames of the multiple disk_paths will be grafted under that
directory as would be done with an existing directory.
.br
If a single disk_path is present then a non-existing iso_rr_path will
get the same type as the disk_path.
.br
If a disk_path does not begin with '/' then -cdx is prepended.
If the iso_rr_path does not begin with '/' then -cd is prepended.
.TP .TP
\fB\-update\fR disk_path iso_rr_path \fB\-update\fR disk_path iso_rr_path
Compare file object disk_path with file object iso_rr_path. If they do not Compare file object disk_path with file object iso_rr_path. If they do not
@ -623,6 +613,10 @@ a matching copy of disk_path. This comparison will imply lengthy content
reading before a decision is made. On the other hand it strives for the reading before a decision is made. On the other hand it strives for the
smallest possible amount of add-on data which is needed to achieve the smallest possible amount of add-on data which is needed to achieve the
matching copy. matching copy.
.br
If disk_path is a directory and iso_rr_path does not exist yet, then the
whole subtree will be inserted. Else only directory attributes will be
updated.
.TP .TP
\fB\-update_r\fR disk_path iso_rr_path \fB\-update_r\fR disk_path iso_rr_path
Like -update but working recursively. I.e. all file objects below both Like -update but working recursively. I.e. all file objects below both
@ -692,6 +686,23 @@ to the directory if it already contains all parts of the old disk file.
If not all parts are present, then only those present parts will If not all parts are present, then only those present parts will
be updated. be updated.
.TP .TP
\fB\-cpr\fR disk_path [***] iso_rr_path
Insert the given files or directory trees from filesystem
into the ISO image.
.br
The rules for generating the ISO addresses are similar as with
shell command cp -r. Nevertheless, directories of the iso_rr_path
are created if necessary. Especially a not yet existing iso_rr_path
will be handled as directory if multiple disk_paths are present.
The leafnames of the multiple disk_paths will be grafted under that
directory as would be done with an existing directory.
.br
If a single disk_path is present then a non-existing iso_rr_path will
get the same type as the disk_path.
.br
If a disk_path does not begin with '/' then -cdx is prepended.
If the iso_rr_path does not begin with '/' then -cd is prepended.
.TP
\fB\-rm\fR iso_rr_path [***] \fB\-rm\fR iso_rr_path [***]
Delete the given files from the ISO image. Delete the given files from the ISO image.
.br .br
@ -1427,7 +1438,7 @@ who is able to see all drives.
.br .br
Drives which are occupied by other processes get not shown. Drives which are occupied by other processes get not shown.
.TP .TP
\fB\-print-size\fR \fB\-print_size\fR
Print the foreseeable consumption of 2048 byte blocks Print the foreseeable consumption of 2048 byte blocks
by next -commit. This can last a while as a -commit gets by next -commit. This can last a while as a -commit gets
prepared and only in last moment is revoked by this option. prepared and only in last moment is revoked by this option.
@ -1820,19 +1831,15 @@ Re-add some wanted stuff.
Because no -dialog "on" is given, the program will then end by committing the Because no -dialog "on" is given, the program will then end by committing the
session to media. session to media.
.br .br
\fB$\fR cd /home/me
.br
\fB$\fR xorriso -outdev /dev/sr2 \\ \fB$\fR xorriso -outdev /dev/sr2 \\
.br .br
-blank fast \\ -blank as_needed \\
.br .br
-pathspecs on \\ -map /home/me/sounds /sounds \\
.br .br
-add \\ -map /home/me/pictures /pictures \\
.br
/sounds=/home/me/sounds \\
.br
/pictures \\
.br
-- \\
.br .br
-rm_r \\ -rm_r \\
.br .br
@ -1844,12 +1851,12 @@ session to media.
.br .br
-- \\ -- \\
.br .br
-add \\ -cd / \\
.br .br
/pictures/confidential/work* -add pictures/confidential/work*
.br .br
Note that '/pictures/*private*' is a pattern for iso_rr_paths Note that '/pictures/*private*' is a pattern for iso_rr_paths
while /pictures/confidential/work* gets expanded by the shell while pictures/confidential/work* gets expanded by the shell
with addresses from the hard disk. with addresses from the hard disk.
.SS .SS
.B A dialog session doing about the same .B A dialog session doing about the same
@ -1864,7 +1871,7 @@ made ready for being overwritten and the loaded ISO image is made empty.
In order to be able to eject the media, the session needs to be committed In order to be able to eject the media, the session needs to be committed
explicitely. explicitely.
.br .br
.B $ xorriso -pathspecs on -dialog on -page 20 80 .B $ xorriso -dialog on -page 20 80 -disk_pattern on
.br .br
enter option and arguments : enter option and arguments :
.br .br
@ -1872,11 +1879,11 @@ enter option and arguments :
.br .br
enter option and arguments : enter option and arguments :
.br .br
.B \-blank fast .B \-blank as_needed
.br .br
enter option and arguments : enter option and arguments :
.br .br
.B \-add /sounds=/home/me/sounds /pictures .B \-map /home/me/sounds /sounds -map /home/me/pictures /pictures
.br .br
enter option and arguments : enter option and arguments :
.br .br
@ -1884,7 +1891,11 @@ enter option and arguments :
.br .br
enter option and arguments : enter option and arguments :
.br .br
.B \-add /pictures/confidential/office /pictures/confidential/factory .B \-cdx /home/me/pictures -cd /pictures
.br
enter option and arguments :
.br
.B \-add confidential/office confidential/factory
.br .br
enter option and arguments : enter option and arguments :
.br .br
@ -1916,15 +1927,9 @@ Add new directory trees /sounds and /movies. Burn to the same media and eject.
.br .br
-chmod go-rwx /pictures/restricted -- \\ -chmod go-rwx /pictures/restricted -- \\
.br .br
-pathsspecs on \\ -map /home/me/prepared_for_dvd/sounds_dummy /sounds \\
.br .br
-add \\ -map /home/me/prepared_for_dvd/movies /movies \\
.br
/sounds=/home/me/prepared_for_dvd/sounds_dummy \\
.br
/movies=/home/me/prepared_for_dvd/movies \\
.br
-- \\
.br .br
-commit -eject all -commit -eject all
.SS .SS
@ -1939,7 +1944,7 @@ first and only session to the output drive.
.br .br
... ...
.br .br
-outdev /dev/sr0 -blank fast \\ -outdev /dev/sr0 -blank as_needed \\
.br .br
-commit -eject all -commit -eject all
.SS .SS
@ -2044,8 +2049,7 @@ With CD media, Linux mount accepts session numbers directly by its option
\fBDo not write more than about 50 sessions\fR to one multi-session media. \fBDo not write more than about 50 sessions\fR to one multi-session media.
Theoretical limits are higher but in practice the media deteriorate more early. Theoretical limits are higher but in practice the media deteriorate more early.
It might also be that your operating system has a session limit with mount. It might also be that your operating system has a session limit with mount.
Always have a blank media ready to perform a full backup in case the update An overview of sessions is given by option -toc.
attempt fails. An overview of sessions is given by option -toc.
.br .br
Sessions on multi-session media are separated by several MB of unused blocks. Sessions on multi-session media are separated by several MB of unused blocks.
So with small sessions the payload capacity can become substantially lower So with small sessions the payload capacity can become substantially lower
@ -2057,14 +2061,17 @@ automatically.
Have at least two media which you use alternatingly. So only older backups Have at least two media which you use alternatingly. So only older backups
get endangered by the new write operation, while the newest backup is get endangered by the new write operation, while the newest backup is
stored safely on a different media. stored safely on a different media.
Always have a blank media ready to perform a full backup in case the update
attempt fails due to insufficient remaining capacity.
.br .br
If you have enough re-useable media for a round-robin scheme then better do If you have enough re-useable media for a round-robin scheme then better do
full backups with blank media each time. Blanking can be achieved by full backups with blank media each time. Blanking can be achieved by
either a separate run: either a separate run:
.br .br
\fB$\fR xorriso -outdev /dev/sr0 -blank fast -eject all \fB$\fR xorriso -outdev /dev/sr0 -blank as_needed -eject all
.br .br
or in the update run by using option -blank "fast" before option -update_r. or in the update run by using option -blank "as_needed" before
option -update_r.
.br .br
.SH FILES .SH FILES
.SS .SS

View File

@ -9098,18 +9098,23 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -path_list disk_path", " -path_list disk_path",
" Like -add but read the pathspecs from file disk_path.", " Like -add but read the pathspecs from file disk_path.",
"", "",
" -map disk_path iso_rr_path",
" Insert disk file object at the given iso_rr_path.",
" -map_single disk_path iso_rr_path",
" Like -map but with directory do not insert its sub tree.",
" -update disk_path iso_rr_path", " -update disk_path iso_rr_path",
" Compare both file objects and do what is necessary to make", " Compare both file objects and do what is necessary to make",
" iso_rr_path a matching copy of disk_path.", " iso_rr_path a matching copy of disk_path.",
" -update_r disk_path iso_rr_path", " -update_r disk_path iso_rr_path",
" Like -update but affecting all files below directories.", " Like -update but affecting all files below directories.",
" -cpr disk_path [***] iso_rr_path",
" Insert the given files or directory trees from filesystem",
" into the ISO image.",
" -cut_out disk_path byte_offset byte_count iso_rr_path", " -cut_out disk_path byte_offset byte_count iso_rr_path",
" Map a byte interval of a regular disk file into a regular", " Map a byte interval of a regular disk file into a regular",
" file in the ISO image.", " file in the ISO image.",
"", "",
" -cpr disk_path [***] iso_rr_path",
" Insert the given files or directory trees from filesystem",
" into the ISO image, according to the rules of cp -r.",
"",
" -rm iso_rr_path [***]", " -rm iso_rr_path [***]",
" Delete the given files from the ISO image.", " Delete the given files from the ISO image.",
" -rm_r iso_rr_path [***]", " -rm_r iso_rr_path [***]",
@ -9688,6 +9693,45 @@ ex:;
} }
/* Option -map , -map_single */
/* @param flag bit0=do not report the added item
bit1=do not reset pacifier, no final pacifier message
bit5=eventually do not insert directory tree
*/
int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path,
char *iso_path, int flag)
{
int ret;
char eff_origin[SfileadrL], eff_dest[SfileadrL];
if(!(flag&2))
Xorriso_pacifier_reset(xorriso, 0);
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdx, disk_path, eff_origin,
2|4);
if(ret<=0)
return(ret);
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, iso_path, eff_dest,
2);
if(ret<=0)
return(ret);
ret= Xorriso_graft_in(xorriso, NULL, eff_origin, eff_dest,
(off_t) 0, (off_t) 0, 2|(flag&32));
if(!(flag&2))
Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count,
xorriso->pacifier_total, "", 1);
if(ret<=0)
return(ret);
if(!(flag&1)) {
sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n",
(ret>1 ? "directory" : "file"), eff_dest, eff_origin);
Xorriso_info(xorriso,0);
}
return(1);
}
/* Option -mark */ /* Option -mark */
int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag) int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag)
{ {
@ -11239,6 +11283,14 @@ next_command:;
} else if(strcmp(cmd,"lsx")==0 || strcmp(cmd,"lslx")==0) { } else if(strcmp(cmd,"lsx")==0 || strcmp(cmd,"lslx")==0) {
ret= Xorriso_option_lsx(xorriso, argc, argv, idx, (cmd[2]=='l')); ret= Xorriso_option_lsx(xorriso, argc, argv, idx, (cmd[2]=='l'));
} else if(strcmp(cmd,"map")==0) {
(*idx)+= 2;
ret= Xorriso_option_map(xorriso, arg1, arg2, 0);
} else if(strcmp(cmd,"map_single")==0) {
(*idx)+= 2;
ret= Xorriso_option_map(xorriso, arg1, arg2, 32);
} else if(strcmp(cmd,"mark")==0) { } else if(strcmp(cmd,"mark")==0) {
(*idx)++; (*idx)++;
ret= Xorriso_option_mark(xorriso, arg1, 0); ret= Xorriso_option_mark(xorriso, arg1, 0);

View File

@ -339,6 +339,13 @@ int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv,
int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv, int Xorriso_option_lsx(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag); int *idx, int flag);
/* Option -map */
/* @param flag bit0=do not report the added item
bit1=do not reset pacifier, no final pacifier message
*/
int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path,
char *iso_path, int flag);
/* Option -mark */ /* Option -mark */
int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag); int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag);

View File

@ -356,6 +356,7 @@ Bug fixes towards xorriso-0.1.2.pl00:
<DD>Enhancements towards stable version 0.1.4.pl00: <DD>Enhancements towards stable version 0.1.4.pl00:
<UL> <UL>
<LI>Support for BD-RE</LI> <LI>Support for BD-RE</LI>
<LI>New options -map and -map_single</LI>
<LI>New options -not_paths, -not_leaf, -not_list, -not_mgt, -as mkisofs -m</LI> <LI>New options -not_paths, -not_leaf, -not_list, -not_mgt, -as mkisofs -m</LI>
<LI>Emulated -toc on overwriteable media, new -toc layout with volume id</LI> <LI>Emulated -toc on overwriteable media, new -toc layout with volume id</LI>
<LI>New option -rom_toc_scan for read-only drive problems</LI> <LI>New option -rom_toc_scan for read-only drive problems</LI>
@ -380,7 +381,7 @@ installation see README)
</DD> </DD>
<DD> <DD>
<A HREF="xorriso-0.1.5.tar.gz">xorriso-0.1.5.tar.gz</A> <A HREF="xorriso-0.1.5.tar.gz">xorriso-0.1.5.tar.gz</A>
(970 KB). (980 KB).
</DD> </DD>
<DT>A dynamically linked development version of xorriso can be obtained <DT>A dynamically linked development version of xorriso can be obtained
from repositories of from repositories of

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.05.15.092028" #define Xorriso_timestamP "2008.05.15.150041"

View File

@ -1934,6 +1934,7 @@ int Xorriso_copy_properties(struct XorrisO *xorriso,
bit2= -follow, -not_*: this is not a command parameter bit2= -follow, -not_*: this is not a command parameter
bit3= use offset and cut_size for cut_out_node bit3= use offset and cut_size for cut_out_node
bit4= return 3 on rejection by exclusion or user bit4= return 3 on rejection by exclusion or user
bit5= if directory then do not add sub tree
@return <=0 = error , 1 = added simple node , 2 = added directory , @return <=0 = error , 1 = added simple node , 2 = added directory ,
3 = rejected 3 = rejected
*/ */
@ -2117,10 +2118,12 @@ attach_source:;
} else if(is_dir) { } else if(is_dir) {
Xorriso_transfer_properties(xorriso, &stbuf, (IsoNode *) dir, 0); Xorriso_transfer_properties(xorriso, &stbuf, (IsoNode *) dir, 0);
ret= Xorriso_add_tree(xorriso, dir, img_path, disk_path, NULL, flag&2); if(!(flag&32)) {
ret= Xorriso_add_tree(xorriso, dir, img_path, disk_path, NULL,
flag&2);
if(ret<=0) if(ret<=0)
return(ret); return(ret);
}
} else { } else {
if(resolve_link) { if(resolve_link) {
ret= Xorriso_resolve_link(xorriso, disk_path, resolved_disk_path, 0); ret= Xorriso_resolve_link(xorriso, disk_path, resolved_disk_path, 0);