svn commit: r378660 - projects/rework-dependency-registration/Mk/Scripts
Baptiste Daroussin
bapt at FreeBSD.org
Sun Feb 8 15:00:58 UTC 2015
Author: bapt
Date: Sun Feb 8 15:00:57 2015
New Revision: 378660
URL: https://svnweb.freebsd.org/changeset/ports/378660
QAT: https://qat.redports.org/buildarchive/r378660/
Log:
Nuke the realpath from find-lib allowing /usr/local to be a symlink
For now this is a copy/paste from actual-package-depends.sh, probably moved into
a shared function once the exp-run shows everything is ok
Modified:
projects/rework-dependency-registration/Mk/Scripts/find-lib.sh
Modified: projects/rework-dependency-registration/Mk/Scripts/find-lib.sh
==============================================================================
--- projects/rework-dependency-registration/Mk/Scripts/find-lib.sh Sun Feb 8 14:49:23 2015 (r378659)
+++ projects/rework-dependency-registration/Mk/Scripts/find-lib.sh Sun Feb 8 15:00:57 2015 (r378660)
@@ -14,9 +14,48 @@ fi
lib=$1
dirs="${LIB_DIRS} `cat ${LOCALBASE}/libdata/ldconfig/* 2>/dev/null || :`"
+resolv_symlink() {
+ local file tgt
+ file=${1}
+ if [ ! -L ${file} ] ; then
+ echo ${file}
+ return
+ fi
+
+ tgt=`readlink ${file}`
+ case $tgt in
+ /*)
+ echo $tgt
+ return
+ ;;
+ esac
+
+ file=${file%/*}/${tgt}
+ absolute_path ${file}
+}
+
+absolute_path() {
+ local file myifs target
+ file=$1
+
+ myifs=${IFS}
+ IFS='/'
+ set -- ${file}
+ IFS=${myifs}
+ for el; do
+ case $el in
+ .) continue ;;
+ '') continue ;;
+ ..) target=${target%/*} ;;
+ *) target="${target}/${el}" ;;
+ esac
+ done
+ echo ${target}
+}
+
for libdir in ${dirs} ; do
test -f ${libdir}/${lib} || continue
- libfile=`realpath ${libdir}/${lib}`
+ libfile=`absolute_path ${libdir}/${lib}`
[ `file -b -L --mime-type ${libfile}` = "application/x-sharedlib" ] || continue
echo $libfile
break
More information about the svn-ports-all
mailing list