Fine tuning of directory attribute copying with -cp_rx

This commit is contained in:
Thomas Schmitt 2008-06-06 10:37:13 +00:00
parent 1b6be38928
commit da45d5bc8c
3 changed files with 14 additions and 6 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 "Jun, 5, 2008" .TH XORRISO 1 "Jun, 6, 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:
@ -53,6 +53,8 @@ filesystem objects.
Can write result as add-on session to appendable multi-session media, Can write result as add-on session to appendable multi-session media,
to overwriteable media, to regular files, and to block devices. to overwriteable media, to regular files, and to block devices.
.br .br
Can copy files from ISO image to disk filesystem.
.br
Scans for optical drives, blanks re-useable optical media. Scans for optical drives, blanks re-useable optical media.
.br .br
Reads its instructions from command line arguments, dialog, and batch files. Reads its instructions from command line arguments, dialog, and batch files.
@ -1658,7 +1660,9 @@ ownership and group as in ISO image.
Like -cpx but also extracting whole directory trees from the ISO image. Like -cpx but also extracting whole directory trees from the ISO image.
If directories do already exist under disk_path then their content If directories do already exist under disk_path then their content
eventually gets merged with the content of restored directories eventually gets merged with the content of restored directories
of the same name. Disk files get removed only if they are to be replaced of the same name. Directory attributes get extracted only if the disk
directory is newly created by the restore operation.
Disk files get removed only if they are to be replaced
by file objects from the ISO image. by file objects from the ISO image.
.TP .TP
\fB\-cp_rax\fR iso_rr_path [***] disk_path \fB\-cp_rax\fR iso_rr_path [***] disk_path

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.06.06.083432" #define Xorriso_timestamP "2008.06.06.103735"

View File

@ -3147,7 +3147,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
char path[SfileadrL], *apt, *npt, sfe[5*SfileadrL]; char path[SfileadrL], *apt, *npt, sfe[5*SfileadrL];
IsoNode *node= NULL; IsoNode *node= NULL;
int done= 0, is_dir= 0, ret, target_is_dir, source_is_dir, stbuf_ret, hret; int done= 0, is_dir= 0, ret, target_is_dir, source_is_dir, stbuf_ret, hret;
int leaf_is_split= 0, source_is_split= 0; int leaf_is_split= 0, source_is_split= 0, new_dir_made= 0;
struct stat stbuf, target_stbuf; struct stat stbuf, target_stbuf;
struct PermiteM *perm_stack_mem; struct PermiteM *perm_stack_mem;
@ -3225,6 +3225,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
stbuf_ret= -1; /* now it is removed */ stbuf_ret= -1; /* now it is removed */
} }
} }
new_dir_made= 0;
if(stbuf_ret==-1 && (source_is_dir && !source_is_split)) { if(stbuf_ret==-1 && (source_is_dir && !source_is_split)) {
/* make a directory */ /* make a directory */
ret= mkdir(path, 0777); ret= mkdir(path, 0777);
@ -3243,6 +3244,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
Xorriso_restore_implicit_properties(xorriso, disk_path, path, Xorriso_restore_implicit_properties(xorriso, disk_path, path,
img_path, 4); img_path, 4);
} }
new_dir_made= 1;
} else if(source_is_dir && !source_is_split) { } else if(source_is_dir && !source_is_split) {
/* >>> If owner: eventually try to obtain rwx-permssions, stack path */; /* >>> If owner: eventually try to obtain rwx-permssions, stack path */;
@ -3255,13 +3257,15 @@ attach_source:;
/* directory was created above */; /* directory was created above */;
} else if(is_dir && !source_is_split) { } else if(is_dir && !source_is_split) {
Xorriso_restore_properties(xorriso, disk_path, node, 2 | !!(flag&64)); if(new_dir_made) /* keep open and push to Permstack */
Xorriso_restore_properties(xorriso, disk_path, node, 2 | !!(flag&64));
if(!(flag&32)) { if(!(flag&32)) {
ret= Xorriso_restore_tree(xorriso, (IsoDir *) node, img_path, path, ret= Xorriso_restore_tree(xorriso, (IsoDir *) node, img_path, path,
(off_t) 0, NULL, flag&(2|64)); (off_t) 0, NULL, flag&(2|64));
if(ret<=0) if(ret<=0)
goto ex; goto ex;
if(!(flag&64)) /* set timestamps which Permstack_pop() will not set */ if(new_dir_made && !(flag&64))
/* set timestamps which Permstack_pop() will not set */
Xorriso_restore_properties(xorriso, disk_path, node, 2); Xorriso_restore_properties(xorriso, disk_path, node, 2);
} }
} else { } else {