[PC-BSD Commits] r7614 - in pcbsd/current/src-qt4/pbi-manager: . man

svn at pcbsd.org svn at pcbsd.org
Tue Sep 21 12:34:30 PDT 2010


Author: kris
Date: 2010-09-21 12:34:30 -0700 (Tue, 21 Sep 2010)
New Revision: 7614

Modified:
   pcbsd/current/src-qt4/pbi-manager/man/pbi_add.1
   pcbsd/current/src-qt4/pbi-manager/pbi-manager
Log:

Added two new flags to pbi_add, --rArch and --rVer. These flags allow the user to specify which
version & architecture of a PBI they wish to install from the remote archive. This comes in handy
for amd64 users especially who want to run some 32bit only app, like wine. 



Modified: pcbsd/current/src-qt4/pbi-manager/man/pbi_add.1
===================================================================
--- pcbsd/current/src-qt4/pbi-manager/man/pbi_add.1	2010-09-21 19:00:10 UTC (rev 7613)
+++ pcbsd/current/src-qt4/pbi-manager/man/pbi_add.1	2010-09-21 19:34:30 UTC (rev 7614)
@@ -11,7 +11,6 @@
 .Op Fl g
 .Op Fl i
 .Op Fl l
-.Op Fl p Ar prefix
 .Op Fl r
 .Op Fl v
 .Op Fl -checkscript
@@ -19,6 +18,8 @@
 .Op Fl -no-checksig
 .Op Fl -no-checksum
 .Op Fl -no-hash
+.Op Fl -rArch Ar arch
+.Op Fl -rVer Ar version
 .Op Ar pbidir
 .Sh DESCRIPTION
 The utility,
@@ -69,6 +70,16 @@
 .It Fl -no-hash
 Disable using the shared-hash dir, which uses hard-links to share files
 between applications which are the same. 
+.It Fl -rArch Ar arch
+When using -r to fetch and install a PBI, the machine architecture is detected
+automatically. Using the -rArch <arch> flag allows you to manually specify the 
+PBI arch type you wish to install, typically set to i386/amd64. 
+.It Fl -rVer Ar version
+When using -r to fetch and install a PBI, the most recent version of that
+application is the default. Using the -rVer <version> flag allows you to 
+specify a different version to install. A listing of available applications
+and versions is found with 'pbi_info -i'.
+used. 
 .Sh NOTES
 For details about the module format, please refer to the wiki guide:
 http://wiki.pcbsd.org/index.php/PBI_Module_Builder_Guide

Modified: pcbsd/current/src-qt4/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-qt4/pbi-manager/pbi-manager	2010-09-21 19:00:10 UTC (rev 7613)
+++ pcbsd/current/src-qt4/pbi-manager/pbi-manager	2010-09-21 19:34:30 UTC (rev 7614)
@@ -371,6 +371,14 @@
 			;;
                 -v)     PBI_VERBOSE="YES" 
                         ;;
+           --rArch)     
+                        if [ $# -eq 1 ]; then usage_add_pbi; fi
+                        shift; PBI_ADD_ALTARCH="$1"
+                        ;;
+           --rVer)     
+                        if [ $# -eq 1 ]; then usage_add_pbi; fi
+                        shift; PBI_ADD_ALTVER="$1"
+                        ;;
      --checkscript)     PBI_CHECKSCRIPTS="YES" ;;
         --licagree)     PBI_LICAGREE="YES" ;;
          --no-hash)     PBI_DISABLEHASHDIR="YES" ;;
@@ -2690,8 +2698,6 @@
 
 	# If we are listing available PBIs via the index file
 	if [ "$PBI_INFOINDEX" = "YES" ] ; then
-		init_tmpdir
-
 		# See if we need to update the PBI index file
 		check_update_index
 		
@@ -2918,7 +2924,7 @@
 	if [ "${PBI_UPCHECK}" = "YES" ] ; then
 		load_info_from_dir "${PBI_DBDIR}/${PBI_UPDATEAPP}"
 		check_pbi_update "$PBI_UPDATEAPP" "display" \
-	 	 "$PBI_PROGNAME" "$PBI_PROGVERSION" \
+	 	 "$PBI_PROGNAME" "current" \
 	 	 "$PBI_FBSDVER" "$PBI_APPARCH"
 	else
 		# Loop and check all PBIs for updates
@@ -2927,7 +2933,7 @@
                         if [ -e "${PBI_DBDIR}/${i}/pbi_name" ] ; then
 				load_info_from_dir "${PBI_DBDIR}/${i}"
 				check_pbi_update "$i" "display" \
-				 "$PBI_PROGNAME" "$PBI_PROGVERSION" \
+				 "$PBI_PROGNAME" "current" \
 				 "$PBI_FBSDVER" "$PBI_APPARCH"
                         fi
                 done
@@ -2941,7 +2947,10 @@
 	# If not running as root, don't bother trying to update
 	if [ `id -u` != "0" ] ; then return ; fi
 
+	init_tmpdir
+
 	_ufbsdver="`uname -r`"
+	#_ufbsdver="9"
 
 	# Init the tmpdir
 	init_tmpdir
@@ -2962,10 +2971,10 @@
 			_fullUp="0" 
 		else
 			# Good download, so lets try applying the patch
