Page MenuHomeFreeBSD

add -e flag to install(1)
Needs RevisionPublic

Authored by swills on Mar 8 2018, 4:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 11:49 AM
Unknown Object (File)
Wed, May 8, 11:49 AM
Unknown Object (File)
Wed, May 8, 11:49 AM
Unknown Object (File)
Wed, May 8, 11:49 AM
Unknown Object (File)
Wed, May 8, 9:41 AM
Unknown Object (File)
Fri, Apr 19, 2:51 PM
Unknown Object (File)
Dec 22 2023, 9:51 PM
Unknown Object (File)
Aug 25 2023, 4:20 AM

Details

Reviewers
brooks
0mp
Group Reviewers
manpages
Summary

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

Test Plan

Build test fine, may want ports exp-run, although ports calls install as root user by default, so shouldn't trigger an issue. May need manual testing.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 15443

Event Timeline

Looks good to me. -e doesn't conflict with Linux.

This revision is now accepted and ready to land.Mar 8 2018, 7:48 PM

Oh install.1 needs a .Dd bump.

This revision now requires review to proceed.Mar 8 2018, 9:35 PM

Clarify that error can be produced for failure to set owner or mode.

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.

0mp requested changes to this revision.Aug 22 2018, 9:58 AM
0mp added a subscriber: 0mp.

What's the status of this change?

This revision now requires changes to proceed.Aug 22 2018, 9:58 AM

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.