summaryrefslogtreecommitdiff
path: root/sysutils/screenfetch/files/patch-screenfetch-dev
blob: 235111afb50f2053e93c47996a515343f426afe0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- ./screenfetch-dev.orig	2013-07-16 21:08:11.000000000 -0700
+++ ./screenfetch-dev	2013-07-21 17:13:42.000000000 -0700
@@ -686,13 +686,17 @@
 				pkgs=$((${pkgs} + ${brew_pkgs}))
 			fi
 		;;
-		'FreeBSD'|'OpenBSD') 
+		'OpenBSD') 
 			pkgs=$(pkg_info | wc -l | awk '{sub(" ", "");print $1}')
 			if type -p portmaster >/dev/null 2>&1; then
 				ports=$(portmaster -l | grep -Eo '[0-9]+ total installed' | sed 's/ total installed//')
 				pkgs=$((${pkgs} + ${ports}))
 			fi
 		;;
+		'FreeBSD')
+			pkgs=$(if TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 PACKAGESITE=file:///nonexistent pkg info pkg >/dev/null 2>&1; then 
+				pkg info | wc -l | awk '{print $1}'; else pkg_info | wc -l | awk '{sub(" ", "");print $1}'; fi)
+		;;
 		'Cygwin') cygfix=2; pkgs=$(($(cygcheck -cd | wc -l)-$cygfix)) ;;
 	esac
 	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current package count...found as '$pkgs'"