MageSlayer / paludis-gentoo-patches

Unofficial Gentoo patches for Paludis package manager
GNU General Public License v2.0
14 stars 7 forks source link

EAPI=8: implement -r (relative) option to dosym. #67

Closed Ionic closed 1 year ago

Ionic commented 1 year ago

The dosym utility now supports an optional parameter to automatically convert a symlink into a relative representation, which is very useful for symlinks within chroots and other scenarios.

PMS specifies that the algorithm should return a path equivalent to the following shell function (using tools from GNU coreutils 8.32):

dosym_relative_path() {
  local link=$(realpath -m -s "/${2#/}")
  local linkdir=$(dirname "${link}")
  realpath -m -s --relative-to="${linkdir}" "$1"
}

Merging without a merge commit.