sa-compile 编译错误

sa-compile 编译错误

我在 ubuntu 14.04 上安装 sa-compile (package 3.4.0-1ubuntu2 ) 的最新更新时遇到问题。安装该软件包时出现以下错误:

.sa-compile (3.4.0-1ubuntu2) wird eingerichtet ...
Running sa-compile (may take a long time)
cannot create ./.spamassassin785yZpOYGtmp/log: No such file or directory at /usr/bin/sa-compile line 278.
dpkg: Fehler beim Bearbeiten des Paketes sa-compile (--configure):
Unterprozess installiertes post-installation-Skript gab den Fehlerwert 2 zurück
Fehler traten auf beim Bearbeiten von:
sa-compile
E: Sub-process /usr/bin/dpkg returned an error code (1)

不久前,我将服务器从 12.04 升级,发现有几条条目存在此问题。无论如何,它们都给出了不同的错误和解决方案。

但如果我只是运行已安装的版本,它似乎运行良好

user@server:~$ sudo sa-compile
Dez 11 13:25:25.754 [811] info: generic: base extraction starting. this can take a while...
Dez 11 13:25:25.754 [811] info: generic: extracting from rules of type body_0
100% [==========================================================================================================================================================================================================================================] 11981.38 rules/sec 00m00s DONE
100% [==========================================================================================================================================================================================================================================] 460.86 bases/sec 00m05s DONE
Dez 11 13:25:30.898 [811] info: body_0: 1093 base strings extracted in 5 seconds
cd /tmp/.spamassassin8118OPCdetmp
reading bases_body_0.in
cd Mail-SpamAssassin-CompiledRegexps-body_0
re2c -i -b -o scanner1.c scanner1.re
re2c -i -b -o scanner2.c scanner2.re
re2c -i -b -o scanner3.c scanner3.re
re2c -i -b -o scanner4.c scanner4.re
re2c -i -b -o scanner5.c scanner5.re
re2c -i -b -o scanner6.c scanner6.re
/usr/bin/perl Makefile.PL PREFIX=/tmp/.spamassassin8118OPCdetmp/ignored INSTALLSITEARCH=/var/lib/spamassassin/compiled/5.018/3.004000 
Writing Makefile for Mail::SpamAssassin::CompiledRegexps::body_0
Writing MYMETA.yml and MYMETA.json
make 
cp body_0.pm blib/lib/Mail/SpamAssassin/CompiledRegexps/body_0.pm
/usr/bin/perl /usr/share/perl/5.18/ExtUtils/xsubpp  -typemap /usr/share/perl/5.18/ExtUtils/typemap  body_0.xs > body_0.xsc && mv body_0.xsc body_0.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC "-I/usr/lib/perl/5.18/CORE"   body_0.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC "-I/usr/lib/perl/5.18/CORE"   scanner1.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC "-I/usr/lib/perl/5.18/CORE"   scanner2.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC "-I/usr/lib/perl/5.18/CORE"   scanner3.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC "-I/usr/lib/perl/5.18/CORE"   scanner4.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC "-I/usr/lib/perl/5.18/CORE"   scanner5.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"1.0\" -DXS_VERSION=\"1.0\" -fPIC "-I/usr/lib/perl/5.18/CORE"   scanner6.c
Running Mkbootstrap for Mail::SpamAssassin::CompiledRegexps::body_0 ()
chmod 644 body_0.bs
rm -f blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
cc  -shared -L/usr/local/lib -fstack-protector body_0.o scanner1.o scanner2.o scanner3.o scanner4.o scanner5.o scanner6.o  -o blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so     \
        \

chmod 755 blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
cp body_0.bs blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.bs
chmod 644 blib/arch/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.bs
Manifying blib/man3/Mail::SpamAssassin::CompiledRegexps::body_0.3pm
make install 
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /var/lib/spamassassin/compiled/5.018/3.004000/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.bs
Installing /var/lib/spamassassin/compiled/5.018/3.004000/auto/Mail/SpamAssassin/CompiledRegexps/body_0/body_0.so
Installing /var/lib/spamassassin/compiled/5.018/3.004000/Mail/SpamAssassin/CompiledRegexps/body_0.pm
Installing /tmp/.spamassassin8118OPCdetmp/ignored/man/man3/Mail::SpamAssassin::CompiledRegexps::body_0.3pm
Appending installation info to /var/lib/spamassassin/compiled/5.018/3.004000/perllocal.pod
cp /tmp/.spamassassin8118OPCdetmp/bases_body_0.pl /var/lib/spamassassin/compiled/5.018/3.004000/bases_body_0.pl
cd /
rm -rf /tmp/.spamassassin8118OPCdetmp

答案1

只需编辑/usr/bin/sa-compile文件

在第 278 行添加

  mkdir "$dirpath", 755;

看起来就像

  $log = ">>$dirpath/log";
  # empty it
  mkdir "$dirpath", 755;
  open(ZERO, ">$dirpath/log")  or die "cannot create $dirpath/log: $!";

然后尝试重新安装sa-compile

相关内容