[PC-BSD Commits] r12248 - pcbsd/current/src-sh/pbi-manager

svn at pcbsd.org svn at pcbsd.org
Tue Aug 23 17:05:15 PDT 2011


Author: kris
Date: 2011-08-23 17:05:15 -0700 (Tue, 23 Aug 2011)
New Revision: 12248

Modified:
   pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:

Fix fetching FreeBSD sources when using STABLE / CURRENT / RELEASE

Thanks to Nukama via Trac!

Ticket #378



Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-08-23 23:29:16 UTC (rev 12247)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-08-24 00:05:15 UTC (rev 12248)
@@ -5934,12 +5934,28 @@
 	
 	# Figure out which version of FreeBSD to checkout
 	local _osRel=`uname -r`
-	echo $_osRel | grep "CURRENT" >/dev/null 2>/dev/null
+	echo $_osRel | grep "RELEASE" >/dev/null 2>/dev/null
 	if [ "$?" = "0" ] ; then
-		local svnUrl="svn://svn.freebsd.org/base/head"
-	else
 		local _osMajor=`echo $_osRel | cut -c 1-1`
 		local svnUrl="svn://svn.freebsd.org/base/releng/${_osMajor}.0"
+		echo "Using $svnUrl for sources"
+	else
+		echo $_osRel | grep "CURRENT" >/dev/null 2>/dev/null
+		if [ "$?" = "0" ] ; then
+		      local svnUrl="svn://svn.freebsd.org/base/head"
+		      echo "Using $svnUrl for sources"
+		else
+		      echo $_osRel | grep "STABLE" >/dev/null 2>/dev/null
+		      if [ "$?" = "0" ] ; then
+			    local _osMajor=`echo $_osRel | cut -c 1-1`
+			    local svnUrl="svn://svn.freebsd.org/base/stable/${_osMajor}"
+			    "Using $svnUrl for sources"
+		      else
+			    local svnUrl="svn://svn.freebsd.org/base/head"
+			    echo "Using $svnUrl for sources"
+			    echo "Assuming a BETA|RC or rarely used FreeBSD version. Using CURRENT!"
+		      fi
+		fi
 	fi
 
 	echo "Checking out FreeBSD sources from $svnUrl"



More information about the Commits mailing list