[Mimedefang] sa-update
John Nemeth
jnemeth at victoria.tc.ca
Thu Apr 27 18:16:38 EDT 2006
On Sep 17, 11:44am, "Josh Kelley" wrote:
} On 4/24/06, David F. Skoll <dfs at roaringpenguin.com> wrote:
} > Jonas Eckerman wrote:
} >
} > > + my $LOCAL_STATE_DIR = '/var/lib';
} >
} > That works for FreeBSD, but look at Mail-SpamAssassin's Makefile.PL.
} > It contains a subroutine "_set_macro_LOCALSTATEDIR" that supposedly
} > sets the default for LOCAL_STATE_DIR. If anyone doesn't think
} > SpamAssassin is an evil piece of code, _set_macro_LOCALSTATEDIR should
} > remove all remaining doubts.
} >
} > If/when I find a general-purpose way to detect what the *@#&$&#$
} > LOCAL_STATE_DIR should be set to for a given SpamAssassin installation,
} > I will patch MIMEDefang to use it. If I can't figure it out, I'll
} > just use /var/lib.
}
} sa-update knows what LOCAL_STATE_DIR is, and sa-update is simply Perl
} code, so how about just taking its setting of LOCAL_STATE_DIR and
} eval'ing it?
}
} my $LOCAL_STATE_DIR;
} my $setlocalstatedir = `grep '^my \$LOCAL_STATE_DIR' /usr/bin/sa-update`;
} $setlocalstatedir =~ s/^my //; # Remove leading "my" so that
} $LOCAL_STATE_DIR isn't scoped locally to eval block
} eval $setlocalstatedir;
If we're looking at this, couldn't we just grab it from
SpamAssassin directly, i.e.:
my $LOCAL_STATE_DIR = $Mail::SpamAssassin::LOCAL_STATE_DIR; ?
I've done similar things to get at other internal variables.
}-- End of excerpt from "Josh Kelley"
More information about the MIMEDefang
mailing list