Merge pull request #248 from darealshinji/patch-2

Count Chocolatey packages in Cygwin if present
This commit is contained in:
Brett Bohnenkamper
2015-07-14 02:31:36 -10:00

View File

@@ -877,7 +877,14 @@ detectpkgs () {
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)) ;;
'Cygwin')
cygfix=2
pkgs=$(($(cygcheck -cd | wc -l) - ${cygfix}))
if [ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]; then
chocopkgs=$(( $(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l) ))
pkgs=$((${pkgs} + ${chocopkgs}))
fi
;;
esac
verboseOut "Finding current package count...found as '$pkgs'"
}