diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index f0c802a4..18f8ecfe 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -153,14 +153,6 @@ char *Sfile_fgets(char *line, int maxl, FILE *fp) } -int Sfile_fclose(FILE *fp) -{ - if(fp!=stdout && fp!=stdin && fp!=NULL) - fclose(fp); - return(1); -} - - int Sfile_count_components(char *path, int flag) /* bit0= do not ignore trailing slash @@ -365,159 +357,6 @@ int Sfile_type(char *filename, int flag) } -int Sfile_lookup_permissions(char *fname, int *perms, mode_t *st_mode,int flag) -/* @param perms bit0= r , bit1= w , bit2= x */ -/* return: <0 fatal error, 0= file nonexistent, 1=owner, 2=group, 3=other */ -{ - struct stat stbuf; - int is_root; - - *perms= 0; - if(stat(fname,&stbuf)==-1) - return(0); - *st_mode= stbuf.st_mode; - is_root= (geteuid()==0); - if(is_root) /* root can always read and write */ - *perms= 3; - if(is_root || geteuid()==stbuf.st_uid) { - if(stbuf.st_mode & S_IRUSR) - (*perms)|= 1; - if(stbuf.st_mode & S_IWUSR) - (*perms)|= 2; - if(stbuf.st_mode & S_IXUSR) - (*perms)|= 4; - if(!is_root) - return(1); - } - /* group membership is a complicated thing */ - if(is_root || Sfile_being_group_member(&stbuf,0)>0) { - if(stbuf.st_mode & S_IRGRP) - (*perms)|= 1; - if(stbuf.st_mode & S_IWGRP) - (*perms)|= 2; - if(stbuf.st_mode & S_IXGRP) - (*perms)|= 4; - if(!is_root) - return(2); - } - if(stbuf.st_mode & S_IROTH) - (*perms)|= 1; - if(stbuf.st_mode & S_IWOTH) - (*perms)|= 2; - if(stbuf.st_mode & S_IXOTH) - (*perms)|= 4; - if(is_root) - return(1); - return(3); -} - - -int Sfile_select(int *fds, int fdcount, int fdidx[3], unsigned int microsec, - int flag) -/* - bit0= check for reading (and choose one into fdidx[0]) - bit1= check for writing (and choose one into fdidx[1]) - bit2= check for exception (and choose one into fdidx[2]) - bit3= initialize fdidx -return-bits are set according to matching flag-bits -*/ -{ - struct timeval wt; - fd_set rds,wts,exs,*s; - int ready,ret,i,j,max_fd= -1; - - if(flag&8) - for(j=0;j<3;j++) - fdidx[j]= 0; - wt.tv_sec= microsec/1000000; - wt.tv_usec= microsec%1000000; - FD_ZERO(&rds); - FD_ZERO(&wts); - FD_ZERO(&exs); - for(i= 0;imax_fd) - max_fd= fds[i]; - } - ready= select(max_fd+1,&rds,&wts,&exs,&wt); - if(ready<=0) - return(0); - ret= 0; - if(fdcount>0) - for(j=0;j<2;j++) - fdidx[j]= (fdidx[j]+1)%fdcount; - for(i= 0;i31) - return(0); - if(flag&1) - (*data)&= ~(1<>8L) & 0xffffffL; - crc_val= ch1 ^ ch2; - } - *crc= ~crc_val; - return(1); -} - #endif /* Xorriso_sregex_externaL */ @@ -1799,188 +1521,9 @@ int Fileliste__target_source_limit(char *line, char sep, char **limit_pt, return(npt!=NULL); } - -int Fileliste__unescape_target(char *line, char *endpt, char sep, int flag) -{ - char *wpt,*rpt; - - if(endpt==NULL) - endpt= line+strlen(line); - - /* unescape sep and '\\' */ - wpt= line; - for(rpt= line; rpt=0;i--) - if(target[i]=='=' || target[i]=='\\') - offset++; - target[strlen(target)+offset]= 0; - for(i= strlen(target)-1;i>=0;i--) { - if(target[i]=='=' || target[i]=='\\') { - target[i+offset]= target[i]; - offset--; - target[i+offset]= '\\'; - } else { - target[i+offset]= target[i]; - } - } - return(1); -} - #endif /* ! Xorriso_fileliste_externaL */ -#define Xorriso_cleanup_externaL 1 -#ifndef Xorriso_cleanup_externaL - -/* <<< ??? ts A71006 : will this be replaced by the libburn signal handler ? */ - -#include -typedef void (*sighandler_t)(int); - - -/* Signals to be caught */ -static int signal_list[]= { - SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, - SIGFPE, SIGSEGV, SIGPIPE, SIGALRM, SIGTERM, - SIGUSR1, SIGUSR2, SIGXCPU, SIGTSTP, SIGTTIN, - SIGTTOU, - SIGBUS, SIGPOLL, SIGPROF, SIGSYS, SIGTRAP, - SIGVTALRM, SIGXCPU, SIGXFSZ, -1 -}; -static char *signal_name_list[]= { - "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGABRT", - "SIGFPE", "SIGSEGV", "SIGPIPE", "SIGALRM", "SIGTERM", - "SIGUSR1", "SIGUSR2", "SIGXCPU", "SIGTSTP", "SIGTTIN", - "SIGTTOU", - "SIGBUS", "SIGPOLL", "SIGPROF", "SIGSYS", "SIGTRAP", - "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "@" -}; -static int signal_list_count= 24; - - -/* Signals not to be caught */ -static int non_signal_list[]= { - SIGKILL, SIGCHLD, SIGSTOP, SIGURG, SIGWINCH, -1 -}; -static int non_signal_list_count= 5; - - -/* run time dynamic part */ -static char cleanup_msg[SfileadrL]= {""}; -static int cleanup_exiting= 0; - -static void *cleanup_app_handle= NULL; -static Cleanup_app_handler_T cleanup_app_handler= NULL; -static int cleanup_perform_app_handler_first= 0; - - -static int Cleanup_handler_exit(int exit_value, int signum, int flag) -{ - int ret; - - if(cleanup_perform_app_handler_first) - if(cleanup_app_handler!=NULL) { - ret= (*cleanup_app_handler)(cleanup_app_handle,signum,0); - if(ret==2) - return(2); - } - if(cleanup_exiting) { - if(cleanup_msg[0]!=0) - fprintf(stderr,"%s\n",cleanup_msg); - fprintf(stderr,"cleanup: ABORT : repeat by pid=%d, signum=%d\n", - getpid(),signum); - return(0); - } - cleanup_exiting= 1; - if(cleanup_msg[0]!=0) - fprintf(stderr,"%s\n",cleanup_msg); - alarm(0); - if(!cleanup_perform_app_handler_first) - if(cleanup_app_handler!=NULL) - (*cleanup_app_handler)(cleanup_app_handle,signum,0); - exit(exit_value); -} - - -static void Cleanup_handler_generic(int signum) -{ - int i; - - sprintf(cleanup_msg,"UNIX-SIGNAL caught: %d errno= %d",signum,errno); - for(i= 0; imax_sig) - max_sig= signal_list[i]; - if(signal_list[i]=non_signal_list_count) { - if(i==SIGABRT && (flag&8)) - signal(i,Cleanup_handler_generic); - else - signal(i,sig_handler); - } - } - return(1); -} - - -#endif /* ! Xorriso_cleanup_externaL */ - - /* ------------------------------------------------------------------------ */ /* DirseQ : crawl along a directory's content list */ @@ -2199,132 +1742,6 @@ return: } -/* ------------------------------- TreeseQ -------------------------------- */ -/* DirseQ : crawl along a filesystem subtree */ - -struct TreeseQ { - char adr[SfileadrL]; - char path[SfileadrL]; - struct DirseQ *dir_stack; - struct stat stbuf; - int follow_links; - int unused_yet; -}; - - -int Treeseq_destroy(struct TreeseQ **o, int flag); - - -/* @param flag bit0= follow symbolic links */ -int Treeseq_new(struct TreeseQ **o, char *adr, int flag) -{ - int ret; - struct TreeseQ *m; - - m= *o= TSOB_FELD(struct TreeseQ,1); - if(m==NULL) - return(-1); - m->adr[0]= 0; - m->path[0]= 0; - m->dir_stack= NULL; - m->follow_links= (flag&1); - m->unused_yet= 1; - if(Sfile_str(m->adr, adr, 0)<=0) - {ret= 0; goto failed;} - strcpy(m->path, adr); - if(m->follow_links) - ret= stat(adr, &(m->stbuf)); - else - ret= lstat(adr, &(m->stbuf)); - if(ret==-1) - {ret= 0; goto failed;} - if(S_ISDIR(m->stbuf.st_mode)) { - ret= Dirseq_new(&(m->dir_stack), adr, 0); - if(ret<=0) - goto failed; - } - return(1); -failed:; - Treeseq_destroy(o,0); - return(ret); -} - - -int Treeseq_destroy(struct TreeseQ **o, int flag) -{ - struct DirseQ *dirseq, *next; - - for(dirseq= (*o)->dir_stack; dirseq!=NULL; dirseq= next) { - next= dirseq->next; - Dirseq_destroy(&dirseq,0); - } - free((char *) *o); - (*o)= NULL; - return(1); -} - - -/* @return <0 error, 0= no more entries available, 1= ok, reply is valid -*/ -int Treeseq_next(struct TreeseQ *o, char adr[SfileadrL], struct stat **stbuf, - int flag) -{ - int ret; - char next_name[SfileadrL], *spt; - struct DirseQ *next_dirseq; - - if(o->dir_stack==NULL) { - if(!o->unused_yet) - return(0); - strcpy(adr, o->adr); - *stbuf= &(o->stbuf); - o->unused_yet= 0; - return(1); - } - o->unused_yet= 0; -next_in_dirseq:; - ret= Dirseq_next_adr(o->dir_stack, next_name, 1); - if(ret<0) - return(ret); - if(ret>0) { - strcpy(adr, o->path); - ret= Sfile_add_to_path(adr, next_name, 0); - if(ret<=0) - return(-1); - if(o->follow_links) - ret= stat(adr, &(o->stbuf)); - else - ret= lstat(adr, &(o->stbuf)); - *stbuf= &(o->stbuf); - - if(!S_ISDIR(o->stbuf.st_mode)) - return(1); - - /* Directory found: push new DirseQ on stack */ - ret= Dirseq_new(&next_dirseq, adr, 0); - if(ret<=0) - return(-1); - Dirseq_set_next(next_dirseq, o->dir_stack, 0); - o->dir_stack= next_dirseq; - strcpy(o->path, adr); - return(1); - } - - /* pop DirseQ from stack */ - Dirseq_get_next(o->dir_stack, &next_dirseq, 0); - Dirseq_destroy(&(o->dir_stack), 0); - o->dir_stack= next_dirseq; - spt= strrchr(o->path, '/'); - if(spt!=NULL) - (*spt)= 0; - else - o->path[0]= 0; - if(o->dir_stack!=NULL) - goto next_in_dirseq; - return(0); /* it is done */ -} - - /* ------------------------------ LinkiteM -------------------------------- */ struct LinkiteM { @@ -2450,12 +1867,12 @@ struct FindjoB { 12= alter_date_r type date 13= find 14= compare disk_equivalent_of_start_path - 15= in_iso - 16= not_in_iso - 17= update - 18= add_missing - 19= empty_iso_dir - 20= is_full_in_iso + 15= in_iso iso_rr_equivalent_of_start_path + 16= not_in_iso iso_rr_equiv + 17= update disk_equiv + 18= add_missing iso_rr_equiv + 19= empty_iso_dir iso_rr_equiv + 20= is_full_in_iso iso_rr_equiv */ int action; char *target; @@ -3556,6 +2973,7 @@ int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done, return(1); } + int Xorriso_reset_counters(struct XorrisO *xorriso, int flag) { xorriso->error_count= 0; @@ -4453,8 +3871,6 @@ much_too_long:; } -#define Xorriso_with_compare_2_contentS yes - /* @param result Bitfield indicationg type of mismatch bit11= cannot open regular disk file @@ -4655,16 +4071,9 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr, struct SplitparT *split_parts= NULL; int split_count= 0; -#ifdef Xorriso_with_compare_2_contentS char part_path[SfileadrL], *part_name; int partno, total_parts= 0; off_t offset, bytes, total_bytes; -#else /* Xorriso_with_compare_2_contentS */ - void *stream2= NULL; - int fd1= -1, wanted, r1, r2, done; - off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1; - char buf1[32*1024], buf2[32*1024]; -#endif /* Xorriso_with_compare_2_contentS */ *result= 0; respt= xorriso->result_line; @@ -4801,9 +4210,6 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr, } } if(S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)) { - -#ifdef Xorriso_with_compare_2_contentS - /* Content */ if(is_split) { for(i= 0; is2.st_size) - wanted= s2.st_size-r2count; -#endif - - if(wanted>0) - r2= Xorriso_iso_file_read(xorriso, stream2, buf2, wanted, 0); - else - r2= 0; - - if((r1==EOF && r2==EOF) || (r1==0 && r2==0)) - break; - if(r1==EOF || r1==0) { - if(r1==EOF) - r1= 0; - if(s1.st_size > r1count + r1) { - sprintf(respt, "- %s (DISK) : early EOF after %.f bytes\n", - disk_adr, (double) r1count); - if(!(flag&(1<<31))) - Xorriso_result(xorriso,0); - (*result)|= 8196; - } - (*result)|= (1<<15); - } - r1count+= r1; - if(r2==EOF || r2 r2count + r2) { - sprintf(respt, "- %s (ISO) : early EOF after %.f bytes\n", - iso_adr, (double) r2count); - if(!(flag&(1<<31))) - Xorriso_result(xorriso,0); - (*result)|= (1<<14); - } - (*result)|= (1<<15); - done= 1; - } - if(r2>r1) { - if(s1.st_size > r1count + r1) { - sprintf(respt, "- %s (DISK) : early EOF after %.f bytes\n", - disk_adr, (double) r1count); - if(!(flag&(1<<31))) - Xorriso_result(xorriso,0); - (*result)|= 8196; - } - (*result)|= (1<<15); - done= 1; - } - r2count+= r2; - if(r1>r2) - r1= r2; - for(i= 0; ipacifier_count+= r1; - Xorriso_pacifier_callback(xorriso, "content bytes read", - xorriso->pacifier_count, 0, "", 0); - } - } - if(diffcount>0 || r1count!=r2count) { - if(first_diff<0) - first_diff= (r1count>r2count ? r2count : r1count); - sprintf(respt, "%s %s : differs by at least %.f bytes. First at %.f\n", - a, (s1.st_mtime==s2.st_mtime ? "CONTENT": "content"), - (double) (diffcount + abs(r1count-r2count)), (double) first_diff); - if(!(flag&(1<<31))) - Xorriso_result(xorriso,0); - (*result)|= (1<<15); - } - -#endif /* ! Xorriso_with_compare_2_contentS */ - } ret= (((*result)&~((1<<17)|(1<<18)))==0); ex:; -#ifndef Xorriso_with_compare_2_contentS - if(fd1!=-1) - close(fd1); - Xorriso_iso_file_close(xorriso, &stream2, 0); -#endif /* ! Xorriso_with_compare_2_contentS */ if(split_parts!=NULL) Splitparts_destroy(&split_parts, split_count, 0); return(ret); @@ -4994,6 +4281,9 @@ int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter, if(ret<=0) return(ret); + /* >>> compare exclusions against disk_path resp. leaf name */; + /* >>> eventually return 3 */ + follow_links= (xorriso->do_follow_links || (xorriso->do_follow_param && !(flag&2))) <<28; ret= Xorriso_compare_2_files(xorriso, disk_path, iso_path, adrc, &result, @@ -6345,13 +5635,6 @@ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag) char *rpt, perms[10]; mode_t st_mode; -#ifdef NIX - time_t mtime; - struct tm tms, *tmpt; - static char months[12][4]= { "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; -#endif - rpt= xorriso->result_line; rpt[0]= 0; st_mode= stbuf->st_mode; @@ -6382,21 +5665,8 @@ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag) sprintf(rpt+strlen(rpt), "%-8lu ", (unsigned long) stbuf->st_gid); sprintf(rpt+strlen(rpt), "%8.f ", (double) stbuf->st_size); -#ifndef NIX Ftimetxt(stbuf->st_mtime, rpt+strlen(rpt), 0); strcat(rpt, " "); -#else - mtime= stbuf->st_mtime; - tmpt= localtime_r(&mtime, &tms); - if(tmpt==0) - sprintf(rpt+strlen(rpt), "%12.f ",(double) mtime); - else if(time(NULL)-mtime < 180*86400 && time(NULL)-mtime >= 0) - sprintf(rpt+strlen(rpt), "%3s %2d %2.2d:%2.2d ", - months[tms.tm_mon], tms.tm_mday, tms.tm_hour, tms.tm_min); - else - sprintf(rpt+strlen(rpt), "%3s %2d %4.4d ", - months[tms.tm_mon], tms.tm_mday, 1900+tms.tm_year); -#endif return(1); } @@ -6735,6 +6005,9 @@ int Xorriso_findx(struct XorrisO *xorriso, struct FindjoB *job, if(ret<=0) goto ex; abs_dir_path= abs_dir_path_data; + + /* >>> compare exclusions against abs_path resp. leaf name */; + ret= lstat(abs_dir_path, dir_stbuf); if(ret==-1) {ret= 0; goto ex;} @@ -6794,6 +6067,9 @@ int Xorriso_findx(struct XorrisO *xorriso, struct FindjoB *job, ret= Xorriso_make_abs_adr(xorriso, dir_path, name, path, 4); if(ret<=0) goto ex; + + /* >>> compare exclusions against abs_path resp. leaf name */; + ret= lstat(abs_path, &stbuf); if(ret==-1) continue; @@ -7437,24 +6713,6 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, ret= Sfile_type(adr+6, 1); if(ret==-1) { /* ok */; - -#ifdef NIX - } else if(ret==1) { - - /* <<< is now done in libisoburn by bit4 of Xorriso_option_dev() */ - - ret= truncate(adr+6, (off_t) 0); - if(ret==-1) { - sprintf(xorriso->info_text, "-as %s: Cannot truncate existing -o %s", - whom, Text_shellsafe(adr+6, sfe, 0)); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", - 0); - } - sprintf(xorriso->info_text, "-as %s: Truncated existing -o %s", - whom, Text_shellsafe(adr+6, sfe, 0)); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); -#endif /* NIX */ - } else if(ret==2 || ret==3) { sprintf(xorriso->info_text, "-as %s: Cannot accept %s as target: -o %s", @@ -7637,14 +6895,6 @@ int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter, xorriso->info_text[0]= 0; is_split= !!(compare_result & (1<<17)); - /* <<< */ - if(0 && is_split) { - sprintf(xorriso->info_text, "Split file cannot be updated yet: %s\n", - Text_shellsafe(iso_rr_path, sfe, 0)); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 1); - {ret= 1; goto ex;} - } - if(compare_result&(8|64)) { /* file type, minor+major with device file */ ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, iso_rr_path, 1); /* rm_r */ @@ -7874,14 +7124,6 @@ int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv, } *wpt= 0; } - -/* <<< do not apply wdx to both, but wdi to ISO and wdx to disk - if(source[0]!='/') { - ret= Sfile_prepend_path(xorriso->wdx, source, 0); - if(ret<=0) - goto problem_handler; - } -*/ if(split==0) { strcpy(target, source); } else if(target[0]!='/') { @@ -8069,11 +7311,7 @@ int Xorriso_option_ban_stdio_write(struct XorrisO *xorriso, int flag) int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag) { char drive_name[SfileadrL], *cmd= "-blank"; -#ifndef NIX int aq_ret; -#else - sfe[5*SfileadrL]; -#endif int ret, aq_flag= 2, mode_flag; if(flag&1) @@ -8122,9 +7360,6 @@ int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag) return(ret); strcpy(drive_name, xorriso->outdev); if(ret!=2) { - -#ifndef NIX - if(ret<=0) aq_flag= 0; aq_ret= Xorriso_reaquire_outdev(xorriso, aq_flag); @@ -8132,29 +7367,6 @@ int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag) return(ret); if(aq_ret<=0) return(aq_ret); - -#else - - Xorriso_give_up_drive(xorriso, aq_flag); - if(ret<=0) { /* this is the return value of the blank|format function */ - sprintf(xorriso->info_text,"Gave up -outdev %s", - Text_shellsafe(xorriso->outdev, sfe, 0)); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); - return(ret); - } - sprintf(xorriso->info_text,"Re-aquiring -outdev %s", - Text_shellsafe(drive_name, sfe, 0)); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); - ret= Xorriso_aquire_drive(xorriso, drive_name, aq_flag); - if(ret<=0) { - sprintf(xorriso->info_text,"Could not re-aquire -outdev %s", - Text_shellsafe(xorriso->outdev, sfe, 0)); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); - return(ret); - } - -#endif /* NIX */ - } return(1); } @@ -10165,7 +9377,7 @@ int Xorriso_option_page(struct XorrisO *xorriso, int len, int width, int flag) int Xorriso_option_path_list(struct XorrisO *xorriso, char *adr, int flag) { int ret,linecount= 0, insertcount= 0, null= 0, was_failure= 0, fret= 0; - int was_ferror= 0, list_errfile= 0; + int was_ferror= 0; FILE *fp= NULL; char *argpt, sfe[5*SfileadrL],line[SfileadrL]; @@ -10185,18 +9397,6 @@ int Xorriso_option_path_list(struct XorrisO *xorriso, char *adr, int flag) was_ferror= 1; break; } - - /* <<< disabled for now: list all files which get not processed after - the problem evaluator decided to abort. Actually the whole program - will abort and thus further commands will not report their omitted - files. - */ - if(list_errfile) { - if(line[0]) - Xorriso_msgs_submit(xorriso, 0, line, 0, "ERRFILE", 0); - continue; - } - linecount++; if(line[0]==0) continue; @@ -10213,25 +9413,19 @@ problem_handler:; fret= Xorriso_eval_problem_status(xorriso, ret, 1|2); if(fret>=0) continue; - -#ifdef NIX - list_errfile= 1; /* <<< disabled : see above */ -#else goto ex; -#endif - } ret= 1; ex:; Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count, xorriso->pacifier_total, "", 1); - if(ret<=0 || list_errfile) { + if(ret<=0) { sprintf(xorriso->info_text, "Aborted reading of file %s in line number %d", Text_shellsafe(adr, sfe, 0), linecount); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, (fret==-2 ? "NOTE" : "FAILURE"), 0); } - ret= !(was_ferror || list_errfile); + ret= !was_ferror; sprintf(xorriso->info_text, "Added %d items from file %s\n", insertcount, Text_shellsafe(adr, sfe, 0)); Xorriso_info(xorriso,0); @@ -11331,36 +10525,7 @@ next_command:; ret= Xorriso_option_temp_mem_limit(xorriso, arg1, 0); } else if(strcmp(cmd,"test")==0) { /* This option does not exist. */ - char line[4096]; - struct TreeseQ *seq; - struct stat *stbufpt; - - printf("XORRISO: -test : enter a file address for tree crawling\n"); - ret= Xorriso_dialog_input(xorriso,line,sizeof(line),4); - if(ret<=0) - goto eval_any_problems; - ret= Treeseq_new(&seq, line, 0); - if(ret<=0) { - sprintf(xorriso->info_text,"Failed to create TreeseQ"); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); - goto eval_any_problems; - } - while(1) { - ret= Treeseq_next(seq, line, &stbufpt, 0); - if(ret<=0) - break; - sprintf(xorriso->result_line,"%s%s\n",line, - S_ISDIR(stbufpt->st_mode) ? "/" : ""); - Xorriso_result(xorriso,0); - if(xorriso->request_to_abort) - break; - } - Treeseq_destroy(&seq, 0); - if(ret<0) { - sprintf(xorriso->info_text,"Tree crawling aborted"); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); - goto eval_any_problems; - } + ; } else if(strcmp(cmd,"toc")==0) { Xorriso_option_toc(xorriso, 0); @@ -11579,14 +10744,6 @@ int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv, Xorriso_option_help(xorriso,0); xorriso->did_something_useful= 1; return(0); - -#ifdef NIX - } else if(strcmp(cmd,"version")==0) { - Xorriso_option_version(xorriso, 0); - xorriso->did_something_useful= 1; - return(0); -#endif - } } else if(i==1 && strcmp(cmd,"no_rc")==0) { ret= Xorriso_option_no_rc(xorriso, 0); diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 3a25b196..3660f5e4 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.04.07.185727" +#define Xorriso_timestamP "2008.04.07.201253" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index ef34ea63..c192225d 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -1586,7 +1586,7 @@ cannot_open_dir:; Linkitem_reset_stack(&own_link_stack, link_stack, 0); srcpt= disk_path; Xorriso_process_msg_queues(xorriso,0); - ret= Dirseq_next_adr(dirseq,name,0); + ret= Dirseq_next_adr(dirseq,name,0); /* name is a pointer into disk_path */ if(ret==0) break; if(ret<0) { @@ -1594,6 +1594,9 @@ cannot_open_dir:; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0); {ret= -1; goto ex;} } + + /* >>> compare exclusions against disk_path resp. name */; + strcpy(img_name, name); if(Xorriso_much_too_long(xorriso, strlen(img_path), 0)<=0) {ret= 0; goto was_problem;} @@ -1800,23 +1803,8 @@ int Xorriso_copy_implict_properties(struct XorrisO *xorriso, IsoDir *dir, strcpy(nfd, "/"); if(stat(nfd, &stbuf)==-1) return(0); - -#ifdef NIX - if((flag&1) && d==0) { - /* give directory x-permission where is r-permission */ - if(stbuf.st_mode&S_IRUSR) - stbuf.st_mode|= S_IXUSR; - if(stbuf.st_mode&S_IRGRP) - stbuf.st_mode|= S_IXGRP; - if(stbuf.st_mode&S_IROTH) - stbuf.st_mode|= S_IXOTH; - } - Xorriso_transfer_properties(xorriso, &stbuf, (IsoNode *) dir, flag&1); -#else Xorriso_transfer_properties(xorriso, &stbuf, (IsoNode *) dir, ((flag&1) && d==0)); -#endif /* ! NIX */ - sprintf(xorriso->info_text, "Copied properties for %s", Text_shellsafe(ni, sfe, 0)); sprintf(xorriso->info_text+strlen(xorriso->info_text), @@ -1869,11 +1857,12 @@ int Xorriso_graft_in(struct XorrisO *xorriso, void *boss_iter, int target_is_split; struct stat stbuf; + + /* >>> compare exclusions against disk_path resp. name + but no leaf patter if flag&4 */; + + for(cpt= img_path; 1; cpt++) { -/* - if(cpt[0]!='/') - break; -*/ cpt= strstr(cpt,"/."); if(cpt==NULL) break; @@ -3592,6 +3581,7 @@ ex:; return(ret); } + /* @param boss_iter Opaque handle to be forwarded to actions in ISO image Set to NULL if calling this function from outside ISO world */