diff options
author | Bertrand Jacquin <bertrand@jacquin.bzh> | 2019-09-27 00:27:12 +0100 |
---|---|---|
committer | Bertrand Jacquin <bertrand@jacquin.bzh> | 2019-09-27 00:29:36 +0100 |
commit | 4f93b4b8c1c723c6e4e374c6a10f952355c45ec4 (patch) | |
tree | 407689bc2ac10c2bb922bb43f79c15c8e5b1554a | |
parent | t,p (diff) | |
download | portage-4f93b4b8c1c723c6e4e374c6a10f952355c45ec4.tar.xz |
profiles/common: install own symlinks as symlinks
-rw-r--r-- | profiles/common/profile.bashrc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/profiles/common/profile.bashrc b/profiles/common/profile.bashrc index 461440c2..2726dc9c 100644 --- a/profiles/common/profile.bashrc +++ b/profiles/common/profile.bashrc @@ -262,13 +262,19 @@ function __install_own_file () { fi einfo "Install ${REPLY} from factory-default" - install -D -m 0644 \ - "${_FACTORY_DIRECTORY}/${REPLY}" \ - "${_ed}/${REPLY}" \ - || die + if [[ -f "${_FACTORY_DIRECTORY}/${REPLY}" ]] ; then + install -D -m 0644 \ + "${_FACTORY_DIRECTORY}/${REPLY}" \ + "${_ed}/${REPLY}" \ + || die - chmod --reference="${_FACTORY_DIRECTORY}/${REPLY}" "${_ed}/${REPLY}" \ - || die + chmod --reference="${_FACTORY_DIRECTORY}/${REPLY}" "${_ed}/${REPLY}" \ + || die + elif [[ -L "${_FACTORY_DIRECTORY}/${REPLY}" ]] ; then + cp -P "${_FACTORY_DIRECTORY}/${REPLY}" \ + "${_ed}/${REPLY}" \ + || die + fi done } |