[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to handle configuration that modifies files in /usr



On Thu, Jan 16, 2003 at 11:57:56PM +0100, martin f krafft wrote:

 > How would you suggest that I go about packaging this? I can certainly
 > install the #1 files as .in (#3) files because Debian already guards
 > against loss of customization. But I still have the same problem,
 > albeit a little smaller. I guess I could move the .in (#3) files to
 > /usr/share/mharc or the like, but configuration still changes the
 > files in /usr/lib/mharc, and I don't know how to deal with that. Do I
 > have to move all the scripts that suffer from this to /var and leave
 > the .in files in place? Mh. This might actually be the best idea...

 How about "you *gasp* patch the damm thing"?

 Let's see...

use lib '@@SW_ROOT@@/lib';

 just install MHArc::Stuff to /usr/share/perl5/MHArc/Stuff.pm and do
 without that line...

my $mbox_archive_root = '@@MBOX_DIR@@';

 Instead of that, do something like:

/etc/mharc/config.rc:

    $mbox_archive_root = "/some/root";

cgi-bin/thing.cgi:

    do "/etc/mharc/config.rc";

    $::mbox_archive_root ||= $Defaults::mbox_archive_root;

 pack the whole thing in a sub, replace the do EXPR by something like
 AppConfig, put some error handling in there.  But I guess you get the
 idea.

 Oh, yes, put the files in /etc/mharc/list/config.rc and devise a method
 to pass the proper list to the scripts.  CGI parameters or whatever...

-- 
Marcelo



Reply to: