]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r363064,363067,363081,363136: optimize install(1) a bit.
authorEugene Grosbein <eugen@FreeBSD.org>
Tue, 11 Aug 2020 11:32:44 +0000 (11:32 +0000)
committerEugene Grosbein <eugen@FreeBSD.org>
Tue, 11 Aug 2020 11:32:44 +0000 (11:32 +0000)
commit444239efbca0bd308d1c8d242c052573fd818e6f
tree17a3e4eb4e58129bcf0a99035325d45396990d71
parent64d666b7ccc97aa4104b3110abd0da7c7ec67ccd
MFC r363064,363067,363081,363136: optimize install(1) a bit.

Currently, "install -s -S" behaviour is inefficient for upgrade.
First it finds that destination file already exists and copies
source file to temporary file. Then it calls strip(1)
with name of temporary file as single agrument and our strip(1) creates
another temporary file in the /tmp (or TMPDIR) making another copy
that is finally copied to DESTDIR third time.

Meantime, strip(1) has an option "-o dst" to specify destination
so install(1) is allowed to skip initial copying from obj to DESTDIR.
This change makes it do so.

This optimization descreases total amount of data sent to
both of /tmp and DESTDIR during "make installworld" by 32% or so.
See the differential for details.

Differential Revision: https://reviews.freebsd.org/D25551
usr.bin/xinstall/xinstall.c