Skip to content
Browse files

Updated to find either interchange.cfg or minivend.cfg

  • Loading branch information...
1 parent 152646d commit a71f1110122fc2ed8bc958bd9957faec2e798c6c @perusionmike perusionmike committed Sep 23, 2000
Showing with 128 additions and 44 deletions.
  1. +14 −1 scripts/configdump.PL
  2. +15 −4 scripts/dump.PL
  3. +15 −3 scripts/expire.PL
  4. +22 −9 scripts/expireall.PL
  5. +28 −17 scripts/interchange.PL
  6. +2 −4 scripts/localize.PL
  7. +17 −3 scripts/offline.PL
  8. +15 −3 scripts/update.PL
View
15 scripts/configdump.PL
@@ -55,14 +55,27 @@ BEGIN {
$Global::VendRoot = $Global::VendRoot || '/usr/local/interchange';
#$Global::VendRoot = $Global::VendRoot || '~_~INSTALLARCHLIB~_~';
$Global::ErrorFile = "$Global::VendRoot/error.log";
+
+ if(-f "$Global::VendRoot/interchange.cfg") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+ elsif(-f "$Global::VendRoot/minivend.cfg") {
+ $Global::ExeName = 'minivend';
+ $Global::ConfigFile = 'minivend.cfg';
+ }
+ elsif(-f "$Global::VendRoot/interchange.cfg.dist") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+
}
### END CONFIGURABLE VARIABLES
# dummy function used by Config.pm
sub debug { return undef }
-$Global::ConfigFile = 'minivend.cfg';
$Vend::ExternalProgram = 1;
use lib $Global::VendRoot;
View
19 scripts/dump.PL
@@ -25,7 +25,7 @@ DOIT: {
#
# Interchange session dumper
#
-# $Id: dump.PL,v 1.5 2000-09-20 19:58:01 zarko Exp $
+# $Id: dump.PL,v 1.6 2000-09-23 18:49:30 heins Exp $
#
# Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
#
@@ -69,14 +69,25 @@ $Global::VendRoot = $Global::VendRoot || '/usr/local/interchange';
if -f "$Global::VendRoot/_session_storable";
$ENV{MINIVEND_STORABLE_DB} = 1
if -f "$Global::VendRoot/_db_storable";
+
+ if(-f "$Global::VendRoot/interchange.cfg") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+ elsif(-f "$Global::VendRoot/minivend.cfg") {
+ $Global::ExeName = 'minivend';
+ $Global::ConfigFile = 'minivend.cfg';
+ }
+ elsif(-f "$Global::VendRoot/interchange.cfg.dist") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
}
### END CONFIGURABLE VARIABLES
sub debug { return undef }
-sub dontwarn { $FindBin::RealBin; }
-$Global::ConfigFile = 'minivend.cfg';
$Global::HammerLock = 20;
$Vend::ExternalProgram = 1;
@@ -239,7 +250,7 @@ dump -- Interchange session dumper
=head1 VERSION
-$Id: dump.PL,v 1.5 2000-09-20 19:58:01 zarko Exp $
+$Id: dump.PL,v 1.6 2000-09-23 18:49:30 heins Exp $
=head1 SEE ALSO
View
18 scripts/expire.PL
@@ -25,7 +25,7 @@ DOIT: {
#
# Interchange session expiration
#
-# $Id: expire.PL,v 1.5 2000-09-20 19:58:01 zarko Exp $
+# $Id: expire.PL,v 1.6 2000-09-23 18:49:30 heins Exp $
#
# Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
#
@@ -67,12 +67,24 @@ $Global::VendRoot = $Global::VendRoot || '/usr/local/interchange';
if -f "$Global::VendRoot/_session_storable";
$ENV{MINIVEND_STORABLE_DB} = 1
if -f "$Global::VendRoot/_db_storable";
+
+ if(-f "$Global::VendRoot/interchange.cfg") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+ elsif(-f "$Global::VendRoot/minivend.cfg") {
+ $Global::ExeName = 'minivend';
+ $Global::ConfigFile = 'minivend.cfg';
+ }
+ elsif(-f "$Global::VendRoot/interchange.cfg.dist") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
}
### END CONFIGURABLE VARIABLES
-$Global::ConfigFile = 'minivend.cfg';
$Global::HammerLock = 20;
$Global::ErrorFile = 'error.log';
@@ -129,7 +141,7 @@ usage: expire [-r|-u] -c catalog [-e 'SessionExpire']
expire [-r|-u] [-e 'SessionExpire'] sessionfile [sessionfile.lock]
OPTIONS
- -c catalog specify a catalog from minivend.cfg
+ -c catalog specify a catalog from interchange.cfg
-e time vary expire time from default in catalog.cfg.
time is a string like '4 hours' or '2 days'
View
31 scripts/expireall.PL
@@ -33,14 +33,27 @@ use lib '/usr/local/interchange';
use Getopt::Std;
-$VendRoot = $VendRoot || '/usr/local/interchange';
-#$VendRoot = $VendRoot || '~_~INSTALLARCHLIB~_~';
+$Global::VendRoot = $Global::VendRoot || '/usr/local/interchange';
+#$Global::VendRoot = $Global::VendRoot || '~_~INSTALLARCHLIB~_~';
## END CONFIGURABLE VARIABLES
BEGIN {
- ($VendRoot = $ENV{MINIVEND_ROOT})
+ ($Global::VendRoot = $ENV{MINIVEND_ROOT})
if defined $ENV{MINIVEND_ROOT};
+
+ if(-f "$Global::VendRoot/interchange.cfg") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+ elsif(-f "$Global::VendRoot/minivend.cfg") {
+ $Global::ExeName = 'minivend';
+ $Global::ConfigFile = 'minivend.cfg';
+ }
+ elsif(-f "$Global::VendRoot/interchange.cfg.dist") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
}
my $query;
@@ -49,19 +62,19 @@ $USAGE = <<EOF;
Expire all listed Interchange catalogs. Will read information from
either the file passed with -f or:
- $VendRoot/minivend.cfg
+ $Global::VendRoot/interchange.cfg
usage: expireall [-r] [-f file]
- -f Alternate minivend.cfg file
+ -f Alternate interchange.cfg file
-r Use reorganize parameter in command
EOF
use vars qw/$opt_e $opt_f $opt_n $opt_r/;
getopts('e:f:rn') or die "$@\n$USAGE\n";
-my $Configfile = $opt_f || "$VendRoot/minivend.cfg";
+my $Configfile = $opt_f || $Global::ConfigFile;
my $flag = '';
@@ -77,7 +90,7 @@ unless ($opt_n) {
$flag .= " -u";
}
-# Parse the minivend.cfg file to look for script/catalog info
+# Parse the interchange.cfg file to look for script/catalog info
PARSECFG: {
my $file;
my @cfglines;
@@ -97,7 +110,7 @@ PARSECFG: {
}
for(@cats) {
- system "$VendRoot/bin/expire $flag -c $_";
+ system "$Global::VendRoot/bin/expire $flag -c $_";
}
=head1 NAME
@@ -106,7 +119,7 @@ expireall -- Run Interchange expire on all catalogs
=head1 VERSION
-$Id: expireall.PL,v 1.5 2000-09-20 19:58:01 zarko Exp $
+$Id: expireall.PL,v 1.6 2000-09-23 18:49:30 heins Exp $
=head1 DESCRIPTION
View
45 scripts/interchange.PL
@@ -25,7 +25,7 @@ DOIT: {
#
# Interchange version 4.5.x
#
-# $Id: interchange.PL,v 1.2 2000-09-20 19:58:01 zarko Exp $
+# $Id: interchange.PL,v 1.3 2000-09-23 18:49:30 heins Exp $
#
# Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
#
@@ -67,7 +67,20 @@ BEGIN {
$Global::VendRoot = $Global::VendRoot || '/usr/local/interchange';
#$Global::VendRoot = $Global::VendRoot || '~_~INSTALLARCHLIB~_~';
-$Global::ConfigFile = 'minivend.cfg';
+
+ if(-f "$Global::VendRoot/interchange.cfg") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+ elsif(-f "$Global::VendRoot/minivend.cfg") {
+ $Global::ExeName = 'minivend';
+ $Global::ConfigFile = 'minivend.cfg';
+ }
+ elsif(-f "$Global::VendRoot/interchange.cfg.dist") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+
$Global::InitialErrorFile = $Global::ErrorFile = "$Global::VendRoot/error.log";
if($^O =~ /win32/i) {
@@ -222,7 +235,7 @@ use autouse 'Vend::Control' => qw/
signal_reconfig
signal_add
signal_remove
- control_minivend
+ control_interchange
change_catalog_directive
change_global_directive
remove_catalog
@@ -1937,7 +1950,6 @@ sub dontwarn {
$File::Find::prune +
<DATA> +
# END STATICPAGE
- $FindBin::RealBin +
$Global::AdminSub +
$Global::DomainTail +
$Global::FullUrl +
@@ -2030,7 +2042,7 @@ Exclude catalog from this startup.
=item -f file, --config=file
-Configuration file to use (default is minivend.cfg in VendRoot).
+Configuration file to use (default is interchange.cfg in VendRoot).
=item --files spec
@@ -2106,7 +2118,7 @@ Set a Interchange global directive upon start (or --restart). Example:
interchange SocketPerms=0666
This will start the server and override the default of SocketPerms or the
-value set in minivend.cfg for this instance only. Any --restarts must
+value set in interchange.cfg for this instance only. Any --restarts must
re-specify the directive if it is still to have that value.
=item name:Directive=value
@@ -2137,11 +2149,11 @@ Command line options (first letter will usually work):
from the standard input
-b catalog
--build=catalog build static page tree for catalog
- -d dir, --dir=dir directory for VendRoot (minivend.cfg, error.log, etc.)
+ -d dir, --dir=dir directory for VendRoot (interchange.cfg, error.log, etc.)
-e name,
--exclude=name exclude catalog
-f file,
- --config=file configuration file (default minivend.cfg)
+ --config=file configuration file (default interchange.cfg)
--files spec filespec (perl regexp OK) for static page tree
-h, --help display this message
-i, --inetmode run with Internet-domain socket (TCP)
@@ -2252,15 +2264,15 @@ sub parse_options {
test => $modesub,
unixmode => \$Global::Unix_Mode,
version => sub { version(); exit 0 },
- stop => \&control_minivend,
+ stop => \&control_interchange,
add => \&signal_add,
remove => \&signal_remove,
- kill => \&control_minivend,
+ kill => \&control_interchange,
Ignore => \$ignore,
restart => sub {
return if $ignore;
$ignore = 1;
- control_minivend('stop', 'TERM', 1);
+ control_interchange('stop', 'TERM', 1);
sleep 3;
exec $0, '--Ignore', @args;
},
@@ -2344,7 +2356,7 @@ sub parse_options {
# --- seed random generator
# --- set up a couple of preloaded arrays
# --- parse command-line options
-# --- read global configuration file minivend.cfg and
+# --- read global configuration file interchange.cfg and
# get catalog definitions
# --- configure each catalog and store its configuration
# in a reference mapped to the SCRIPT_NAME or catalog name
@@ -2367,9 +2379,9 @@ sub main_loop {
setup_escape_chars();
# These are only starting values, can be changed by command-line
- # options or the minivend.cfg file
+ # options or the interchange.cfg file
$Global::ConfDir = "$Global::VendRoot/etc";
- $Global::PIDfile = "$Global::ConfDir/minivend.pid";
+ $Global::PIDfile = "$Global::ConfDir/$Global::ExeName.pid";
$Vend::mode = 'serve'; # mode will be reset by options if appropriate
@@ -2415,7 +2427,6 @@ sub main_loop {
$Vend::CyberCash = $Vend::CyberCash || ! $@;
# These modules no longer necessary, why take up memory?
- delete $INC{'FindBin.pm'};
delete $INC{'Getopt/Long.pm'};
$Global::ErrorFile = "$Global::VendRoot/error.log"
@@ -2424,7 +2435,7 @@ sub main_loop {
chdir($Global::VendRoot)
or die "Couldn't change directory to $Global::VendRoot: $!\n";
- $Global::ConfigFile = "$Global::VendRoot/minivend.cfg"
+ $Global::ConfigFile = "$Global::VendRoot/$Global::ExeName.cfg"
if ! $Global::ConfigFile;
die "Interchange not configured, no $Global::ConfigFile.\n"
@@ -2439,7 +2450,7 @@ print errmsg("\n##### DEBUG MODE, running in foreground #####\n") if $Global::DE
# Restrictive file permissions to begin with
umask 077;
- # Read minivend.cfg (or whatever its name is set to be)
+ # Read interchange.cfg (or whatever its name is set to be)
global_config();
#::logDebug(::uneval(\%Global::Catalog));
View
6 scripts/localize.PL
@@ -24,7 +24,7 @@ DOIT: {
#
# Interchange localizer
#
-# $Id: localize.PL,v 1.5 2000-09-20 19:58:01 zarko Exp $
+# $Id: localize.PL,v 1.6 2000-09-23 18:49:30 heins Exp $
#
# Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
#
@@ -66,8 +66,6 @@ $Global::ErrorFile = "$Global::VendRoot/error.log";
### END CONFIGURABLE VARIABLES
-sub dontwarn { $FindBin::RealBin; }
-
use Vend::Util qw(readfile escape_chars);
require Vend::Config;
use Getopt::Std;
@@ -353,7 +351,7 @@ localize -- produce Interchange localization file from set of pages
=head1 VERSION
-$Id: localize.PL,v 1.5 2000-09-20 19:58:01 zarko Exp $
+$Id: localize.PL,v 1.6 2000-09-23 18:49:30 heins Exp $
=head1 SYNOPSIS
View
20 scripts/offline.PL
@@ -25,7 +25,7 @@ DOIT: {
#
# offline - Interchange database builder and indexer
#
-# $Id: offline.PL,v 1.4 2000-09-20 19:58:01 zarko Exp $
+# $Id: offline.PL,v 1.5 2000-09-23 18:49:30 heins Exp $
#
# Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
#
@@ -69,11 +69,25 @@ BEGIN {
$Global::VendRoot = $Global::VendRoot || '/usr/local/interchange';
# $Global::VendRoot = $Global::VendRoot || '~_~INSTALLARCHLIB~_~';
+
+ if(-f "$Global::VendRoot/interchange.cfg") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+ elsif(-f "$Global::VendRoot/minivend.cfg") {
+ $Global::ExeName = 'minivend';
+ $Global::ConfigFile = 'minivend.cfg';
+ }
+ elsif(-f "$Global::VendRoot/interchange.cfg.dist") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+
+}
}
### END CONFIGURABLE VARIABLES
-$Global::ConfigFile = 'minivend.cfg';
$Global::ErrorFile = "$Global::VendRoot/error.log";
$Vend::ExternalProgram = 1;
@@ -263,7 +277,7 @@ offline -- Interchange offline database builder
=head1 VERSION
-$Id: offline.PL,v 1.4 2000-09-20 19:58:01 zarko Exp $
+$Id: offline.PL,v 1.5 2000-09-23 18:49:30 heins Exp $
=head1 DESCRIPTION
View
18 scripts/update.PL
@@ -25,7 +25,7 @@ DOIT: {
#
# update - Interchange database updater
#
-# $Id: update.PL,v 1.5 2000-09-20 19:58:01 zarko Exp $
+# $Id: update.PL,v 1.6 2000-09-23 18:49:30 heins Exp $
#
# Copyright (C) 1996-2000 Akopia, Inc. <info@akopia.com>
#
@@ -61,12 +61,24 @@ BEGIN {
if defined $ENV{MINIVEND_ROOT};
$Global::VendRoot = $Global::VendRoot || '/usr/local/interchange';
# $Global::VendRoot = $Global::VendRoot || '~_~INSTALLARCHLIB~_~';
+
+ if(-f "$Global::VendRoot/interchange.cfg") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
+ elsif(-f "$Global::VendRoot/minivend.cfg") {
+ $Global::ExeName = 'minivend';
+ $Global::ConfigFile = 'minivend.cfg';
+ }
+ elsif(-f "$Global::VendRoot/interchange.cfg.dist") {
+ $Global::ExeName = 'interchange';
+ $Global::ConfigFile = 'interchange.cfg';
+ }
}
### END CONFIGURABLE VARIABLES
sub dontwarn { $FindBin::RealBin; }
-$Global::ConfigFile = 'minivend.cfg';
$Global::ErrorFile = "$Global::VendRoot/error.log";
$Vend::ExternalProgram = 1;
@@ -123,7 +135,7 @@ usage: update -c catalog -i inputfile [-n name]
Options:
- -c catalog Catalog name as defined in minivend.cfg.
+ -c catalog Catalog name as defined in interchange.cfg.
-f field Field name(s) in database. If multiple fields are specified,
multiple corresponding values must be supplied. Use '' to
set to the empty string.

0 comments on commit a71f111

Please sign in to comment.
Something went wrong with that request. Please try again.