Changed option -J to -joliet "on"|"off", implemented option -volid

This commit is contained in:
Thomas Schmitt 2007-12-26 16:01:59 +00:00
parent 5f9a9e5954
commit a929ee2c0d
7 changed files with 93 additions and 49 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 "December 25, 2007" .TH XORRISO 1 "December 26, 2007"
.\" 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:
@ -328,8 +328,8 @@ Readline is an enhancement for the input line. You may know it already from
the bash shell. the bash shell.
.br .br
It allows to move the cursor over the text in the line by help of the It allows to move the cursor over the text in the line by help of the
leftward and the rightward arrow key. Leftward and the Rightward arrow key.
Text may be inserted at the cursor position. The delete key removes the Text may be inserted at the cursor position. The Delete key removes the
character under the cursor. Upward and Downward arrow keys navigate through character under the cursor. Upward and Downward arrow keys navigate through
the history of previous input lines. the history of previous input lines.
.br .br
@ -356,10 +356,6 @@ try to abort as soon as possible.
.br .br
.SH OPTIONS .SH OPTIONS
.br .br
Options marked with prefix '>' are not implemented yet.
.br
Options with prefix '?' are not tested yet.
.br
All command words are shown with a leading dash although this dash is not All command words are shown with a leading dash although this dash is not
mandatory for the option to be recognized. There may be future emulation mandatory for the option to be recognized. There may be future emulation
modes, where dashes may become mandatory in order to distinguish options modes, where dashes may become mandatory in order to distinguish options
@ -754,11 +750,13 @@ existing directory and all its subordinates.
.TP .TP
Rock Ridge info will be generated by the program unconditionally. Rock Ridge info will be generated by the program unconditionally.
.TP .TP
? \fB\-J\fR \fB\-joliet\fR "on"|"off"
Generate Joliet info additional to Rock Ridge info. If enabled by "on", generate Joliet info additional to Rock Ridge info.
.TP .TP
> \fB\-V\fR volid \fB\-volid\fR text
Specifies the volume ID. Specifies the volume ID. The text may be up to 32 characters long.
Be aware that it might get used automatically as name of the mount point
when the media is inserted into a playful computer system.
.TP .TP
\fB\-uid\fR uid \fB\-uid\fR uid
User id to be used for all files when the new ISO tree gets written to media. User id to be used for all files when the new ISO tree gets written to media.

View File

