head	1.30;
access;
symbols
	TIGRIS_1_1_0RC2:1.27.6.1
	TIGRIS_1_1_0RC1:1.27.6.1
	EB_WM:1.30
	TIGRIS_1_1:1.27.6.1.0.2
	TIGRIS_1_0_8:1.27.6.1
	TIGRIS_1_0_8RC3:1.27.6.1
	TIGRIS_1_0_8RC2:1.27.6.1
	TIGRIS_1_0_8RC1:1.27.6.1
	TIGRIS_1_0_7:1.27.6.1
	TIGRIS_1_0_7RC3:1.27.6.1
	TIGRIS_1_0_7RC2:1.27.6.1
	TIGRIS_1_0_7RC1:1.27
	TIGRIS_1_0_6:1.27
	TIGRIS_1_0_6RC5:1.27
	TIGRIS_1_0_6RC4:1.27
	TIGRIS_1_0_6RC3:1.27
	TIGRIS_1_0_6RC2:1.27
	TIGRIS_1_0_6RC1:1.27
	TIGRIS_1_0_5:1.27
	TIGRIS_1_0_5RC6:1.27
	TIGRIS_1_0_5RC5:1.27
	TIGRIS_1_0_5RC4:1.27
	TIGRIS_1_0_5RC3:1.27
	TIGRIS_1_0_5RC2:1.27
	TIGRIS_1_0_5RC1:1.27
	TIGRIS_1_0_4:1.27
	TIGRIS_1_0_3:1.27
	TIGRIS_1_0_2:1.27
	TIGRIS_1_0_1:1.27
	TIGRIS_1_0:1.27.0.6
	TIGRIS_1_0_0:1.27
	TIGRIS_1_0_0_RC1:1.27.0.2
	HELM_PEER_PORT_BRANCH:1.25.0.2
	TIGRIS_0_9_2_4:1.23
	TIGRIS_0_9_2_3:1.23
	TIGRIS_0_9_2:1.23.0.2
	TIGRIS_0_9_0:1.21.0.4
	TIGRIS_0_8_4:1.21.0.2
	EYEBROWSE_WM_0_89:1.10
	pre-joist:1.6
	rc-02:1.2;
locks; strict;
comment	@# @;


1.30
date	2001.06.30.16.30.35;	author edk;	state Exp;
branches;
next	1.29;

1.29
date	2001.06.19.01.19.06;	author jhunter;	state Exp;
branches;
next	1.28;

1.28
date	2001.06.04.22.33.07;	author ms;	state Exp;
branches;
next	1.27;

1.27
date	2001.03.02.20.26.19;	author ms;	state Exp;
branches
	1.27.6.1;
next	1.26;

1.26
date	2001.03.02.03.05.20;	author ms;	state Exp;
branches;
next	1.25;

1.25
date	2001.02.05.22.50.01;	author ms;	state Exp;
branches;
next	1.24;

1.24
date	2001.01.31.01.24.21;	author ms;	state Exp;
branches;
next	1.23;

1.23
date	2000.12.22.20.40.04;	author edk;	state Exp;
branches;
next	1.22;

1.22
date	2000.12.22.12.28.54;	author edk;	state Exp;
branches;
next	1.21;

1.21
date	2000.11.30.12.00.17;	author edk;	state Exp;
branches
	1.21.2.1
	1.21.4.1;
next	1.20;

1.20
date	2000.11.30.10.56.10;	author edk;	state Exp;
branches;
next	1.19;

1.19
date	2000.11.22.02.41.24;	author ms;	state Exp;
branches;
next	1.18;

1.18
date	2000.11.22.02.38.17;	author ms;	state Exp;
branches;
next	1.17;

1.17
date	2000.11.09.06.12.02;	author edk;	state Exp;
branches;
next	1.16;

1.16
date	2000.11.08.19.16.07;	author ms;	state Exp;
branches;
next	1.15;

1.15
date	2000.11.08.19.00.25;	author ms;	state Exp;
branches;
next	1.14;

1.14
date	2000.11.07.22.28.43;	author dlr;	state Exp;
branches;
next	1.13;

1.13
date	2000.11.07.22.12.45;	author edk;	state Exp;
branches;
next	1.12;

1.12
date	2000.11.07.20.13.24;	author dlr;	state Exp;
branches;
next	1.11;

1.11
date	2000.11.07.04.24.06;	author edk;	state dead;
branches;
next	1.10;

1.10
date	2000.10.21.00.14.17;	author ms;	state Exp;
branches;
next	1.9;

1.9
date	2000.10.12.18.24.48;	author ms;	state Exp;
branches;
next	1.8;

1.8
date	2000.10.04.22.50.36;	author ms;	state Exp;
branches;
next	1.7;

1.7
date	2000.09.27.10.44.24;	author ms;	state Exp;
branches;
next	1.6;

1.6
date	2000.08.29.01.31.32;	author ms;	state Exp;
branches;
next	1.5;

1.5
date	2000.08.28.22.02.41;	author ms;	state Exp;
branches;
next	1.4;

1.4
date	2000.08.28.20.38.09;	author ms;	state Exp;
branches;
next	1.3;

1.3
date	2000.08.28.20.32.48;	author ms;	state Exp;
branches;
next	1.2;

1.2
date	2000.06.16.00.03.19;	author goetz;	state Exp;
branches;
next	1.1;

1.1
date	2000.06.01.03.36.38;	author goetz;	state Exp;
branches;
next	;

1.21.2.1
date	2001.01.10.21.42.58;	author ms;	state Exp;
branches;
next	;

1.21.4.1
date	2000.12.22.12.12.12;	author edk;	state Exp;
branches;
next	1.21.4.2;

1.21.4.2
date	2000.12.22.20.51.53;	author edk;	state Exp;
branches;
next	1.21.4.3;

1.21.4.3
date	2001.01.07.21.31.21;	author ms;	state Exp;
branches;
next	1.21.4.4;

1.21.4.4
date	2001.01.11.22.06.28;	author ms;	state Exp;
branches;
next	;

1.27.6.1
date	2001.06.30.16.30.09;	author edk;	state Exp;
branches;
next	;


desc
@@


1.30
log
@add a way to delete the index flag for a list
@
text
@#!/usr/bin/perl -w

#  Copyright (c) 2000, Quiotix Corporation
#         All rights reserved.
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions are
#  met:
#
#       Redistributions of source code must retain the above copyright
#  notice, this list of conditions and the following disclaimer.
#
#       Redistributions in binary form must reproduce the above copyright
#  notice, this list of conditions and the following disclaimer in the
#  documentation and/or other materials provided with the distribution.
#
#       Neither name of Quiotix Corporation nor the names of its
#  contributors may be used to endorse or promote products derived from
#  this software without specific prior written permission.
#
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
#  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
#  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
#  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
#  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
#  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
#  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
#  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
#  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
#  OF THE POSSIBILITY OF SUCH DAMAGE.  
#


#
# eyebrowse: Perl script to wrap eyebrowse commands so that the user doesn't 
# have to type in the annoying fully qualified class path names.
#
# $Id: eyebrowse,v 1.29 2001/06/19 01:19:06 jhunter Exp $
#

#
# Note: there are many known issues with running this script under Windows
#

use strict;
use Fcntl ':flock'; 
use Getopt::Long;

my %switch = ('command'=>'',
              'listname'=>'',
              'descr'=>'',
              'listfile'=>'',
              'props'=>'',
              'logfile'=>'',
              'listid'=>'',
	      'indexdir'=>'');

GetOptions(\%switch => qw(command=s listname=s descr=s listfile=s props=s logfile=s listid=s indexdir=s) );
$switch{'command'} = lc $switch{'command'};

my $propfilename = "eyebrowse.properties";
if ($switch{props} eq '') {
   $switch{props} = &findPropsInCP;
}

my $props = &parseProps($switch{props});
my $opts = $props->{'org.tigris.eyebrowse.jvmOpts'} || '';


my $SEPERATOR = ($^O =~ m/win/i) ? '\\' : '/';

# if there are single quotes around the args, as suggested by the base value,
# then we need to strip them.
$opts =~ s/^'//;
$opts =~ s/'$//;

my $jarLocation = $props->{'org.tigris.eyebrowse.jarFile'};
   $jarLocation = '' unless -e $jarLocation;

