Submit #2988
closedcpdup should ignore UF_ARCHIVE when deciding whether to copy a file
0%
Description
On operating systems that support it (including Illumos, FreeBSD, and Windows), the UF_ARCHIVE flag means that a file needs to be archived. Filesystems that support this flag (including msdosfs and ZFS) will set it automatically when the file is created.
When deciding whether to copy a file, cpdup should ignore the UF_ARCHIVE file flag. If that flag is supported by the destination file system but it's cleared on a source file, then multiple invocations of cpdup would all copy the source file because its flags wouldn't match. OTOH, if the destination filesystem doesn't support UF_ARCHIVE, then there's no point in cpdup setting it.
Steps to reproduce, using ZFS on FreeBSD:
$ mkdir src dst
$ touch src/foo
$ chflags 0 src/foo
$ cpdup -v src dst
dst/foo copy-ok
$ cpdup -v src dst
dst/foo copy-ok
Files