Re: Setting a default location for files

[email protected] Tue, 11 Jan 2011 09:39:42 -0500
Newsgroups gmane.mail.spam.crm114
Message-ID <[email protected]>
Thomas Spahni <[email protected]> writes:

> Hi all
>
> It's a long time since my last post, but here I'm back.
>
> I have built a .rpm package of crm114 for the openSUSE distribution 
> (actually in my private repository, not (yet) public). Because these 
> packages are built for the x86_64 architecture as well, I picked the
> crm114-20081111-BlameBarack-Ger-4560.src.tar.bz2 version for the build.
>
> The installation puts the executables into /usr/bin/ and the crm scripts 
> and the .mfp and .css files into the /var/lib/crm114/ directory. This 
> directory is included in the PATH and .crm program files are found. Now I 
> would like to make /var/lib/crm114 the default location.
>
> This works:
>
> echo "Hello world" | crm -u /var/lib/crm114 mailreaver.crm
> Hello world
> X-CRM114-Version: 20081111-BlameBarack, rev 10118 (TRE 0.7.5 (LGPL, 
> APPROX,
> WCHAR, MULTIBYTE)) MR-5829E8AB
> X-CRM114-CacheID: sfid-20110111_143154_387710_B0E52071
> Message-Id: (sfid-20110111_143154_387710_B0E52071)
> X-CRM114-Status: UNSURE ( 0.00 )
> X-CRM114-Notice: Please train this message.
>
>
> This does not work:
>
> a) Changing the shebang line in the scripts to add the additional 
> arguments for crm114. Linux passes all remaining arguments as *one* 
> argument, which will be considered to be a filename with spaces.
>
> b) echo "Hello world" | mailreaver.crm --fileprefix=/var/lib/crm114/
>
>   Aw, crud.  maillib.crm broke.  Here's the error:
>
> crm114: *WARNING*
>   Nonexistent Classify table named: 
> /var/lib/crm114//var/lib/crm114//nonspam.css
> I'll try to keep working.
> This happened at line 3565 of file /var/lib/crm114/mailreaver.crm:
>      classify <:*:clf:> [:*:text:] /:*:lcr:/ /:*:clf_vt_cfg:/
> (:*:fileprefix::*:goodcss: | :*:fileprefix::*:spamcss: )
> (:classify_status:)
> (runtime system location: crm_osb_bayes.c(1433) in routine:
> crm_expr_osb_bayes_classify)
>
> This seems to be a bug in the mailreaver.crm script.
>
>
> Question: What is the preferred way to set a default file location system 
> wide? I want that users can just do:
>
> cat email.txt | mailreaver --good
>
> or similar. Thank you.

Hmmm.... (a) is particularly strange.  Here's my attempt to reproduce
the script (note linewrap fixups), which doesn't show the issue:

 bash-4.1$ uname -a
 Linux starbuck 2.6.34.7-56.fc13.x86_64 #1 SMP Wed Sep 15 03:36:55 UTC
 2010 x86_64 x86_64 x86_64 GNU/Linux
 bash-4.1$ 
 bash-4.1$ crm -v
  This is CRM114, version 20090807-BlameThorstenAndJenny (TRE 0.8.0
  (BSD))
  Copyright 2001-2006 William S. Yerazunis
  This software is licensed under the GPL with ABSOLUTELY NO WARRANTY
 bash-4.1$ 
 bash-4.1$ crm '-{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: \n/;}' foo bar
 HERE YOU GO!
  -{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3:
  \n/;} 
  foo 
  bar 
 bash-4.1$ 
 bash-4.1$ cat > crmdebug.sh
 crm '-{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: \n/;}' foo bar
 bash-4.1$ ./crmdebug.sh
 bash: ./crmdebug.sh: Permission denied
 bash-4.1$ sh ./crmdebug.sh 
 HERE YOU GO!
  -{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: \n/;} 
  foo 
  bar 
 bash-4.1$ 
 bash-4.1$ chmod a+x crmdebug.sh 
 bash-4.1$ ./crmdebug.sh 
 HERE YOU GO!
  -{window; output /HERE YOU GO!\n :*:_arg1: \n :*:_arg2: \n :*:_arg3: \n/;} 
  foo 
  bar 
 bash-4.1$ 

So, I honestly don't know what's wrong.  It seems to work fine, command
line args appear correctly both when typed in on the command line, and
when executed as part of a shell script.  But if something was causing 
everything to get bunched all together, then your second bug would
follow logically (i.e. the initialization scripts would not create
the .css files in the right places, and you'd see a failure).

What happens when you try to run the megatest script?  Does Megatest
pass?

     - Bill Yerazunis





------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl