Problem with BEGIN statement in fs-setup

Louis Erickson loki at rdwarf.com
Thu Oct 25 00:31:44 PDT 2001


Hi there!  I've looked at the website and freeside looks like it'll be a
very useful package which does many cool things.  I'm hoping I can get it
to work, before my hand-cobbled together Excel sheets make me insane.  =)

I'm having a couple of problems.  One, I know how to work around, and I
will probably submit patches when I'm ready.  The other is more of a
problem - I have no idea what's wrong.

I have gone through the installation list and installed all the modules
requested, and updated to the current version on CPAN.  I also know that
my database and DBD module work, from other working perl applications.

I'm running under Linux 2.4.4-64GB-SMP.  Perl is 5.6.0. DBI seems to be
version 11.3.  DBD is DBD::InterBase version 1.24.  Yes, I realize I'm
asking for a world of hurt by using a strange database, but that's
something I think I can cope with, and I like InterBase.  I don't think
it's causing the problem, either.

One of the problems I have is related to InterBase; but I have a solution
for it. Unfourtenately, it requires a minor patch.

The configuration directories are named conf.<datasource>,
counters.<datasource>, and export.<datasource>.  The samples for the mySQL
and Postgres are pretty simple, with one note that you'll have to escape
the semicolon.  Interbase, however uses data sources like this:

DBI:InterBase:db=/opt/interbase/data/freeside.gdb

See those pesky little slashes?  Putting those in the filename is kind of
impossible.

My solution is to find wherever they're built (Record.pm, UID.pm and
fs-setup so far) is to replace the slashes with something else:

  my $clean_name = $conf_dir. "/conf.$datasrc";
  $clean_name =~ s:/:.:g;
  $FS::Conf::default_dir = $clean_name;

So, rather than the impossible
conf.DBI:InterBase:db=/opt/interbase/data/freeside.gdb, I wind up using
conf.DBI:InterBase:db=.opt.interbase.data.freeside.gdb instead, which is
somewhat fathomable.  When I get things working to my satisfaction, I'll
make patches available to the developers.  I'm hoping this is the biggest
change needed for Interbase support.

The problem I have that I can't work around is while trying to run
fs-setup.  I get the following error, and I don't know why.

Running fs-setup produces:

./fs-setup: line 140: syntax error near unexpected token `}'
./fs-setup: line 140: `BEGIN { $FS::Record::setup_hack = 1; }'

If I run fs-setup as root, I get the usual "Not running UID freeside! at
./fs-setup line 155." which is what I would expect.

When I run it as freeside, I get the strange error with BEGIN.

I've tried moving things around, and adding extra code and such, to no
avail.

Again, let me reiterate that this is a clean copy of freeside, not my
modified one. Have I missed some simple thing in the installation?

Any suggestions would be quite appreciated.

Thank you!

-- 
Louis Erickson - loki at rdwarf.com - http://www.rdwarf.com/~wwonko/

If a camel is a horse designed by a committee, then a consensus
forecast is a camel's behind.
		-- Edgar R. Fiedler




More information about the freeside-users mailing list