New option -update (not yet completed)
This commit is contained in:
@ -1433,7 +1433,9 @@ int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf,
|
||||
}
|
||||
|
||||
|
||||
/* @param flag bit0= recursion is active */
|
||||
/* @param flag bit0= recursion is active
|
||||
bit1= do not report added files
|
||||
*/
|
||||
int Xorriso_add_tree(struct XorrisO *xorriso, IsoDir *dir,
|
||||
char *img_dir_path, char *disk_dir_path,
|
||||
struct LinkiteM *link_stack, int flag)
|
||||
@ -1668,7 +1670,7 @@ cannot_lstat:;
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||
} else {
|
||||
ret= Xorriso_add_tree(xorriso, (IsoDir *) node,
|
||||
img_path, disk_path, own_link_stack, 1);
|
||||
img_path, disk_path, own_link_stack, 1|(flag&2));
|
||||
}
|
||||
if(ret<=0)
|
||||
goto was_problem;
|
||||
@ -1754,7 +1756,28 @@ int Xorriso_copy_implict_properties(struct XorrisO *xorriso, IsoDir *dir,
|
||||
}
|
||||
|
||||
|
||||
/* @param bit0= copy link target properties rather than link properties
|
||||
*/
|
||||
int Xorriso_copy_properties(struct XorrisO *xorriso,
|
||||
char *disk_path, char *img_path, int flag)
|
||||
{
|
||||
int ret;
|
||||
IsoNode *node;
|
||||
struct stat stbuf;
|
||||
|
||||
ret= Xorriso_get_node_by_path(xorriso, img_path, NULL, &node, 0);
|
||||
if(ret<=0)
|
||||
return(ret);
|
||||
if(lstat(disk_path, &stbuf)==-1)
|
||||
return(0);
|
||||
Xorriso_transfer_properties(xorriso, &stbuf, node, 0);
|
||||
xorriso->volset_change_pending= 1;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/** @param flag bit0= mkdir: graft in as empty directory, not as copy from disk
|
||||
bit1= do not report added files
|
||||
@return <=0 = error , 1 = added simple node , 2 = added directory */
|
||||
int Xorriso_graft_in(struct XorrisO *xorriso, char *disk_path, char *img_path,
|
||||
int flag)
|
||||
@ -1914,8 +1937,6 @@ handle_path_node:;
|
||||
iso_node_set_uid((IsoNode *) dir, geteuid());
|
||||
iso_node_set_gid((IsoNode *) dir, getegid());
|
||||
|
||||
/* >>> copy properties from correspondent directory in disk_path
|
||||
if there is any */;
|
||||
if(!done)
|
||||
Xorriso_copy_implict_properties(xorriso, dir, img_path, path, disk_path,
|
||||
0);
|
||||
@ -1924,7 +1945,7 @@ handle_path_node:;
|
||||
if(done) {
|
||||
attach_source:;
|
||||
xorriso->pacifier_count++;
|
||||
if(xorriso->pacifier_count%100)
|
||||
if(xorriso->pacifier_count%100 && !(flag&2))
|
||||
Xorriso_pacifier_callback(xorriso, "files added",
|
||||
xorriso->pacifier_count,
|
||||
xorriso->pacifier_total, "", 0);
|
||||
@ -1933,7 +1954,7 @@ attach_source:;
|
||||
|
||||
} else if(is_dir) {
|
||||
Xorriso_transfer_properties(xorriso, &stbuf, (IsoNode *) dir, 0);
|
||||
ret= Xorriso_add_tree(xorriso, dir, img_path, disk_path, NULL, 0);
|
||||
ret= Xorriso_add_tree(xorriso, dir, img_path, disk_path, NULL, flag&2);
|
||||
if(ret<=0)
|
||||
return(ret);
|
||||
|
||||
|
Reference in New Issue
Block a user