Bug 199466 - cp(1) should accept -P without -R as well per POSIX.1-2008 or like GNU cp
Summary: cp(1) should accept -P without -R as well per POSIX.1-2008 or like GNU cp
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-standards (Nobody)
URL: http://pubs.opengroup.org/stage7tc1/u...
Depends on:
Reported: 2015-04-15 13:06 UTC by Jan Beich
Modified: 2021-04-27 18:27 UTC (History)
1 user (show)

See Also:

cp(1): Make -P work independantly of -R (2.05 KB, patch)
2021-04-21 19:28 UTC, Cameron Katri
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2015-04-15 13:06:55 UTC
2013 edition clarifies the meaning of -P outside of -R context, mainly

  cp [-Pfip] source_file target_file
  cp [-Pfip] source_file... target

  If the -R option was not specified, cp shall take actions based on the type and contents of the file referenced by the symbolic link, and not by the symbolic link itself, unless the -P option was specified.

Note, in GNU cp -P (--no-dereference) always worked outside of -R (--recursive).
Comment 1 Cameron Katri 2021-04-21 19:28:55 UTC
Created attachment 224339 [details]
cp(1): Make -P work independantly of -R

This patch should fix it.
Comment 2 Cameron Katri 2021-04-27 18:27:16 UTC
I forgot to update the date in the manpage in my previous patch, here is one with that fixed, https://reviews.freebsd.org/D30012.