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

svn at pcbsd.org svn at pcbsd.org
Wed Mar 9 12:00:19 PST 2011


Author: kris
Date: 2011-03-09 12:00:19 -0800 (Wed, 09 Mar 2011)
New Revision: 9586

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

Update to pbi-manager, don't display updates if the made date is newer
than the updates copy



Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-03-09 18:57:42 UTC (rev 9585)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-03-09 20:00:19 UTC (rev 9586)
@@ -4056,7 +4056,7 @@
 		# Does this need an update?
 		check_pbi_update "$PBI_UPDATEAPP" "nodisplay" \
 			"$PBI_PROGNAME" "current" \
-			"$PBI_FBSDVER" "$PBI_APPARCH" "$_repoID"
+			"$PBI_FBSDVER" "$PBI_APPARCH" "$_repoID" "$PBI_PROGMDATE"
 		if [ "$?" != "0" ] ; then
 			continue
 		fi
@@ -4397,7 +4397,7 @@
 
 		check_pbi_update "$PBI_UPDATEAPP" "display" \
 	 	 "$PBI_PROGNAME" "current" \
-	 	 "$PBI_FBSDVER" "$PBI_APPARCH" "$_repoID"
+	 	 "$PBI_FBSDVER" "$PBI_APPARCH" "$_repoID" "$PBI_PROGMDATE"
 		return $?
 	else
 		# Loop and check all PBIs for updates
@@ -4416,7 +4416,7 @@
 
 				check_pbi_update "$i" "display" \
 				 "$PBI_PROGNAME" "current" \
-				 "$PBI_FBSDVER" "$PBI_APPARCH" "$_repoID"
+				 "$PBI_FBSDVER" "$PBI_APPARCH" "$_repoID" "$PBI_PROGMDATE"
                         fi
                 done
 		return 0
@@ -4548,6 +4548,7 @@
 	_ufbsdver="${5}"
 	_uarch="${6}"
 	_urepo="${7}"
+	_omdate="${8}"
 
 	appname="`echo ${_uprog} | tr '[:lower:]' '[:upper:]'`"
 
@@ -4596,7 +4597,21 @@
 	# If no new version
 	if [ -z "$PBI_UPNVER" ] ; then return 1 ; fi
 
+	# See if this update is newer than the installed date
+	if [ ! -z "$_omdate" ] ; then
+		nDay=`echo $PBI_UPMDATE | cut -d ' ' -f 1`
+		nHour=`echo $PBI_UPMDATE | cut -d ' ' -f 2`
+		oDay=`echo $_omdate | cut -d ' ' -f 1`
+		oHour=`echo $_omdate | cut -d ' ' -f 2`
 
+		# Make sure we have all legit numbers
+		if [ $(is_num "$nDay") -a $(is_num "$nHour") \
+			-a $(is_num "$oDay") -a $(is_num "$oHour") ] ; then
+			if [ $oDay -gt $nDay ] ; then return 1 ; fi
+			if [ "$oDay" = "$nDay" -a $oHour -gt $nHour ] ; then return 1 ; fi
+		fi
+	fi
+
 	if [ "$PBI_UPNVER" != "$PBI_PROGVERSION" ] ; then
 		if [ "$_udisp" = "display" ] ; then 
 			echo "${_upbi} - Available: ${PBI_UPNVER}"
@@ -4695,7 +4710,7 @@
 
 	check_pbi_update "$PBI_UPDATEAPP" "nodisplay" \
 	 "$PBI_PROGNAME" "current" \
-	 "$PBI_FBSDVER" "$PBI_APPARCH" "$_repoID"
+	 "$PBI_FBSDVER" "$PBI_APPARCH" "$_repoID" "$PBI_PROGMDATE"
 	if [ "$?" != "0" ] ; then 
 		rm "${PBI_DBAPPDIR}/${PBI_UPDATEAPP}/.updating"
 		if [ "$_upact" = "single" ] ; then



More information about the Commits mailing list