diff options
author | scrappy <scrappy@FreeBSD.org> | 2006-09-05 04:36:44 +0800 |
---|---|---|
committer | scrappy <scrappy@FreeBSD.org> | 2006-09-05 04:36:44 +0800 |
commit | 001083e00f8cbe342571a01c510a32a17cd07652 (patch) | |
tree | 67fdb12e0c1c9ccc6797ca8fddfa06c2ad4f60fc /sysutils | |
parent | d74b4d51d798dfd20a8e34694039d7c3ce50927b (diff) | |
download | freebsd-ports-gnome-001083e00f8cbe342571a01c510a32a17cd07652.tar.gz freebsd-ports-gnome-001083e00f8cbe342571a01c510a32a17cd07652.tar.zst freebsd-ports-gnome-001083e00f8cbe342571a01c510a32a17cd07652.zip |
Several cleanups, and extensions to allow NetBSD to submit ...
- uri_escape IDTOKEN properly
- use ftp vs fetch
- use /etc/rc.conf instead of /etc/periodic.conf
Submitted by: David Brownlee <abs@absd.org>
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/bsdstats/Makefile | 3 | ||||
-rw-r--r-- | sysutils/bsdstats/files/300.statistics | 27 | ||||
-rw-r--r-- | sysutils/bsdstats/files/300.statistics.in | 27 |
3 files changed, 33 insertions, 24 deletions
diff --git a/sysutils/bsdstats/Makefile b/sysutils/bsdstats/Makefile index daf773937e7a..51f1491a97c5 100644 --- a/sysutils/bsdstats/Makefile +++ b/sysutils/bsdstats/Makefile @@ -6,8 +6,7 @@ # PORTNAME= bsdstats -PORTVERSION= 3.3 -PORTREVISION= 1 +PORTVERSION= 3.4 CATEGORIES= sysutils DISTFILES= diff --git a/sysutils/bsdstats/files/300.statistics b/sysutils/bsdstats/files/300.statistics index 72038babd0f0..b323e0f9732b 100644 --- a/sysutils/bsdstats/files/300.statistics +++ b/sysutils/bsdstats/files/300.statistics @@ -1,6 +1,6 @@ #!/bin/sh - # -# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.15 2006-09-04 01:59:28 scrappy Exp $ +# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/Attic/300.statistics,v 1.16 2006-09-04 20:36:44 scrappy Exp $ # # If there is a global system configuration file, suck it in. @@ -9,6 +9,8 @@ if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs +else + . /etc/rc.conf # For systems without periodic.conf, use rc.conf fi oldmask=$(umask) @@ -36,21 +38,19 @@ send_devices () { } get_id_token () { - local IFS - - IFS='= -' - - if [ ! -f $id_token_file ] ; + if [ ! -f $id_token_file -o ! -s $id_token_file ] ; then - IDTOKEN=$( openssl rand -base64 16 ) + IDTOKEN=$(uri_escape $( openssl rand -base64 16 ) ) idf=$( mktemp "$id_token_file.XXXXXX" ) && \ /usr/sbin/chown root:wheel $idf && \ /bin/chmod 600 $idf - /usr/bin/fetch -qo - \ - "http://$checkin_server/scripts/getid.php?key=$IDTOKEN" | { + do_fetch getid.php?key=$IDTOKEN | { + local IFS + IFS='= +' + while read var val do case $var in @@ -105,7 +105,12 @@ uri_escape () { } do_fetch () { - /usr/bin/fetch -qo /dev/null "http://$checkin_server/scripts/$1" + case $(uname) in + NetBSD) + /usr/bin/ftp -V -o /dev/null "http://$checkin_server/scripts/$1" ;; + FreeBSD | *) + /usr/bin/fetch -qo /dev/null "http://$checkin_server/scripts/$1" ;; + esac } diff --git a/sysutils/bsdstats/files/300.statistics.in b/sysutils/bsdstats/files/300.statistics.in index 31bab01dd778..442d74363558 100644 --- a/sysutils/bsdstats/files/300.statistics.in +++ b/sysutils/bsdstats/files/300.statistics.in @@ -1,6 +1,6 @@ #!/bin/sh - # -# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.15 2006-09-04 01:59:28 scrappy Exp $ +# $FreeBSD: /tmp/pcvs/ports/sysutils/bsdstats/files/300.statistics.in,v 1.16 2006-09-04 20:36:44 scrappy Exp $ # # If there is a global system configuration file, suck it in. @@ -9,6 +9,8 @@ if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs +else + . /etc/rc.conf # For systems without periodic.conf, use rc.conf fi oldmask=$(umask) @@ -36,21 +38,19 @@ send_devices () { } get_id_token () { - local IFS - - IFS='= -' - - if [ ! -f $id_token_file ] ; + if [ ! -f $id_token_file -o ! -s $id_token_file ] ; then - IDTOKEN=$( openssl rand -base64 16 ) + IDTOKEN=$(uri_escape $( openssl rand -base64 16 ) ) idf=$( mktemp "$id_token_file.XXXXXX" ) && \ /usr/sbin/chown root:wheel $idf && \ /bin/chmod 600 $idf - /usr/bin/fetch -qo - \ - "http://$checkin_server/scripts/getid.php?key=$IDTOKEN" | { + do_fetch getid.php?key=$IDTOKEN | { + local IFS + IFS='= +' + while read var val do case $var in @@ -105,7 +105,12 @@ uri_escape () { } do_fetch () { - /usr/bin/fetch -qo /dev/null "http://$checkin_server/scripts/$1" + case $(uname) in + NetBSD) + /usr/bin/ftp -V -o /dev/null "http://$checkin_server/scripts/$1" ;; + FreeBSD | *) + /usr/bin/fetch -qo /dev/null "http://$checkin_server/scripts/$1" ;; + esac } |