From da45d5bc8ce7b06dbc8af4f7eaa53552ee198db0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 6 Jun 2008 10:37:13 +0000 Subject: [PATCH] Fine tuning of directory attribute copying with -cp_rx --- libisoburn/trunk/xorriso/xorriso.1 | 8 ++++++-- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- libisoburn/trunk/xorriso/xorrisoburn.c | 10 +++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libisoburn/trunk/xorriso/xorriso.1 b/libisoburn/trunk/xorriso/xorriso.1 index e9192353..bb382efd 100644 --- a/libisoburn/trunk/xorriso/xorriso.1 +++ b/libisoburn/trunk/xorriso/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 "Jun, 5, 2008" +.TH XORRISO 1 "Jun, 6, 2008" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -53,6 +53,8 @@ filesystem objects. Can write result as add-on session to appendable multi-session media, to overwriteable media, to regular files, and to block devices. .br +Can copy files from ISO image to disk filesystem. +.br Scans for optical drives, blanks re-useable optical media. .br 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. If directories do already exist under disk_path then their content 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. .TP \fB\-cp_rax\fR iso_rr_path [***] disk_path diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index e41f7fad..9e8c9237 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.06.06.083432" +#define Xorriso_timestamP "2008.06.06.103735" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index 81bdf8b8..2a40ab91 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -3147,7 +3147,7 @@ int Xorriso_restore(struct XorrisO *xorriso, char path[SfileadrL], *apt, *npt, sfe[5*SfileadrL]; IsoNode *node= NULL; 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 PermiteM *perm_stack_mem; @@ -3225,6 +3225,7 @@ int Xorriso_restore(struct XorrisO *xorriso, stbuf_ret= -1; /* now it is removed */ } } + new_dir_made= 0; if(stbuf_ret==-1 && (source_is_dir && !source_is_split)) { /* make a directory */ ret= mkdir(path, 0777); @@ -3243,6 +3244,7 @@ int Xorriso_restore(struct XorrisO *xorriso, Xorriso_restore_implicit_properties(xorriso, disk_path, path, img_path, 4); } + new_dir_made= 1; } else if(source_is_dir && !source_is_split) { /* >>> If owner: eventually try to obtain rwx-permssions, stack path */; @@ -3255,13 +3257,15 @@ attach_source:; /* directory was created above */; } 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)) { ret= Xorriso_restore_tree(xorriso, (IsoDir *) node, img_path, path, (off_t) 0, NULL, flag&(2|64)); if(ret<=0) 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); } } else {