New option -as mkisofs emulates a narrow set of mkisofs gestures
This commit is contained in:
@ -419,6 +419,7 @@ int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag)
|
||||
|
||||
/* @param flag bit0=aquire as isoburn input drive
|
||||
bit1=aquire as libburn output drive (as isoburn drive if bit0)
|
||||
bit2=regard overwriteable media as blank
|
||||
@return <=0 failure , 1= ok
|
||||
2=success, but not writeable with bit1
|
||||
3=success, but not blank and not ISO with bit0
|
||||
@ -438,7 +439,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
sprintf(xorriso->info_text,
|
||||
"XORRISOBURN program error : Xorriso_aquire_drive bit0+bit1 not set");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
|
||||
return(0);
|
||||
return(-1);
|
||||
}
|
||||
ret= Xorriso_give_up_drive(xorriso, (flag&3)|8);
|
||||
if(ret<=0)
|
||||
@ -448,7 +449,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
if(strcmp(adr,"stdio:/dev/fd/1")==0) {
|
||||
if(xorriso->dev_fd_1<0) {
|
||||
sprintf(xorriso->info_text,
|
||||
"\"stdio:/dev/fd/1\" was not a start argument. stdout possibly already tainted.");
|
||||
"-*dev \"stdio:/dev/fd/1\" was not a start argument. Cannot use it now.");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
{ret= 0; goto ex;}
|
||||
} else {
|
||||
@ -476,12 +477,12 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
}
|
||||
|
||||
if(dinfo==NULL) {
|
||||
ret= isoburn_drive_scan_and_grab(&dinfo, libburn_adr, 1);
|
||||
ret= isoburn_drive_aquire(&dinfo, libburn_adr, 1|((flag&4)>>1));
|
||||
Xorriso_process_msg_queues(xorriso,0);
|
||||
if(ret<=0) {
|
||||
sprintf(xorriso->info_text,"Cannot aquire drive '%s'", adr);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
}
|
||||
drive= dinfo[0].drive;
|
||||
@ -497,7 +498,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
if(flag&2) {
|
||||
xorriso->out_drive_handle= dinfo;
|
||||
if(Sfile_str(xorriso->outdev, adr, 0)<=0)
|
||||
return(-1);
|
||||
{ret= -1; goto ex;}
|
||||
if(state != BURN_DISC_BLANK && state != BURN_DISC_APPENDABLE) {
|
||||
sprintf(xorriso->info_text, "Disc status unsuitable for writing");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
|
||||
@ -507,13 +508,13 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
if(flag&1) {
|
||||
xorriso->in_drive_handle= dinfo;
|
||||
if(Sfile_str(xorriso->indev, adr, 0)<=0)
|
||||
return(-1);
|
||||
{ret= -1; goto ex;}
|
||||
} else if(flag&2) {
|
||||
if(xorriso->in_volset_handle==NULL) {
|
||||
/* No volume loaded: create empty one */
|
||||
ret= Xorriso_create_empty_iso(xorriso, 0);
|
||||
if(ret<=0)
|
||||
return(ret);
|
||||
goto ex;
|
||||
} else {
|
||||
iso_image_ref((IsoImage *) xorriso->in_volset_handle);
|
||||
ret= isoburn_attach_image(drive, (IsoImage *) xorriso->in_volset_handle);
|
||||
@ -521,11 +522,11 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
sprintf(xorriso->info_text,
|
||||
"Failed to attach ISO image object to outdev");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
|
||||
return(-1);
|
||||
{ret= -1; goto ex;}
|
||||
}
|
||||
}
|
||||
Xorriso_toc(xorriso, 1|2);
|
||||
return(1+not_writeable);
|
||||
{ret= 1+not_writeable; goto ex;}
|
||||
}
|
||||
|
||||
if(xorriso->in_volset_handle!=NULL)
|
||||
@ -538,12 +539,12 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
||||
sprintf(xorriso->info_text,
|
||||
"Disc status not blank and unsuitable for reading");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
||||
return(0);
|
||||
{ret= 0; goto ex;}
|
||||
}
|
||||
/* fill read opts */
|
||||
ret= isoburn_ropt_new(&ropts, 0);
|
||||
if(ret<=0)
|
||||
return(ret);
|
||||
goto ex;
|
||||
isoburn_ropt_set_extensions(ropts, isoburn_ropt_noiso1999);
|
||||
isoburn_ropt_set_default_perms(ropts, (uid_t) 0, (gid_t) 0, (mode_t) 0555);
|
||||
isoburn_ropt_set_input_charset(ropts, NULL);
|
||||
@ -606,7 +607,8 @@ ex:
|
||||
if(hret<ret)
|
||||
ret= hret;
|
||||
}
|
||||
isoburn_ropt_destroy(&ropts, 0);
|
||||
if(ropts!=NULL)
|
||||
isoburn_ropt_destroy(&ropts, 0);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@ -799,14 +801,17 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
|
||||
if(ret<=0)
|
||||
return(0);
|
||||
|
||||
if(xorriso->out_drive_handle == xorriso->in_drive_handle ||
|
||||
xorriso->in_drive_handle == NULL) {
|
||||
if(xorriso->out_drive_handle == xorriso->in_drive_handle) {
|
||||
source_drive= drive;
|
||||
} else {
|
||||
ret= Xorriso_get_drive_handles(xorriso, &source_dinfo, &source_drive,
|
||||
"on attempt to get source for write", 0);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
if(xorriso->in_drive_handle == NULL) {
|
||||
source_drive= drive;
|
||||
} else {
|
||||
ret= Xorriso_get_drive_handles(xorriso, &source_dinfo, &source_drive,
|
||||
"on attempt to get source for write", 0);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
}
|
||||
s= isoburn_disc_get_status(drive);
|
||||
if(s!=BURN_DISC_BLANK) {
|
||||
s= burn_disc_get_status(drive);
|
||||
|
Reference in New Issue
Block a user