aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/xinstall/tests
Commit message (Collapse)AuthorAgeFilesLines
* install: Expect EINTR while copyingDag-Erling Smørgrav2026-02-111-0/+38
| | | | | | | | | | | | | | | Both copy_file_range() and read() / write() in our fallback loop can be interrupted before copying anything at all, in which case it returns -1 and sets errno to EINTR. If that happens, we should retry, not fail. While here, drop the size argument from copy() (we always want to copy the entire file anyway) and add test cases which exercise the metalog and digest functionality. PR: 293028 MFC after: 1 week Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D55168
* install: print directory name instead of file name if mkstemp failsAhmad Khalifa2024-11-291-0/+10
| | | | | | | | | | | Printing the file name doesn't make sense since mkstemp failing means that the file wasn't created. Also add a test case for this. Co-authored-by: Jose Luis Duran <jlduran@gmail.com> Reviewed by: imp,jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1383
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* install: Simplify path construction.Dag-Erling Smørgrav2024-04-121-0/+8
| | | | | | | | | | | | | | | There's no need to copy the path twice to split it into base and dir. We simply call `basename()` first, then handle the two trivial cases in which it isn't safe to call `dirname()`. While here, add an early check that the destination is not an empty string. This would always fail eventually, so it may as well fail right away. Also add a test case for this shortcut. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D44743
* install: handle -m +X more accuratelyKyle Evans2023-10-191-0/+16
| | | | | | | | | | | | | | As described by chmod(1), +X in the mode may be used to optionally set the +x bit if the file is a directory if any of the execute/search bits are set in the original mode. The latter is not applicable because we assume -m is a fresh mask, but a functional +X could be useful in the former case if we're passing along a common INSTALL_MODE that's designed to install either 0644 or 0755 depending simply on whether it's a directory or not. Reviewed by: des Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D42273
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-163-3/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* xinstall: fix dounpriv logic, add testsDag-Erling Smørgrav2022-08-031-0/+80
| | | | | Sponsored by: Klara, Inc. MFC after: 1 week
* Fix the tests for install(1): add support for STRIPBIN's -o option.Eugene Grosbein2020-07-101-2/+6
| | | | | | | | Reported by: lwhsu MFC after: 1 week Notes: svn path=/head/; revision=363088
* install(1): Fix relative path calculation with partial common dest/srcKyle Evans2019-01-311-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | For example, from the referenced PR [1]: $ mkdir /tmp/lib/ /tmp/libexec $ touch /tmp/lib/foo.so $ install -lrs /tmp/lib/foo.so /tmp/libexec/ The common path identification bits terminate src at /tmp/lib/ and the destination at /tmp/libe. The subsequent backtracking is then incorrect, as it traverses the destination and backtraces exactly one level while eating the 'libexec' because it was previously (falsely) identified as common with 'lib'. The obvious fix would be to make sure we've actually terminated just after directory separators and rewind a character if we haven't. In the above example, we would end up rewinding to /tmp/ and subsequently doing the right thing. Test case added. PR: 235330 [1] MFC after: 1 week Notes: svn path=/head/; revision=343601
* Restore some of the error message text accidentally removed in r315098Enji Cooper2017-03-121-2/+2
| | | | | | | | | | | | "unexpected symlink contents" is more pedantically correct than "unexpected symlink". MFC after: 1 week X-MFC with: r315098 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315108
* Add 3 more testcases demonstrating how install -l sr worksEnji Cooper2017-03-121-0/+66
| | | | | | | | | | | | | | | The additional testcases use absolute paths for sources and targets, as the other testcase which tested `-l sr` used flat relative paths in the same directory. Please note that these testcases do not test `-l a` -- that's already addressed in the battery of tests. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315106
* Clarify src vs dest path mismatch in :symbolic_link_{absolute,relative}_bodyEnji Cooper2017-03-121-2/+10
| | | | | | | | | | | | | | Unfortunately kyua does not omit the path mismatch on failure, so it must be coded into the error message. Cache the values, run the test(1) call, then print out the values in an atf_fail call to emit the required diagnostics to debug why things are failing. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315098
* DIRDEPS_BUILD: Add some missing dirctories to the build.Bryan Drewery2016-08-311-0/+11
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=305148
* install: When preserving timestamps, also copy the nanoseconds part.Jilles Tjoelker2016-06-091-0/+7
| | | | | | | | | Now that we have utimensat in -legacy, install(1) can use it. This is a revert of r299942 which is itself a revert of r299850. Notes: svn path=/head/; revision=301765
* install: Revert utimensat usage (r299850).Jilles Tjoelker2016-05-161-7/+0
| | | | | | | | | | | | This should fix the build on older stable/10, since install is a bootstrap tool. Pending a decision how to fix this properly, revert utimensat usage. Copies with the -p option will again appear older than the original almost always, but -p is not commonly used. Notes: svn path=/head/; revision=299942
* install: When preserving timestamps, also copy the nanoseconds part.Jilles Tjoelker2016-05-151-0/+7
| | | | Notes: svn path=/head/; revision=299850
* install: Add some tests.Jilles Tjoelker2016-05-082-0/+343
Notes: svn path=/head/; revision=299244