Hi, Quoting Benjamin Drung (2020-01-07 10:35:24) > I had another idea (without need for wildcard support) and wrote a patch for > it (attached). Enhance the copy-out and tar-out commands to implement the > behavior of rsync: Atrailing slash on the source changes this behavior to > avoid creating an additional directory level at the destination. You can > think of a trailing / on a source as meaning "copy the contents of this > directory" as opposed to "copy the directory by name", but in both cases the > attributes of the containing directory are transferred to the containing > directory on the destination.
hrm... I think, since the existing commands come from guestfish, it would make sense to keep their semantics and not introduce surprising subtleties like this. Specifically, the trailing slash in source and target directories has a number of surprising side effects, depending on the tool (cp, mv, rsync). I would not like to add to this confusion by writing a tool myself that adds another special meaning. Another reason against changing the semantics of copy-out like you propose would be that the cp command does not work that way and thus this might lead to surprising bugs. Instead what I would rather suggest is to add a new set of commands, maybe called sync-out and sync-in which treat the trailing slashes like rsync does and are thus named like that. But I'm not sure whether it is worth adding a new special command just to avoid executing one more hook command. I'll think about it. Thanks! cheers, josch
signature.asc
Description: signature