Page MenuHomeFreeBSD

ln: add -r option, fix certctl DESTDIR support and the caroot post-install script
AbandonedPublic

Authored by kevans on Feb 6 2020, 4:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 2 2023, 12:17 PM
Unknown Object (File)
Sep 29 2023, 10:00 AM
Unknown Object (File)
Aug 8 2023, 5:41 PM
Unknown Object (File)
Aug 2 2023, 6:23 PM
Unknown Object (File)
Jul 15 2023, 10:22 PM
Unknown Object (File)
Jul 14 2023, 8:39 PM
Unknown Object (File)
Jun 10 2023, 9:40 PM
Unknown Object (File)
May 20 2023, 3:09 PM

Details

Reviewers
arichardson
brooks
bapt
Group Reviewers
pkgbase
manpages
Summary

Highlights:

  • Rip relative path calculation bits out of xinstall, push it into libutil as relpath(3); link xinstall against libutil
  • Use relpath(3) to implement ln -r, create relative symlink (matches similar argument to GNU ln)
  • Fix DESTDIR support for certctl(8) using the newly added ln -r
  • Finally, fix the caroot package's post-install script to honor PKG_ROOTDIR, which will also now actually work because we're installing relative symlinks

I opted to add -r to ln(1) instead of just using install(1) because it's a useful addition anyways, and a lib'ified relpath(3) is also useful.

Diff Detail

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

Event Timeline

bcr added a subscriber: bcr.

OK from manpages.

Change looks fine to me.

For crossbuilding: It seems like macos ln doesn't support ln -r so we should avoid making future changes that use ln -r in build scripts. I guess otherwise we could bootstrap ln on macos, which should also work.

For crossbuilding: It seems like macos ln doesn't support ln -r so we should avoid making future changes that use ln -r in build scripts. I guess otherwise we could bootstrap ln on macos, which should also work.

Hmm...certctl may be ran as a standard part of mergemaster/etcupdate. Do we assume these have a chance of working on, e.g., MacOS?

For crossbuilding: It seems like macos ln doesn't support ln -r so we should avoid making future changes that use ln -r in build scripts. I guess otherwise we could bootstrap ln on macos, which should also work.

Hmm...certctl may be ran as a standard part of mergemaster/etcupdate. Do we assume these have a chance of working on, e.g., MacOS?

I have never tried that, I always create a clean rootfs. I'm not sure it makes sense to run mergemaster or etcupdate when cross-building.

Re-roll diff, actually include the relpath(3) definition; though it's largely a copy/paste of what was in xinstall

ln(1) -r should ideally not error out if we're creating a link to a file that doesn't exist -- we can't do that at the moment, because it's using realpath(3) on it. Switching certctl to install(1) instead