my %commands = (addindex    => 'AddIndex',
		addlist     => 'AddList',
		addlistfile => 'AddListFile',
		deletelist  => 'DeleteList',
		deleteindex => 'DeleteIndex',
		getlistfile => 'GetListFile',
		getlists    => 'GetLists',
		update      => 'Update',
		updatelist  => 'UpdateList',
		updateindex => 'UpdateIndex',
		props       => 'props');

# search the CLASSPATH as a last resort to find the properties file.
sub findPropsInCP {
    my $fullPath;
    for (split ':', $ENV{CLASSPATH}) {
        if ( -d $_) {
            $fullPath =  $_ . $SEPERATOR . $propfilename;
            return $fullPath if -e $fullPath;
        }
    return 'FILE NOT FOUND IN CLASSPATH';
    }
}

# Parse the Eyebrowse properties file as from the location passed to the script
# or from the CLASSPATH , returns a hash ref.
sub parseProps {
    my $fname = shift;
    my %props = ();
    if (-e $fname) {
        open PROPS, $fname or die "Can't open $fname: $!\n";
	while (<PROPS>) {
            next if ( m/^[ ]*\#/ );
            if ( m/\s*([^\s=]*)\s*=\s*(.*\S)\s*$/ ){
               $props{$1} = $2;
            }
        }
        close PROPS;
    } else {
        die "Could not locate properties file: $fname\n";
    }
    return \%props;
}

# Prints a list of the commands understood by Eyebrowse.
sub help {
    my $lcommands = shift;
    print "The valid commands for EyeBrowse are:\n";
    print "\t$_\n" for (keys %$lcommands);
}

# Wrap eyebrowse UpdateList program with file locking which sendmail will 
# (hopefully) respect.
sub safeUpdate {
    my ($ljava,$listName,$progPath) = @@_[0..2];
    my $getList = $progPath . '.GetListFile';
    my $updateList = $progPath . '.UpdateList';
    $listName or die 'No list name specified';
    my $mailFile = `$ljava $getList $listName`;
    $mailFile or die "Can't retrieve mailbox file for list $listName";
    open MBOX, $mailFile or die "Can't open $mailFile: $!\n";
    flock(MBOX, LOCK_EX);
    system($ljava, "$updateList", $listName);
    flock(MBOX, LOCK_UN);
}

sub clearAll {
	$, = '  ';
	my $cmd;
	for (@@_[0..4]) {
	  $cmd .= "$_ ";
	}
	$cmd =~ s/\s+?$//;
	foreach my $list(`$cmd.GetLists`) {
	   if (`$cmd.DeleteList $list`) {
		print "Successfully removed $list";
	   } else {
		print "Cannot remove list $list: $!\n";
	   }
	}
}

my $java;
my $progPath = 'org.tigris.eyebrowse.programs';

if (-e "$ENV{JAVA_HOME}/bin/java") {
    $java = "$ENV{JAVA_HOME}/bin/java";
} else {
    die "You must first install a JVM or JRE then set JAVA_HOME to run\n";
}

my $cp = "$ENV{CLASSPATH}:" . $props->{'org.tigris.eyebrowse.installPath'} . "/conf/eyebrowse";
$cp =~ s/:\.?:/:/g;             # remove :.: and :: patterns to just :
my $newCp = $cp . ":" . $jarLocation;
my @@cmds = ($java);
push @@cmds, split / /, $opts if $opts and $opts ne "''";
push @@cmds, ("-classpath", $newCp, $progPath);
if (defined $commands{$switch{command}}) {
    $cmds[$#cmds] .= ".$commands{$switch{command}}"; 
    my @@command = (@@cmds, $switch{listname});
    if ($switch{descr}) {
        push @@command, $switch{descr};
    }

    if ($switch{command} eq 'addlist') {
        push @@command, $switch{listid} if ($switch{listid} ne "");
    } elsif ($switch{command} !~ 'index') {
        push @@command, $switch{listfile} if ($switch{listfile} ne "");
    } else {
	push @@command, $switch{indexdir};
    }
    fork || do {
        exec @@command;
    };
    wait;
} elsif ($switch{command} eq 'clearall') {
    &clearAll(@@cmds);
} elsif($switch{command} eq 'safeUpdate') {
    &safeUpdate($java, $switch{listname}, $progPath);
} elsif ($switch{command} eq 'help') {
    &help(\%commands);
} else {    
    print "Unknown eyebrowse command: $switch{command}\n";
}
@


1.29
log
@Added a comment that the eyebrowse script has known issues on Windows.
Help save others from banging their head against that task.

-jh-
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.28 2001/06/04 22:33:07 ms Exp $
d86 1
@


1.28
log
@removed last sandbox reference. passing --props switch forces explicit passing of file, also will look in CLASSPATH for properties file.
@
text
@d40 5
a44 1
# $Id: eyebrowse,v 1.27 2001/03/02 20:26:19 ms Exp $
@


1.27
log
@preventing npe's in use
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.26 2001/03/02 03:05:20 ms Exp $
d58 6
d67 3
d86 2
a87 1
		updateindex => 'UpdateIndex');
d89 11
d101 2
a102 4
# Parse the Eyebrowse properties file (from the conf directory).  Returns a
# hash ref.
#
# ex. my $hashref = &parseProps('eyebrowse.properties');
a103 1
    my $basename = 'eyebrowse.properties';
a104 2
    $fname = "$ENV{SANDBOX}/conf/eyebrowse/$basename" unless $fname;
    $fname = "../../conf/$basename" unless -e $fname;
d116 1
a116 1
        die "Could not locate properties file: $basename";
@


1.27.6.1
log
@add a way to delete the index flag for a list
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.27 2001/03/02 20:26:19 ms Exp $
a72 1
		deleteindex => 'DeleteIndex',
@


1.26
log
@fixed bug that required listid to be explicity given for addition of lists
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.25 2001/02/05 22:50:01 ms Exp $
d168 1
a168 1
        push @@command, $switch{listfile};
@


1.25
log
@Fixed so indexes could be added.
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.24 2001/01/31 01:24:21 ms Exp $
d166 1
a166 1
        push @@command, $switch{listid};
@


1.24
log
@only need to lowercase the input command for user ease, this is a change from a branch that i forgot to put in HEAD also
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.23 2000/12/22 20:40:04 edk Exp $
d53 4
a56 2
              'listid'=>'' );
