diff --git a/libisoburn/trunk/test/xorriso.1 b/libisoburn/trunk/test/xorriso.1 index f7b6f007..d4cefcb8 100644 --- a/libisoburn/trunk/test/xorriso.1 +++ b/libisoburn/trunk/test/xorriso.1 @@ -2,7 +2,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 "December 25, 2007" +.TH XORRISO 1 "December 26, 2007" .\" Please adjust this date whenever revising the manpage. .\" .\" 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. .br It allows to move the cursor over the text in the line by help of the -leftward and the rightward arrow key. -Text may be inserted at the cursor position. The delete key removes the +Leftward and the Rightward arrow key. +Text may be inserted at the cursor position. The Delete key removes the character under the cursor. Upward and Downward arrow keys navigate through the history of previous input lines. .br @@ -356,10 +356,6 @@ try to abort as soon as possible. .br .SH OPTIONS .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 mandatory for the option to be recognized. There may be future emulation modes, where dashes may become mandatory in order to distinguish options @@ -754,11 +750,13 @@ existing directory and all its subordinates. .TP Rock Ridge info will be generated by the program unconditionally. .TP -? \fB\-J\fR -Generate Joliet info additional to Rock Ridge info. +\fB\-joliet\fR "on"|"off" +If enabled by "on", generate Joliet info additional to Rock Ridge info. .TP -> \fB\-V\fR volid -Specifies the volume ID. +\fB\-volid\fR text +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 \fB\-uid\fR uid User id to be used for all files when the new ISO tree gets written to media. diff --git a/libisoburn/trunk/test/xorriso.c b/libisoburn/trunk/test/xorriso.c index 01e19258..480a41b0 100644 --- a/libisoburn/trunk/test/xorriso.c +++ b/libisoburn/trunk/test/xorriso.c @@ -3731,14 +3731,14 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) Xorriso_status_result(xorriso,filter,fp,flag&2); 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)) Xorriso_status_result(xorriso,filter,fp,flag&2); - if(xorriso->do_joliet) { - sprintf(line,"-J\n"); + is_default= (xorriso->do_joliet==0); + sprintf(line,"-joliet %s\n", (xorriso->do_joliet == 1 ? "on" : "off")); + if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); - } if(xorriso->do_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 - 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 */ 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 flag) { - int destc= 0, is_dir=0, end_idx, nflag, ret; - char **destv= NULL, *wd; + int destc= 0, is_dir=0, end_idx, ret; + char **destv= NULL; char sfe[5*SfileadrL]; 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, - 16); /* ignore last argument */ + (flag&2)|16); /* ignore last argument */ if(ret<=0) goto ex; 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; /* Evaluate target address */ - if(flag&2) { - 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); + ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, destv[0], eff_dest, 1); if(ret<0) {ret= 0; goto ex;} 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; ret= Xorriso_cpmv_args(xorriso, "-cpri", argc, argv, idx, - &optc, &optv, eff_dest, 1); + &optc, &optv, eff_dest, 1|2); if(ret<=0) goto ex; if(ret==2) { @@ -6759,10 +6752,18 @@ int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag) } -/* Option -J */ -int Xorriso_option_j_capital(struct XorrisO *xorriso, int flag) +/* Option -joliet "on"|"off" */ +int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag) { - xorriso->do_joliet= 1; + if(strcmp(mode, "off")==0) + xorriso->do_joliet= 0; + else if(strcmp(mode, "on")==0) + 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); } @@ -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 */ 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 ------------------------ */ @@ -7769,7 +7790,7 @@ next_command:; } else if(strcmp(cmd,"commit")==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); } else if(strcmp(cmd,"cut_out")==0) { @@ -7860,8 +7881,9 @@ next_command:; (*idx)++; ret= Xorriso_option_dev(xorriso, arg1, 1); - } else if(strcmp(cmd,"J")==0) { - ret= Xorriso_option_j_capital(xorriso, 0); + } else if(strcmp(cmd,"joliet")==0) { + (*idx)++; + ret= Xorriso_option_joliet(xorriso, arg1, 0); } else if(strcmp(cmd,"ls")==0 || strcmp(cmd,"lsi")==0 || strcmp(cmd,"lsl")==0 || strcmp(cmd,"lsli")==0) { @@ -8033,9 +8055,9 @@ next_command:; (*idx)++; ret= Xorriso_option_uid(xorriso,arg1,0); - } else if(strcmp(cmd,"V")==0) { + } else if(strcmp(cmd,"volid")==0) { (*idx)++; - ret= Xorriso_option_v_capital(xorriso,arg1,0); + ret= Xorriso_option_volid(xorriso,arg1,0); } else if(strcmp(cmd,"use_readline")==0) { (*idx)++; diff --git a/libisoburn/trunk/test/xorriso.h b/libisoburn/trunk/test/xorriso.h index 370e6f80..3f293512 100644 --- a/libisoburn/trunk/test/xorriso.h +++ b/libisoburn/trunk/test/xorriso.h @@ -225,8 +225,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag); /* Option -history */ int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag); -/* Option -J */ -int Xorriso_option_j_capital(struct XorrisO *xorriso, int flag); +/* Option -joliet "on"|"off" */ +int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag); /* Option -logfile */ 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 */ 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 */ diff --git a/libisoburn/trunk/test/xorriso_private.h b/libisoburn/trunk/test/xorriso_private.h index bb6077d6..9f50d2af 100644 --- a/libisoburn/trunk/test/xorriso_private.h +++ b/libisoburn/trunk/test/xorriso_private.h @@ -83,7 +83,7 @@ struct XorrisO { /* the global context of xorriso */ int do_overwrite; /* 0=off, 1=on, 2=nondir */ int do_reassure; /* 0=off, 1=on, 2=tree */ - char volid[SfileadrL]; + char volid[33]; /* >>> put libburn/isoburn aspects here */ diff --git a/libisoburn/trunk/test/xorriso_timestamp.h b/libisoburn/trunk/test/xorriso_timestamp.h index 508c462a..7542d7da 100644 --- a/libisoburn/trunk/test/xorriso_timestamp.h +++ b/libisoburn/trunk/test/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2007.12.25.160100" +#define Xorriso_timestamP "2007.12.26.160040" diff --git a/libisoburn/trunk/test/xorrisoburn.c b/libisoburn/trunk/test/xorrisoburn.c index 6b556b8c..1a79f4ab 100644 --- a/libisoburn/trunk/test/xorrisoburn.c +++ b/libisoburn/trunk/test/xorrisoburn.c @@ -2655,6 +2655,7 @@ int Xorriso_set_st_mode(struct XorrisO *xorriso, char *in_path, mode, Text_shellsafe(path, sfe, 0)); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); xorriso->volset_change_pending= 1; + Xorriso_process_msg_queues(xorriso,0); 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_ctime(node, time(NULL)); xorriso->volset_change_pending= 1; + Xorriso_process_msg_queues(xorriso,0); 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_ctime(node, time(NULL)); xorriso->volset_change_pending= 1; + Xorriso_process_msg_queues(xorriso,0); return(1); } @@ -2710,6 +2713,7 @@ int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t, if(!(flag&(2|256))) iso_tree_node_set_ctime(node, time(NULL)); xorriso->volset_change_pending= 1; + Xorriso_process_msg_queues(xorriso,0); return(1); } @@ -2795,8 +2799,24 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job, ret= 1; ex:; + Xorriso_process_msg_queues(xorriso,0); if(iter!=NULL) iso_tree_iter_free(iter); 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); +} + + diff --git a/libisoburn/trunk/test/xorrisoburn.h b/libisoburn/trunk/test/xorrisoburn.h index 57442f0a..4269971c 100644 --- a/libisoburn/trunk/test/xorrisoburn.h +++ b/libisoburn/trunk/test/xorrisoburn.h @@ -127,6 +127,7 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job, void *dir_node_generic, char *dir_path, struct stat *dir_stbuf, int depth, int flag); +int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag); #endif /* Xorrisoburn_includeD */