You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by si...@apache.org on 2007/06/07 07:46:45 UTC
svn commit: r545073 - in /spamassassin/branches/3.2: spamc/spamc.c
t/spamc_z.t
Author: sidney
Date: Wed Jun 6 22:46:44 2007
New Revision: 545073
URL: http://svn.apache.org/viewvc?view=rev&rev=545073
Log:
bug 5457: spamc build and test should handle not having zlib
Modified:
spamassassin/branches/3.2/spamc/spamc.c
spamassassin/branches/3.2/t/spamc_z.t
Modified: spamassassin/branches/3.2/spamc/spamc.c
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.2/spamc/spamc.c?view=diff&rev=545073&r1=545072&r2=545073
==============================================================================
--- spamassassin/branches/3.2/spamc/spamc.c (original)
+++ spamassassin/branches/3.2/spamc/spamc.c Wed Jun 6 22:46:44 2007
@@ -196,7 +196,9 @@
usg(" -h, --help Print this help message and exit.\n");
usg(" -V, --version Print spamc version and exit.\n");
usg(" -K Keepalive check of spamd.\n");
+#ifdef HAVE_ZLIB_H
usg(" -z Compress mail message sent to spamd.\n");
+#endif
usg(" -f (Now default, ignored.)\n");
usg("\n");
@@ -446,7 +448,12 @@
}
case 'z':
{
+#ifdef HAVE_ZLIB_H
flags |= SPAMC_USE_ZLIB;
+#else
+ libspamc_log(flags, LOG_ERR, "spamc -z support not available");
+ ret = EX_USAGE;
+#endif
break;
}
case 0:
Modified: spamassassin/branches/3.2/t/spamc_z.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.2/t/spamc_z.t?view=diff&rev=545073&r1=545072&r2=545073
==============================================================================
--- spamassassin/branches/3.2/t/spamc_z.t (original)
+++ spamassassin/branches/3.2/t/spamc_z.t Wed Jun 6 22:46:44 2007
@@ -4,9 +4,13 @@
use lib '.'; use lib 't';
use SATest; sa_t_init("spamc_z");
-use Test; plan tests => (($SKIP_SPAMD_TESTS || !HAVE_ZLIB) ? 0 : 9);
-exit if ($SKIP_SPAMD_TESTS || !HAVE_ZLIB);
+system("$spamc -z < /dev/null");
+my $SPAMC_Z_AVAILABLE = ($? >> 8 == 0);
+
+use Test;
+plan tests => (($SKIP_SPAMD_TESTS || !HAVE_ZLIB || !$SPAMC_Z_AVAILABLE) ? 0 : 9);
+exit if ($SKIP_SPAMD_TESTS || !HAVE_ZLIB || !$SPAMC_Z_AVAILABLE);
# ---------------------------------------------------------------------------