Am Dienstag, den 07.01.2020, 13:29 +0100 schrieb Johannes Schauer:
> 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.

After thinking about it, I like your idea to introduce sync-out/sync-in 
commands that follows rsyncs behavior.

> 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.

It's more than that for my use case. Our build system is extensible.
The base takes care of the copy-out of stuff that should be extracted.
The build can be extended and tools can write files into the directory
that will be copied out. So I don't have a list of files in there.

-- 
Benjamin Drung

System Developer and Debian & Ubuntu Developer
Platform Engineering Compute (IONOS Cloud)

1&1 IONOS SE | Greifswalder Str. 207 | 10405 Berlin | Germany
E-mail: benjamin.dr...@cloud.ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498
Vorstand: Dr. Christian Böing, Hüseyin Dogan, Hans-Henning Kettler,
Matthias Steinberg, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke
Member of United Internet

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to