[PC-BSD Commits] r22316 - in pcbsd/current/src-sh: libsh pbi-manager

svn at pcbsd.org svn at pcbsd.org
Mon Apr 15 12:37:25 PDT 2013


Author: kris
Date: 2013-04-15 12:37:25 -0700 (Mon, 15 Apr 2013)
New Revision: 22316

Modified:
   pcbsd/current/src-sh/libsh/functions.sh
   pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:

Copy fixes from github:

https://github.com/kmoore134/pcbsd-projects/commit/4d2a365f564bb2fafe185060410fa70ad70c5774
https://github.com/kmoore134/pcbsd-projects/commit/c3f709f74ae0326d9a23213608b1166490c01886




Modified: pcbsd/current/src-sh/libsh/functions.sh
===================================================================
--- pcbsd/current/src-sh/libsh/functions.sh	2013-04-15 19:08:36 UTC (rev 22315)
+++ pcbsd/current/src-sh/libsh/functions.sh	2013-04-15 19:37:25 UTC (rev 22316)
@@ -355,12 +355,13 @@
 # Arg1 = Directory to check
 getZFSTank() {
   local _chkDir="$1"
+
+  _chkdir=${_chkDir%/}
   while :
   do
-     line=`mount | grep -we "$_chkDir" | grep -e "(zfs,"`
-     mount | grep -we "$_chkDir" | grep -q -e "(zfs,"
-     if [ $? -eq 0 ] ; then
-        echo $line | cut -d '/' -f -1 | awk '{print $1}'
+     zpath=`zfs list | awk -v path="${_chkDir}" '$5 == path { print $1 }'`
+     if [ -n "${zpath}" ] ; then
+        echo $zpath | cut -f1 -d '/'
         return 0
      fi
 

Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2013-04-15 19:08:36 UTC (rev 22315)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2013-04-15 19:37:25 UTC (rev 22316)
@@ -7424,12 +7424,12 @@
 # Arg1 = Directory to check
 getZFSTank() {
   local _chkDir="$1"
+  _chkdir=${_chkDir%/}
   while :
   do
-     line=`mount | grep -w -e $_chkDir -e "(zfs,"`
-     mount | grep -qw -e $_chkDir -e "(zfs,"
-     if [ $? -eq 0 ] ; then
-        echo $line | cut -d '/' -f -1 | awk '{print $1}'
+     zpath=`zfs list | awk -v path="${_chkDir}" '$5 == path { print $1 }'`
+     if [ -n "${zpath}" ] ; then
+        echo $zpath | cut -f1 -d '/'
         return 0
      fi
 



More information about the Commits mailing list