From 16469b1d7c3ee694e9b8965e46b39d9130197d82 Mon Sep 17 00:00:00 2001 From: Ryan Steinmetz Date: Wed, 22 Apr 2015 16:07:52 +0000 Subject: [PATCH] - Add missing pwdump tool - Fix timeout in updater script - Silence warnings in updater script - Fix periodic script - Fix default directory permissions - Bump PORTREVISION --- net/pwhois/Makefile | 6 ++-- net/pwhois/files/512.pwhois-updatedb.in | 7 +++-- net/pwhois/files/patch-pwhois-updatedb | 38 +++++++++++++++++++++++++ net/pwhois/files/pkg-message.in | 2 +- net/pwhois/files/pwhoisd.in | 4 +-- net/pwhois/pkg-plist | 1 + 6 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 net/pwhois/files/patch-pwhois-updatedb diff --git a/net/pwhois/Makefile b/net/pwhois/Makefile index 74430b33d1cd..fee816f1fdfc 100644 --- a/net/pwhois/Makefile +++ b/net/pwhois/Makefile @@ -3,7 +3,7 @@ PORTNAME= pwhois PORTVERSION= 2.2.0.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= http://pwhois.org/get/ \ http://mirrors.rit.edu/zi/ @@ -51,12 +51,14 @@ do-install: @${INSTALL_SCRIPT} ${WRKDIR}/512.pwhois-updatedb \ ${STAGEDIR}${PREFIX}/etc/periodic/daily/ @${INSTALL_PROGRAM} ${WRKSRC}/pwhoisd ${STAGEDIR}${PREFIX}/sbin/ + @${INSTALL_PROGRAM} ${WRKSRC}/pwhois-pwdump ${STAGEDIR}${PREFIX}/bin/ @${INSTALL_SCRIPT} ${WRKSRC}/pwhois-updatedb ${STAGEDIR}${PREFIX}/sbin/ @${INSTALL_DATA} ${WRKSRC}/pwhoisd.conf \ ${STAGEDIR}${ETCDIR}/pwhoisd.conf.sample @${INSTALL_DATA} ${WRKSRC}/mysql/createdb.sql ${STAGEDIR}${DATADIR}/ post-install: - @${MKDIR} ${STAGEDIR}/var/db/pwhois ${STAGEDIR}/var/log/pwhois + @${INSTALL} -d -o 512 -g 512 ${STAGEDIR}/var/db/pwhois + @${INSTALL} -d -o 512 -g 512 ${STAGEDIR}/var/log/pwhois .include diff --git a/net/pwhois/files/512.pwhois-updatedb.in b/net/pwhois/files/512.pwhois-updatedb.in index 4ce4166897c6..f343b0196ead 100644 --- a/net/pwhois/files/512.pwhois-updatedb.in +++ b/net/pwhois/files/512.pwhois-updatedb.in @@ -10,11 +10,12 @@ fi rc=0 -case "${daily_pwhois-updatedb_enable:-YES}" in +case "${daily_pwhois_updatedb_enable:-YES}" in [Nn][Oo]) ;; - *) - [ -x %%PREFIX%%/sbin/pwhois-updatedb ] && %%PREFIX%%/sbin/pwhois-updatedb 1>/dev/null + [Yy][Ee][Ss]) + rm /tmp/.pwhois-updatedb.LCK + su -fm pwhois -c 'lockf -t0 /tmp/.pwhois-updatedb.lock %%PREFIX%%/sbin/pwhois-updatedb' 1>/dev/null ;; esac diff --git a/net/pwhois/files/patch-pwhois-updatedb b/net/pwhois/files/patch-pwhois-updatedb new file mode 100644 index 000000000000..a5bd3c62e5c2 --- /dev/null +++ b/net/pwhois/files/patch-pwhois-updatedb @@ -0,0 +1,38 @@ +--- pwhois-updatedb.orig 2013-10-08 18:59:42 UTC ++++ pwhois-updatedb +@@ -975,7 +975,7 @@ sub connect + my $passwd = shift; + + +- my $session = Net::Telnet->new(timeout => 10, ++ my $session = Net::Telnet->new(timeout => 300, + telnetmode=>0, + cmd_remove_mode => 1 + ); +@@ -3133,7 +3133,7 @@ sub readMRTdump + + @st = stat($fd); + +- if(!defined(@st)) ++ if(!@st) + { + $errcode = -2; + } +@@ -3763,7 +3763,7 @@ sub parseOrganisationObject + + #printMap(%obj); + +- return -$numlines if(!(defined($orgId) && defined($orgName) && defined(@addrs))); ++ return -$numlines if(!(defined($orgId) && defined($orgName) && (@addrs))); + + $country = "" if(!defined($country)); + $country = substr(normalizeValue($country), 0, $fields_length{'organization.country'}); +@@ -4035,7 +4035,7 @@ sub parsePersonObject + #printMap(%obj); + + $source = 0 if(!defined($source)); +- return -$numlines if(!(defined($person) && defined(@addrs) && defined($officePhone) && ++ return -$numlines if(!(defined($person) && (@addrs) && defined($officePhone) && + defined($mailbox) && defined($pocHandle) && defined($source))); + + for($j1 = 0; $j1 < 6; $j1++){ diff --git a/net/pwhois/files/pkg-message.in b/net/pwhois/files/pkg-message.in index 870a62b18a11..92e81a8a00a8 100644 --- a/net/pwhois/files/pkg-message.in +++ b/net/pwhois/files/pkg-message.in @@ -21,4 +21,4 @@ pwhoisd_enable="YES" service pwhoisd start 6. To enable daily updates, edit /etc/periodic.conf and add: -daily_pwhois-updatedb_enable="YES" +daily_pwhois_updatedb_enable="YES" diff --git a/net/pwhois/files/pwhoisd.in b/net/pwhois/files/pwhoisd.in index ed17f7dce3c3..0860bfbf938b 100644 --- a/net/pwhois/files/pwhoisd.in +++ b/net/pwhois/files/pwhoisd.in @@ -33,8 +33,8 @@ stop_postcmd=pwhoisd_cleanup pwhoisd_precmd() { [ ! -f $pidfile ] && %%TOUCH%% $pidfile && %%CHOWN%% %%USER%%:%%GROUP%% $pidfile - [ ! -d $_dbdir ] && %%INSTALL%% -d -o %%USER%% -g %%GROUP%% $_dbdir - [ ! -d $_logdir ] && %%INSTALL%% -d -o %%USER%% -g %%GROUP%% $_logdir + %%INSTALL%% -d -o %%USER%% -g %%GROUP%% $_dbdir + %%INSTALL%% -d -o %%USER%% -g %%GROUP%% $_logdir return 0 } diff --git a/net/pwhois/pkg-plist b/net/pwhois/pkg-plist index d60e051fe880..73a9d26793f3 100644 --- a/net/pwhois/pkg-plist +++ b/net/pwhois/pkg-plist @@ -1,3 +1,4 @@ +bin/pwhois-pwdump etc/periodic/daily/512.pwhois-updatedb sbin/pwhois-updatedb sbin/pwhoisd