[PC-BSD Commits] r14021 - pcbsd/current/src-sh/pbi-manager
svn at pcbsd.org
svn at pcbsd.org
Wed Nov 23 05:50:34 PST 2011
Author: kris
Date: 2011-11-23 05:50:13 -0800 (Wed, 23 Nov 2011)
New Revision: 14021
Modified:
pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:
Revert a commit to use "realpath" turns out its not quite robust enough for how we use get_abspath
Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager 2011-11-23 10:14:22 UTC (rev 14020)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager 2011-11-23 13:50:13 UTC (rev 14021)
@@ -1227,9 +1227,15 @@
chmod 664 ${PBI_DBDIRTYFILE}
}
-# Get the absolute path of a dir
+# Get the absolute path of a dir, even a realative dir. 'realpath' doesn't work here
get_abspath() {
- _ABSPATH=`realpath $1`
+ D=`dirname "$1"`
+ B=`basename "$1"`
+ if [ "$D" = "/" ] ; then
+ _ABSPATH="/$B"
+ else
+ _ABSPATH="`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B"
+ fi
}
More information about the Commits
mailing list