@ -3731,14 +3731,14 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->volid[0]==0); is_default= (xorriso->volid[0]==0);
sprintf(line,"-V %s\n",Text_shellsafe(xorriso->volid,sfe,0)); sprintf(line,"-volid %s\n",Text_shellsafe(xorriso->volid,sfe,0));
if(!(is_default && no_defaults)) if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
if(xorriso->do_joliet) { is_default= (xorriso->do_joliet==0);
sprintf(line,"-J\n"); sprintf(line,"-joliet %s\n", (xorriso->do_joliet == 1 ? "on" : "off"));
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
}
if(xorriso->do_global_uid) { if(xorriso->do_global_uid) {
sprintf(line,"-uid %lu\n", (unsigned long) xorriso->global_uid); sprintf(line,"-uid %lu\n", (unsigned long) xorriso->global_uid);
@ -5417,7 +5417,7 @@ ex:;
/* @param flag bit0= a non-existing target of multiple sources is a directory /* @param flag bit0= a non-existing target of multiple sources is a directory
bit1= these are disk_paths bit1= all paths except the last one are disk_paths
@return <=0 iis error, 1= leaf file object, 2= directory @return <=0 iis error, 1= leaf file object, 2= directory
*/ */
int Xorriso_cpmv_args(struct XorrisO *xorriso, char *cmd, int Xorriso_cpmv_args(struct XorrisO *xorriso, char *cmd,
@ -5425,8 +5425,8 @@ int Xorriso_cpmv_args(struct XorrisO *xorriso, char *cmd,
int *optc, char ***optv, char eff_dest[SfileadrL], int *optc, char ***optv, char eff_dest[SfileadrL],
int flag) int flag)
{ {
int destc= 0, is_dir=0, end_idx, nflag, ret; int destc= 0, is_dir=0, end_idx, ret;
char **destv= NULL, *wd; char **destv= NULL;
char sfe[5*SfileadrL]; char sfe[5*SfileadrL];
end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx,
@ -5438,7 +5438,7 @@ int Xorriso_cpmv_args(struct XorrisO *xorriso, char *cmd,
} }
ret= Xorriso_opt_args(xorriso, argc, argv, *idx, &end_idx, optc, optv, ret= Xorriso_opt_args(xorriso, argc, argv, *idx, &end_idx, optc, optv,
16); /* ignore last argument */ (flag&2)|16); /* ignore last argument */
if(ret<=0) if(ret<=0)
goto ex; goto ex;
ret= Xorriso_opt_args(xorriso, argc, argv, end_idx, &end_idx, &destc, &destv, ret= Xorriso_opt_args(xorriso, argc, argv, end_idx, &end_idx, &destc, &destv,
@ -5447,14 +5447,7 @@ int Xorriso_cpmv_args(struct XorrisO *xorriso, char *cmd,
goto ex; goto ex;
/* Evaluate target address */ /* Evaluate target address */
if(flag&2) { ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, destv[0], eff_dest, 1);
wd= xorriso->wdx;
nflag= 1|2|4;
} else {
wd= xorriso->wdi;
nflag= 1;
}
ret= Xorriso_normalize_img_path(xorriso, wd, destv[0], eff_dest, nflag);
if(ret<0) if(ret<0)
{ret= 0; goto ex;} {ret= 0; goto ex;}
if(ret==2 || ((flag&1) && *optc > 1 && ret==0)) { if(ret==2 || ((flag&1) && *optc > 1 && ret==0)) {
@ -6068,7 +6061,7 @@ int Xorriso_option_cpri(struct XorrisO *xorriso, int argc, char **argv,
char **optv= NULL; char **optv= NULL;
ret= Xorriso_cpmv_args(xorriso, "-cpri", argc, argv, idx, ret= Xorriso_cpmv_args(xorriso, "-cpri", argc, argv, idx,
&optc, &optv, eff_dest, 1); &optc, &optv, eff_dest, 1|2);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
if(ret==2) { if(ret==2) {
@ -6759,10 +6752,18 @@ int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag)
} }
/* Option -J */ /* Option -joliet "on"|"off" */
int Xorriso_option_j_capital(struct XorrisO *xorriso, int flag) int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag)
{ {
if(strcmp(mode, "off")==0)
xorriso->do_joliet= 0;
else if(strcmp(mode, "on")==0)
xorriso->do_joliet= 1; xorriso->do_joliet= 1;
else {
sprintf(xorriso->info_text, "-joliet: unknown mode '%s'", mode);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0);
}
return(1); return(1);
} }
@ -7646,14 +7647,6 @@ int Xorriso_option_use_readline(struct XorrisO *xorriso, char *mode, int flag)
} }
/* Option -V */
int Xorriso_option_v_capital(struct XorrisO *xorriso, char *volid, int flag)
{
fprintf(stderr, ">>> LIBISOFS : -V %s\n", volid);
return(1);
}
/* Option -version */ /* Option -version */
int Xorriso_option_version(struct XorrisO *xorriso, int flag) int Xorriso_option_version(struct XorrisO *xorriso, int flag)
{ {
@ -7670,6 +7663,34 @@ int Xorriso_option_version(struct XorrisO *xorriso, int flag)
} }
/* Option -volid */
int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag)
{
int warn= 0, i, ret;
static char good_chars[]= {
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+=:.,~@"};
for(i=0; volid[i]!=0; i++)
if(strchr(good_chars, volid[i])==NULL)
warn= 1;
if(i>32) {
sprintf(xorriso->info_text, "-volid: Text too long (%d > 32)", i);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0);
}
if(warn) {
sprintf(xorriso->info_text,
"-volid text problematic as automatic mount point name");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
}
strcpy(xorriso->volid, volid);
ret= Xorriso_set_volid(xorriso, volid, 0);
if(ret<=0)
return(ret);
return(1);
}
/* ---------------------------- End Options API ------------------------ */ /* ---------------------------- End Options API ------------------------ */
@ -7769,7 +7790,7 @@ next_command:;
} else if(strcmp(cmd,"commit")==0) { } else if(strcmp(cmd,"commit")==0) {
ret= Xorriso_option_commit(xorriso, 0); ret= Xorriso_option_commit(xorriso, 0);
} else if(strcmp(cmd,"cpr")==0 || strcmp(cmd,"-cpri")==0) { } else if(strcmp(cmd,"cpr")==0 || strcmp(cmd,"cpri")==0) {
ret= Xorriso_option_cpri(xorriso, argc, argv, idx, 0); ret= Xorriso_option_cpri(xorriso, argc, argv, idx, 0);
} else if(strcmp(cmd,"cut_out")==0) { } else if(strcmp(cmd,"cut_out")==0) {
@ -7860,8 +7881,9 @@ next_command:;
(*idx)++; (*idx)++;
ret= Xorriso_option_dev(xorriso, arg1, 1); ret= Xorriso_option_dev(xorriso, arg1, 1);
} else if(strcmp(cmd,"J")==0) { } else if(strcmp(cmd,"joliet")==0) {
ret= Xorriso_option_j_capital(xorriso, 0); (*idx)++;
ret= Xorriso_option_joliet(xorriso, arg1, 0);
} else if(strcmp(cmd,"ls")==0 || strcmp(cmd,"lsi")==0 || } else if(strcmp(cmd,"ls")==0 || strcmp(cmd,"lsi")==0 ||
strcmp(cmd,"lsl")==0 || strcmp(cmd,"lsli")==0) { strcmp(cmd,"lsl")==0 || strcmp(cmd,"lsli")==0) {
@ -8033,9 +8055,9 @@ next_command:;
(*idx)++; (*idx)++;
ret= Xorriso_option_uid(xorriso,arg1,0); ret= Xorriso_option_uid(xorriso,arg1,0);
} else if(strcmp(cmd,"V")==0) { } else if(strcmp(cmd,"volid")==0) {
(*idx)++; (*idx)++;
ret= Xorriso_option_v_capital(xorriso,arg1,0); ret= Xorriso_option_volid(xorriso,arg1,0);
} else if(strcmp(cmd,"use_readline")==0) { } else if(strcmp(cmd,"use_readline")==0) {
(*idx)++; (*idx)++;

View File

@ -225,8 +225,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag);
/* Option -history */ /* Option -history */
int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag); int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag);
/* Option -J */ /* Option -joliet "on"|"off" */
int Xorriso_option_j_capital(struct XorrisO *xorriso, int flag); int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag);
/* Option -logfile */ /* Option -logfile */
int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel, int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel,
@ -345,6 +345,9 @@ int Xorriso_option_use_readline(struct XorrisO *xorriso, char *mode, int flag);
/* Option -version */ /* Option -version */
int Xorriso_option_version(struct XorrisO *xorriso, int flag); int Xorriso_option_version(struct XorrisO *xorriso, int flag);
/* Option -volid */
int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag);
#endif /* Xorriso_includeD */ #endif /* Xorriso_includeD */

