Re: git: a1bff97300ab - main - release: Don't reuse disc1/bootonly directories

From: Jessica Clarke <jrtc27_at_freebsd.org>
Date: Wed, 10 Apr 2024 16:57:57 UTC
On 10 Apr 2024, at 17:48, Mark Millard <marklmi@yahoo.com> wrote:
> 
> Jessica Clarke <jrtc27_at_freebsd.org> wrote on
> Date: Wed, 10 Apr 2024 05:18:23 UTC :
> 
>> On 10 Apr 2024, at 04:29, Colin Percival <cperciva@FreeBSD.org> wrote:
>>> 
>>> . . .
>>> 
>>> +disc1-disc1 disc1-memstick: disc1
>>> + mkdir ${.TARGET}
>>> + tar -cf- -C disc1 . | tar -xf- -C ${.TARGET}
>> 
>> What’s wrong with cp -a?
> 
> A possibility from "man cp":
> 
> QUOTE
>           Note that cp copies hard linked files as separate files.  If you
>           need to preserve hard links, consider using tar(1), cpio(1), or
>           pax(1) instead.
> END QUOTE
> 
> cp should be avoided if there might be hard links involved on the source materials
> that should be preserved in the destination material produced.

Fair enough then.

>> Besides, shouldn’t this use -p if using tar?
> 
> 
> (I'm not commenting on the above.)
> 
>> 
>> And -f- is the same as nothing.
> 
> "man tar" reports the deafult as /dev/sa0 on FreeBSD:
> 
> QUOTE
>     -f file, --file file
>             Read the archive from or write the archive to the specified file.
>             The filename can be - for standard input or standard output.  The
>             default varies by system; on FreeBSD, the default is /dev/sa0; on
>             Linux, the default is /dev/st0.
> END QUOTE

I dug some more, and the documentation is incomplete:

* If TAPE is set in the environment it will use that.
* Otherwise, if _PATH_DEFTAPE (the default documented there) can be
  accessed per access(2) it will use that.
* Otherwise it will use stdin/stdout.

Since most people don’t set TAPE, nor do they have a tape device
present, this effectively means that no -f means -f -, but technically
one should not rely on this. So TIL.

Jess