diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-05-05 09:24:48 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-05-09 11:43:27 +0200 |
commit | 591ea91ea8d0294d8afad7b95878f8f285d8ad82 (patch) | |
tree | 87a7bbe68054843aed11fc1b7cb8c8f2bcefd85c /scripts | |
parent | c095730c607f17f9f62277378bb2b69f068f45ef (diff) | |
download | ptxdist-591ea91ea8d0294d8afad7b95878f8f285d8ad82.tar.gz ptxdist-591ea91ea8d0294d8afad7b95878f8f285d8ad82.tar.xz |
install_link: relax absolute link handling
so far installing absolute links was not allowed. This change makes
it possible and add a setup option to transform absolute links into
relative links when installing to nfsroot
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_pkg.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh index 78fec97c6..38c0a40fe 100644 --- a/scripts/lib/ptxd_make_xpkg_pkg.sh +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh @@ -238,7 +238,7 @@ ptxd_install_ln() { local usr="${3:-0}" local grp="${4:-0}" local -a dirs ndirs pdirs sdirs - local mod_nfs mod_rw + local mod_nfs mod_rw rel echo "\ install link: @@ -249,15 +249,20 @@ install link: ptxd_install_setup && case "${src}" in - /*) echo "Error: absolute link detected, please fix!" - return 1 + /*) + if [ "${PTXCONF_SETUP_NFS_REL_SYMLINK}" = "y" ]; then + rel="$(dirname "${dst}" | sed -e 's,/[^/]*,/..,g' -e 's,^/,,')" + fi ;; *) ;; esac && rm -f "${dirs[@]/%/${dst}}" && install -d "${dirs[@]/%/$(dirname "${dst}")}" && - for d in "${dirs[@]/%/${dst}}"; do + for d in "${ndirs[@]/%/${dst}}"; do + ln -s "${rel}${src}" "${d}" || return + done && + for d in "${pdirs[@]/%/${dst}}"; do ln -s "${src}" "${d}" || return done && |