View File

@ -83,7 +83,7 @@ struct XorrisO { /* the global context of xorriso */
int do_overwrite; /* 0=off, 1=on, 2=nondir */ int do_overwrite; /* 0=off, 1=on, 2=nondir */
int do_reassure; /* 0=off, 1=on, 2=tree */ int do_reassure; /* 0=off, 1=on, 2=tree */
char volid[SfileadrL]; char volid[33];
/* >>> put libburn/isoburn aspects here */ /* >>> put libburn/isoburn aspects here */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2007.12.25.160100" #define Xorriso_timestamP "2007.12.26.160040"

View File

@ -2655,6 +2655,7 @@ int Xorriso_set_st_mode(struct XorrisO *xorriso, char *in_path,
mode, Text_shellsafe(path, sfe, 0)); mode, Text_shellsafe(path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
xorriso->volset_change_pending= 1; xorriso->volset_change_pending= 1;
Xorriso_process_msg_queues(xorriso,0);
return(1); return(1);
} }
@ -2671,6 +2672,7 @@ int Xorriso_set_uid(struct XorrisO *xorriso, char *in_path, uid_t uid,
iso_tree_node_set_uid(node, uid); iso_tree_node_set_uid(node, uid);
iso_tree_node_set_ctime(node, time(NULL)); iso_tree_node_set_ctime(node, time(NULL));
xorriso->volset_change_pending= 1; xorriso->volset_change_pending= 1;
Xorriso_process_msg_queues(xorriso,0);
return(1); return(1);
} }
@ -2687,6 +2689,7 @@ int Xorriso_set_gid(struct XorrisO *xorriso, char *in_path, gid_t gid,
iso_tree_node_set_gid(node, gid); iso_tree_node_set_gid(node, gid);
iso_tree_node_set_ctime(node, time(NULL)); iso_tree_node_set_ctime(node, time(NULL));
xorriso->volset_change_pending= 1; xorriso->volset_change_pending= 1;
Xorriso_process_msg_queues(xorriso,0);
return(1); return(1);
} }
@ -2710,6 +2713,7 @@ int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t,
if(!(flag&(2|256))) if(!(flag&(2|256)))
iso_tree_node_set_ctime(node, time(NULL)); iso_tree_node_set_ctime(node, time(NULL));
xorriso->volset_change_pending= 1; xorriso->volset_change_pending= 1;
Xorriso_process_msg_queues(xorriso,0);
return(1); return(1);
} }
@ -2795,8 +2799,24 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
ret= 1; ret= 1;
ex:; ex:;
Xorriso_process_msg_queues(xorriso,0);
if(iter!=NULL) if(iter!=NULL)
iso_tree_iter_free(iter); iso_tree_iter_free(iter);
return(ret); return(ret);
} }
int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag)
{
int ret;
struct iso_volume *volume;
ret= Xorriso_get_volume(xorriso, &volume, 0);
if(ret<=0)
return(ret);
iso_volume_set_volume_id(volume, volid);
Xorriso_process_msg_queues(xorriso,0);
return(1);
}

View File

@ -127,6 +127,7 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
void *dir_node_generic, char *dir_path, void *dir_node_generic, char *dir_path,
struct stat *dir_stbuf, int depth, int flag); struct stat *dir_stbuf, int depth, int flag);
int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag);
#endif /* Xorrisoburn_includeD */ #endif /* Xorrisoburn_includeD */