-			_newsvnrev=`cat ${PBI_TMPDIR}/.upcheck$$ | grep '^REVISION: ' | sed 's|REVISION: ||g'`
+			_newsvnrev=`cat ${PBI_TMPDIR}/.upcheck$$ 2>/dev/null | grep '^REVISION: ' | sed 's|REVISION: ||g'`
 
 			# Get the diff file
-			cat ${PBI_TMPDIR}/.upcheck$$ | grep -v '^REVISION: ' > ${PBI_TMPDIR}/.index$$.patch
+			cat ${PBI_TMPDIR}/.upcheck$$ 2>/dev/null | grep -v '^REVISION: ' > ${PBI_TMPDIR}/.index$$.patch 2>/dev/null
 
 			_diff=`cat ${PBI_TMPDIR}/.index$$.patch`
 			if [ "$_diff" = "CURRENT" ] ; then
@@ -2990,7 +2999,7 @@
 	fi
 	
 	# If our index is still empty, try to grab a fresh copy just to be sure
-	if [ -z "`cat ${PBI_INDEXUPFILE} | head -n 3`" ] ; then
+	if [ -z "`cat ${PBI_INDEXUPFILE} 2>/dev/null | head -n 3`" ] ; then
 		_fullUp="0"
 	fi
 
@@ -3003,8 +3012,8 @@
 			"${PBI_UPDATEURL}" >/dev/null 2>/dev/null 
 		if [ "$?" = "0" ] ; then
 			# Copy the Index File minus REVISION:
-			_svnrev=`cat ${PBI_TMPDIR}/.upcheck$$ | grep '^REVISION: ' | sed 's|REVISION: ||g'`
-			cat ${PBI_TMPDIR}/.upcheck$$ | grep -v '^REVISION: ' > ${PBI_APPDIR}/${PBI_INDEXUPFILE}
+			_svnrev=`cat ${PBI_TMPDIR}/.upcheck$$ 2>/dev/null | grep '^REVISION: ' | sed 's|REVISION: ||g'`
+			cat ${PBI_TMPDIR}/.upcheck$$ 2>/dev/null | grep -v '^REVISION: ' > ${PBI_APPDIR}/${PBI_INDEXUPFILE}
 			echo "$_svnrev" > ${PBI_APPDIR}/${PBI_INDEXUPTIME}
 		fi
 	fi
@@ -3012,6 +3021,7 @@
 
 	# Uncomment to see details from update server
 	#cat ${PBI_TMPDIR}/.upcheck$$
+
 }
 
 # Check a specific PBI for updates
@@ -3037,9 +3047,16 @@
 	PBI_UPCSUM=""
 	PBI_UPMDATE=""
 
-	# Search the update index for the current PBI
-	_upLine=`grep -i -e "^$_uprog:" ${PBI_APPDIR}/${PBI_INDEXUPFILE} | grep ":$_uarch:" | grep ":current" | head -n 1`
+	# If we are looking for the current app, set _uver accordingly
+	if [ "$_uver" = "current" ] ; then
+		_uver=":current"
+	else
+		_uver=":${_uver}:"
+	fi
 
+	# Search the update index for the specified PBI
+	_upLine=`grep -i -e "^$_uprog:" ${PBI_APPDIR}/${PBI_INDEXUPFILE} | grep ":$_uarch:" | grep "$_uver" | head -n 1`
+
 	PBI_UPNVER="`echo $_upLine | cut -d ':' -f 3`"
 	PBI_UPFILE="`echo $_upLine | cut -d ':' -f 6`"
 	PBI_UPPATCHES="`echo $_upLine | cut -d ':' -f 8`"
@@ -3083,9 +3100,17 @@
 	# See if we need to update the PBI index file
 	check_update_index
 
+	# Check if the user overrode the arch / versions we want to install
+	_rArch=`uname -m`
+	if [ ! -z "$PBI_ADD_ALTARCH" ] ; then _rArch=$PBI_ADD_ALTARCH ; fi
+
+	_rVer="0"
+	if [ ! -z "$PBI_ADD_ALTVER" ] ; then _rVer=$PBI_ADD_ALTVER ; fi
+
+
 	check_pbi_update "$_rtar" "nodisplay" \
-	 "$_rtar" "-0" \
-	 "`uname -r`" "`uname -m`"
+	 "$_rtar" "$_rVer" \
+	 "`uname -r`" "$_rArch"
 	if [ "$?" != "0" ] ; then 
 		exit_err "Could not find \"$_rtar\" in $PBI_INDEXUPFILE"
 	fi
@@ -3108,7 +3133,7 @@
 	# Check for update to this app, and exit or return if not available
 	load_info_from_dir "${PBI_DBDIR}/${PBI_UPDATEAPP}"
 	check_pbi_update "$PBI_UPDATEAPP" "nodisplay" \
-	 "$PBI_PROGNAME" "$PBI_PROGVERSION" \
+	 "$PBI_PROGNAME" "current" \
 	 "$PBI_FBSDVER" "$PBI_APPARCH"
 	if [ "$?" != "0" ] ; then 
 		if [ "$_upact" = "single" ] ; then



More information about the Commits mailing list