View | Details | Raw Unified | Return to bug 251152 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-1 / +6 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	bsdstats
4
PORTNAME=	bsdstats
5
PORTVERSION=	7.0
5
PORTVERSION=	7.1
6
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
7
DISTFILES=
7
DISTFILES=
8
8
Lines 42-45 Link Here
42
	${INSTALL_SCRIPT} ${WRKDIR}/bsdstats-send \
42
	${INSTALL_SCRIPT} ${WRKDIR}/bsdstats-send \
43
		${STAGEDIR}${PREFIX}/bin/bsdstats-send
43
		${STAGEDIR}${PREFIX}/bin/bsdstats-send
44
44
45
post-install:
46
.if ! defined(BATCH) && ! defined(PACKAGE_BUILDING)
47
	@PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL ${STAGEDIR}${PREFIX}
48
.endif
49
45
.include <bsd.port.mk>
50
.include <bsd.port.mk>
(-)files/300.statistics.in (-1 / +1 lines)
Lines 392-398 Link Here
392
            ;;
392
            ;;
393
          *)
393
          *)
394
            report_uri="/scripts/report_ports_v2.php"
394
            report_uri="/scripts/report_ports_v2.php"
395
            if [ -f %%PREFIX%%/etc/bsdstats.conf -a "0" = "0`grep ^all-ports /usr/local/etc/bsdstats.conf`" ]; then
395
            if [ -f %%PREFIX%%/etc/bsdstats.conf ] && [ -z $(grep ^all-ports /usr/local/etc/bsdstats.conf) ]; then
396
              query_string=$( pkg query %n:%v:%o | fgrep -f %%PREFIX%%/etc/bsdstats.conf | awk -F\/ '{print $1}' | sed -E -e 's/\+/%2b/g' -e 's/,/%2c/g' | awk '{printf"&port[]=%s", $1}' )
396
              query_string=$( pkg query %n:%v:%o | fgrep -f %%PREFIX%%/etc/bsdstats.conf | awk -F\/ '{print $1}' | sed -E -e 's/\+/%2b/g' -e 's/,/%2c/g' | awk '{printf"&port[]=%s", $1}' )
397
            else
397
            else
398
              query_string=$( pkg query %n:%v:%o | awk -F\/ '{print $1}' | sed -E -e 's/\+/%2b/g' -e 's/,/%2c/g' | awk '{printf"&port[]=%s", $1}' )
398
              query_string=$( pkg query %n:%v:%o | awk -F\/ '{print $1}' | sed -E -e 's/\+/%2b/g' -e 's/,/%2c/g' | awk '{printf"&port[]=%s", $1}' )
(-)pkg-install (-10 / +25 lines)
Lines 6-18 Link Here
6
#
6
#
7
# Environment Variable      | Question
7
# Environment Variable      | Question
8
# --------------------------+------------------------------------------------------------------
8
# --------------------------+------------------------------------------------------------------
9
# BSDSTATS_MONTHLY_ENABLE   | Would you like to enable monthly reporting in /etc/periodic.conf?
10
# BSDSTATS_MONTHLY_DEVICES  | Would you like to send a list of installed hardware as well?
11
# BSDSTATS_MONTHLY_PORTS    | Would you like to send a list of installed ports as well?
9
# BSDSTATS_MONTHLY_NOW      | Would you like to run it now?
12
# BSDSTATS_MONTHLY_NOW      | Would you like to run it now?
10
# BSDSTATS_REBOOT_REPORTING | Would you like to enable reporting on bootup in /etc/rc.conf?
13
# BSDSTATS_REBOOT_REPORTING | Would you like to enable reporting on bootup in /etc/rc.conf?
11
14
12
if [ -n "$PACKAGE_BUILDING" ]; then
15
if [ -n "$PACKAGE_BUILDING" ]; then
16
	BSDSTATS_MONTHLY_ENABLE=${BSDSTATS_MONTHLY_ENABLE:=no}
17
	BSDSTATS_MONTHLY_DEVICES=${BSDSTATS_MONTHLY_DEVICES:=no}
18
	BSDSTATS_MONTHLY_PORTS=${BSDSTATS_MONTHLY_PORTS:=no}
13
	BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=no}
19
	BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=no}
14
	BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=no}
20
	BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=no}
15
else
21
else
22
	BSDSTATS_MONTHLY_ENABLE=${BSDSTATS_MONTHLY_ENABLE:=yes}
23
	BSDSTATS_MONTHLY_DEVICES=${BSDSTATS_MONTHLY_DEVICES:=yes}
24
	BSDSTATS_MONTHLY_PORTS=${BSDSTATS_MONTHLY_PORTS:=yes}
16
	BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=yes}
25
	BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=yes}
17
	BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=yes}
26
	BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=yes}
18
fi
27
fi
Lines 47-62 Link Here
47
}
56
}
48
57
49
if [ "$2" = "POST-INSTALL" ]; then
58
if [ "$2" = "POST-INSTALL" ]; then
50
	log_file="${INSTALL_PREFIX}/var/log/bsdstats"
59
	if [ ! -f "/etc/periodic.conf" ] || [ -z $(grep monthly_statistics /etc/periodic.conf) ]; then
51
	need_to_ask=0
60
		if yesno "Would you like to enable monthly reporting in /etc/periodic.conf" $BSDSTATS_MONTHLY_ENABLE; then
52
	if [ ! -e ${log_file} ]; then
61
			echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf
53
		need_to_ask=1
62
			if yesno "Would you like to send a list of installed hardware as well" $BSDSTATS_MONTHLY_DEVICES; then
54
	elif [ $(($(date +"%s")-$(stat -f %Sm -t %s ${log_file}))) -gt $((60*60*24*40)) ]; then
63
				echo "monthly_statistics_report_devices=\"YES\"" >> /etc/periodic.conf
55
		need_to_ask=1
64
			fi
56
	fi
65
			if yesno "Would you like to send a list of installed ports as well" $BSDSTATS_MONTHLY_PORTS; then
57
	if [ $need_to_ask = 1 ]; then
66
				echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf
58
		if yesno "Would you like to run BSDstats now" $BSDSTATS_MONTHLY_NOW; then
67
			fi
59
			${INSTALL_PREFIX}${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay
68
			if yesno "Would you like to run it now" $BSDSTATS_MONTHLY_NOW; then
69
				if [ -z "$PACKAGE_BUILDING" ]; then
70
					${3}/etc/periodic/monthly/300.statistics -nodelay
71
				else
72
					${INSTALL_PREFIX}${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay
73
				fi
74
			fi
60
		fi
75
		fi
61
	fi
76
	fi
62
	if [ ! -f "/etc/rc.conf" ] || [ -z $(grep bsdstats_enable /etc/rc.conf) ]; then
77
	if [ ! -f "/etc/rc.conf" ] || [ -z $(grep bsdstats_enable /etc/rc.conf) ]; then

Return to bug 251152