GetOptions(\%switch => qw(command=s listname=s descr=s listfile=s props=s logfile=s listid=s) );
d167 2
d170 1
a170 1
        push @@command, $switch{listfile};
@


1.23
log
@fix typos
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.22 2000/12/22 12:28:54 edk Exp $
d55 1
a55 1
$switch{$_} = lc $switch{$_} for (keys %switch);
@


1.22
log
@port changes from the branch to the head: copy index2mbox.pl and
handle jvmOpts (which may contain spaces or be surrounded by "'") better
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.21.4.1 2000/12/22 12:12:12 edk Exp $
d61 2
a62 2
$opts = s/^'//;
$opts = s/'$//;
@


1.21
log
@descr is optional for most commands -- handle it appropriately
(before my last change, when this used `...` -- the effect was equivalent
in terms of this particular parameter)
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.20 2000/11/30 10:56:10 edk Exp $
d57 7
a63 1
my $opts = $props->{'org.tigris.eyebrowse.jvmOpts'};
d92 1
a92 1
            if ( m/\s*([^\s=]*)\s*=\s*([^\s]*)$/ ){
@


1.21.2.1
log
@Lingering bug that went unnoticed that would've forced lists and filenames to be
all lowercase. Only the command was and needs to be lowercased for user convenience.
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.21 2000/11/30 12:00:17 edk Exp $
d55 1
a55 1
$switch{'command'} = lc $switch{'command'};
@


1.21.4.1
log
@copy index2mbox.pl into the scripts directory, and make eyebrowse deal
better with jvmOpts (which may contain spaces or be surrounded by single
quotes)
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.21 2000/11/30 12:00:17 edk Exp $
d57 1
a57 7
my $opts = $props->{'org.tigris.eyebrowse.jvmOpts'} || '';

# if there are single quotes around the args, as suggested by the base value,
# then we need to strip them.
$opts = s/^'//;
$opts = s/'$//;

d86 1
a86 1
            if ( m/\s*([^\s=]*)\s*=\s*(.*\S)\s*$/ ){
@


1.21.4.2
log
@fix typo
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.21.4.1 2000/12/22 12:12:12 edk Exp $
d61 2
a62 2
$opts =~ s/^'//;
$opts =~ s/'$//;
@


1.21.4.3
log
@Updating branch to match updates in head
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.23 2000/12/22 20:40:04 edk Exp $
@


1.21.4.4
log
@added locking to 0_9_0 branch
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.21.4.3 2001/01/07 21:31:21 ms Exp $
d55 1
a55 1
$switch{'command'} = lc $switch{'command'};
@


1.20
log
@support the listid parameter for adding a list
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.19 2000/11/22 02:41:24 ms Exp $
d152 5
a156 1
    my @@command = (@@cmds, $switch{listname}, $switch{descr});
@


1.19
log
@Small cosmetic changes to output formatting.
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.18 2000/11/22 02:38:17 ms Exp $
d47 8
a54 2
my %switch = ();
GetOptions(\%switch => qw(command=s listname=s descr=s listfile=s props=s logfile=s) );
d152 10
a161 2
    local $^W=0;
    print `@@cmds $switch{listname} $switch{descr} $switch{listfile}`;
@


1.18
log
@Fixed the command-line arguments setup after adding parameters became too ugly.
Did a once-over on the entire-script
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.17 2000/11/09 06:12:02 edk Exp $
d120 1
a120 1
	for my $list(`$cmd.GetLists`) {
d122 1
a122 1
		print "Successfully removed $list\n";
@


1.17
log
@jvmArguments may be empty (or '', which means the same thing) --
handle that cleanly.
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.16 2000/11/08 19:16:07 ms Exp $
d45 1
d47 4
a50 7
my $command = lc shift; 
my $listname = shift;	$listname = '' unless $listname;
my $descr = shift;	$descr    = '' unless $descr;
my $props = &parseProps(shift);

my $java;
my $cp = "$ENV{CLASSPATH}:" . $props->{'org.tigris.eyebrowse.installPath'} . "/conf/eyebrowse";
a64 1
my $progPath = 'org.tigris.eyebrowse.programs';
d79 4
a82 2
            m/\s*([^\s=]*)\s*=\s*([^\s]*)$/ unless m/^[ ]*\#/;
	    $props{$1} = $2 if $1;
a121 1
		chomp $list;
d124 1
a124 1
		 print "Cannot remove list $list: $!\n";
d129 3
d138 1
d140 1
a140 5

my ($newCp);

$newCp = join(':', (split /:/, $cp), $jarLocation);

d144 5
a148 5

if (defined $commands{$command}) {
    $cmds[$#cmds] .= ".$commands{$command}"; 
    system(@@cmds, $listname, $descr);
} elsif ($command eq 'clearall') {
d150 3
a152 3
} elsif($command eq 'safeUpdate') {
    &safeUpdate($java, $listname, $progPath);
} elsif ($command eq 'help') {
d155 1
a155 1
    print "Unknown eyebrowse command: $command\n";
@


1.16
log
@More cleanup
Submitted by:	Michael Salmon
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.15 2000/11/08 19:00:25 ms Exp $
d143 4
a146 1
my @@cmds = ($java, $opts, "-classpath", $newCp, $progPath);
d148 1
a148 1
    $cmds[4] .= ".$commands{$command}"; 
@


1.15
log
@Minor cleaning
Submitted by:	Michael Salmon
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.14 2000/11/07 22:28:43 dlr Exp $
d46 3
a48 3
chomp(my $command = lc shift); 
chomp(my $listname = shift);	$listname = '' unless $listname;
chomp(my $descr = shift);	$descr    = '' unless $descr;
a142 1
print STDERR "cp: $newCp\n";
@


1.14
log
@A little space is a good thing.
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.13 2000/11/07 22:12:45 edk Exp $
d46 5
a50 7
my $command = lc shift;
my $listname = shift;
my $descr = shift;
$listname = '' unless $listname;
$descr = '' unless $descr;
chomp $descr;
chomp $command;
d52 1
a52 3
my $props = &parseProps(shift);
my $cp = "$ENV{CLASSPATH}:" . $props->{'org.tigris.eyebrowse.installPath'} .
  "/conf/eyebrowse";
d70 1
a70 1
# hash handle.
a120 1
	#print "$cmd.GetLists";return 1;
@


1.13
log
@fix some annoying minor syntactic problems (perl doesn't seem to like '.'
in the middle of unquoted string litterals, presumably because it's an
operator), and -- if we're using $ENV{SANDBOX} -- use the right path:
conf/eyebrowse/eyebrowse.properties, not
eyebrowse/conf/eyebrowse.properties
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.12 2000/11/07 20:13:24 dlr Exp $
d55 1
a55 2
my $cp = 
  "$ENV{CLASSPATH}:".$props->{'org.tigris.eyebrowse.installPath'}.
@


1.12
log
@Updated to remove the need for a .in script file.  Now makes use of the Eyebrowse properties file.
@
text
@d40 1
a40 1
# $Id: $
d56 4
a59 3
  "$ENV{CLASSPATH}:$props->{org.tigris.eyebrowse.installPath}/conf/eyebrowse";
my $opts = "$props->{org.tigris.eyebrowse.jvmOpts}";
my $jarLocation = "$props->{org.tigris.eyebrowse.jarFile}";
d81 1
a81 1
    $fname = "$ENV{SANDBOX}/eyebrowse/conf/$basename" unless $fname;
d149 1
@


1.11
log
@replaced eyebrowse w/ eyebrowse.in -- there are some tokens which will
need to be replaced for this to work normally.  some minor changes
(check to see if the jar file exists, formatting)
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.10 2000/10/21 00:14:17 ms Exp $
d48 4
a51 1
chomp(my $descr = shift);
d54 16
a69 8
my $cp="$ENV{CLASSPATH}:$ENV{SANDBOX}/site/java";
my $opts = "-nojit";
my $jarLocation = "$ENV{SANDBOX}/site/lib/eyebrowse.jar" if ($ENV{SANDBOX} ne '');
my %commands = ('addlist'    => 'AddList',    'addlistfile' => 'AddListFile', 'addindex'    => 'AddIndex',
	     'deletelist' => 'DeleteList', 'updatelist'  => 'UpdateList',  'updateindex' => 'UpdateIndex',
	     'update'     => 'Update',     'getlists'    => 'GetLists',    'getlistfile' => 'GetListFile'
	     );
my $progPath = "org.tigris.eyebrowse.programs";
d71 27
a97 1
sub help{
d100 1
a100 1
    print "\t$_\n" for(keys %$lcommands);
d103 3
a105 3
sub safeupdate{
    # Wrap eyebrowse UpdateList program with file locking which
    # sendmail will (hopefully) respect.
d109 1
a109 1
    $listName or die "No list name specified";
d112 1
a112 1
    open MBOX, $mailFile or die "Can't open $mailFile: error[$!]\n";
d119 1
a119 1
	$,="  ";
d121 1
a121 1
	for(@@_[0..4]){
d126 2
a127 2
	for my $list(`$cmd.GetLists`){
	   if(`$cmd.DeleteList $list`){
d130 2
a131 2
	   }else{
		 print "Cannot remove list $list, error [$!]\n";
d136 1
a136 1
if(-e "$ENV{JAVA_HOME}/bin/java"){
d138 1
a138 1
}else{
d142 5
a146 1
$cp=~s/:\.?:/:/g;             # remove :.: and :: patterns to just :
d148 3
a150 7
my (%hack, $newCp);
$hack{$_}=$_ for(split /:/,$cp);
$newCp .= "$_:" for(keys %hack,$jarLocation);
chop $newCp;
my @@cmds=($java, $opts, "-classpath", $newCp, $progPath);
if(defined $commands{$command}){
    $cmds[4].=".$commands{$command}"; 
d152 1
a152 1
}elsif($command eq 'clearall'){
d154 3
a156 3
}elsif($command eq 'safeupdate'){
    &safeupdate($java,$listname,$progPath);
}elsif($command eq 'help'){
d158 1
a158 1
}else{    
@


1.10
log
@corrected problem with command input
Submitted by:	Michael Salmon
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.9 2000/10/12 18:24:48 ms Exp $
@


1.9
log
@Some minor cleanups and error checks
Submitted by:	Michael Salmon
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.8 2000/10/04 22:50:36 ms Exp $
d56 1
a56 1
	     'update'     => 'Update',     'getlists'    => 'GetLists',    'getlistFile' => 'GetListFile'
@


1.8
log
@Problems with the sytem call and cleaned up some of the environment.
Submitted by:	Michael Salmon
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.7 2000/09/27 10:44:24 ms Exp $
d48 1
d51 1
a51 1
my $cp=$ENV{CLASSPATH};
d53 1
a53 1
my $jarLocation = "/home/$ENV{USER}/sandbox/site/lib/eyebrowse.jar" if ($ENV{USER} ne '');
d55 1
a55 1
	     'deletelist' => 'DeleteList', 'updatelist'  => 'UpdateList',  'updateIndex' => 'UpdateIndex',
d81 17
d111 1
a111 1
my @@cmds=($java, $opts, "-classpath", $newCp, "$progPath\.$commands{$command}", @@ARGV);
d113 5
a117 2
    system(@@cmds);
}elsif(lc$command eq 'safeupdate'){
d119 1
a119 1
}elsif(lc$command eq 'help'){
@


1.7
log
@Small edits for java execution
Submitted by:	Michael Salmon
@
text
@d40 1
a40 1
# $Id: eyebrowse,v 1.6 2000/08/29 01:31:32 ms Exp $
d50 2
a52 1
my $cp = "$ENV{CLASSPATH}:$jarLocation";
d87 7
d95 1
a95 1
    system($java, " -classpath $cp", " $progPath\.$commands{$command} ", @@ARGV);
d100 1
a100 1
}else{
a102 1

@


1.6
log
@Applied patch given to me by Daniel Rall
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@d40 1
a40 1
# $Id: $
d50 2
a51 1

d56 1
a56 1
my $progPath = "com.quiotix.eyebrowse.programs";
d87 1
a87 1
    system($java, $progPath.$commands{$command}, @@ARGV);
@


1.5
log
@Rewritten on 8-28-00 by michael salmon.
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@d37 2
a38 1
# eyebrowse script
d40 1
a40 2
# Perl script to wrap eyebrowse commands so that the user doesn't have 
# to type in the annoying fully qualified class path names
@


1.4
log
@temporarily broken, now fixed

PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@a2 2
# rewritten on 8.23 my michael salmon
#
@


1.3
log
@Added link to design.txt on project_docs.html and replaced src/scripts/eyebrowse.old with a new rewrite.
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@a0 1
<<<<<<< eyebrowse
d2 1
a2 1
#
@


1.2
log
@Update license information; add more comments and JavaDoc
@
text
@d1 4
a4 2
#!/usr/bin/perl

d46 1
d49 16
a64 2
$java     = "java";
$progPath = "com.quiotix.eyebrowse.programs";
d66 1
a66 32
$command = shift(@@ARGV);
if ($command eq "addlist") {
    system "$java $progPath.AddList @@ARGV";
}
elsif ($command eq "addlistfile") {
    system "$java $progPath.AddListFile @@ARGV";
}
elsif ($command eq "addindex") {
    system "$java $progPath.AddIndex @@ARGV";
}
elsif ($command eq "deletelist") {
    system "$java $progPath.DeleteList @@ARGV";
}
elsif ($command eq "deleteindex") {
    system "$java $progPath.DeleteIndex @@ARGV";
}
elsif ($command eq "updatelist") {
    system "$java $progPath.UpdateList @@ARGV";
}
elsif ($command eq "updateindex") {
    system "$java $progPath.UpdateIndex @@ARGV";
}
elsif ($command eq "update") {
    system "$java $progPath.Update @@ARGV";
}
elsif ($command eq "getlists") {
    system "$java $progPath.GetLists @@ARGV";
}
elsif ($command eq "getlistfile") {
    system "$java $progPath.GetListFile @@ARGV";
}
elsif ($command eq "safeupdate") {
d69 3
a71 1
    $listName = $ARGV[0];
d73 1
a73 2

    $mailFile = `$java $progPath.GetListFile $listName`;
d75 1
a75 2

    open(MBOX, $mailFile);
d77 1
a77 1
    system("$java $progPath.UpdateList $listName");
d80 15
a94 1
else {
d97 1
@


1.1
log
@Move user-mode programs to com.quiotix.eyebrowse.programs package, add
a script to front-end these; rename interface Index to IIndex; minor doc tweaks
Submitted by:	Brian Goetz
@
text
@d4 34
@

