This adds a -e flag to install(1) which will cause it to error if it fails to install the file with the owner/permissions requested. This is an updated version of the patch from vwe@ for bugzilla PR 139314
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 15439
Event Timeline
This patch only affects the -d case. Failure to change owner and modes when installing regular files is fatal in any case. Perhaps the directory case should work the same way?
Also note that instantly exiting is not the usual way to handle errors on single files in POSIX utilities (which install admittedly is not). Utilities like cp and rm continue with the next file after an error on a file; the final exit status reflects whether there was any error.
usr.bin/xinstall/install.1 | ||
---|---|---|
127–130 | Contractions tend not to be used in man pages. The textproc/igor tool may be helpful to find this and other issues. |
I would like to see a consistent behaviour in handling chown/chmod failures between creating directories and installing files. A -e flag looks ugly and should only be added if both behaviours are necessary in different situations.