Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Vend 0.3.8
  • Loading branch information
Andrew M. Wilcox authored and jonjensen committed Jan 2, 2009
1 parent e8858ba commit a38e8ec
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 87 deletions.
17 changes: 17 additions & 0 deletions ChangeLog
@@ -1,3 +1,20 @@
Thu Mar 14 22:35:57 1996 Andrew Wilcox <awilcox@world.std.com>

* Vend/Startup.pm, setup: Version 0.3.8.

* Vend/Cgi.pm (setup):
New 'Use_setuid_wrapper' option keeps the "cgi" program from
being installed setuid.

Thu Mar 14 20:49:32 1996 Andrew Wilcox <awilcox@world.std.com>

* Vend/Table/GDBM.pm: (record_exists):
Guess what? The GDBM "exists" function got renamed to "EXISTS"
in 5.002.

* Vend/Swish_search.pm: Use Html_extension as the name of the Html option.
Strip the html extension off of the search result file name.

Tue Mar 12 16:46:13 1996 Andrew Wilcox <awilcox@world.std.com>

* Vend/Startup.pm, setup: Version 0.3.7.
Expand Down
12 changes: 10 additions & 2 deletions Vend/Cgi.pm
@@ -1,6 +1,6 @@
# Cgi: creates the "cgi" program that runs Vend as a cgi-bin program
#
# $Id: Cgi.pm,v 1.1 1996/02/26 21:19:57 amw Exp $
# $Id: Cgi.pm,v 1.3 1996/03/14 22:35:57 amw Exp $
#
package Vend::Cgi;

Expand All @@ -23,6 +23,13 @@ package Vend::Cgi;
use strict;
use Vend::Application;

my $Use_setuid_wrapper;

sub configure {
my ($class, $config) = @_;
$Use_setuid_wrapper = $config->{'Use_setuid_wrapper'};
}

sub setup {
my $C = app_config();

Expand Down Expand Up @@ -59,7 +66,8 @@ Vend::Dispatch::dispatch(\$http);
END

close(OUT);
chmod 04755, $fn or die "Can't chmod '$fn': $!\n";
chmod ($Use_setuid_wrapper ? 0755 : 04755), $fn
or die "Can't chmod '$fn': $!\n";
}

1;
73 changes: 0 additions & 73 deletions Vend/Full_search.pm

This file was deleted.

4 changes: 2 additions & 2 deletions Vend/Startup.pm
@@ -1,6 +1,6 @@
# Startup.pm: startup Vend program and process command line arguments
#
# $Id: Startup.pm,v 1.28 1996/03/12 16:46:13 amw Exp $
# $Id: Startup.pm,v 1.29 1996/03/14 20:49:32 amw Exp $
#
package Vend::Startup;

Expand Down Expand Up @@ -40,7 +40,7 @@ use Vend::Server;
use Vend::Session;
use Vend::Uneval;

my $Vend_version = "0.3.7";
my $Vend_version = "0.3.8";

my $Running_as_cgi_bin;
my $Mode;
Expand Down
17 changes: 11 additions & 6 deletions Vend/Swish_search.pm
@@ -1,6 +1,6 @@
# Swish_search: search catalog pages using Swish program
#
# $Id: Swish_search.pm,v 1.1 1996/03/12 16:43:25 amw Exp $
# $Id: Swish_search.pm,v 1.2 1996/03/14 20:40:13 amw Exp $
#
package Vend::Swish_search;

Expand All @@ -20,6 +20,10 @@ package Vend::Swish_search;
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(swish_search);

use strict;
use Vend::Option_1 qw(combine defaults);
use Vend::Strip;
Expand All @@ -30,7 +34,7 @@ sub configure {
my ($class, $config) = @_;

$Options = combine($config,
qw(Data_directory Html Stripped_directory Swish_index_file
qw(Data_directory Html_extension Stripped_directory Swish_index_file
Swish_conf_file Swish_program
Bin_directory Perl_program Vend_lib App_directory
Config_file));
Expand All @@ -39,7 +43,7 @@ sub configure {
my $data = $Options->{Data_directory} || '';

defaults($Options,
Html => '.html',
Html_extension => '.html',
Stripped_directory => "$data/stripped",
Swish_index_file => "$data/index.swish",
Swish_conf_file => "$app/swish.conf",
Expand Down Expand Up @@ -81,7 +85,7 @@ END

sub create_swish_index {
write_stripped_pages($Options->{'Stripped_directory'},
$Options->{'Html'});
$Options->{'Html_extension'});

my $cmd = $Options->{'Swish_program'};
$cmd .= " -c $Options->{'Swish_conf_file'}";
Expand All @@ -97,14 +101,14 @@ sub xsystem {
my $r = system($cmd);
}

sub search {
sub swish_search {
my ($words, $options, $callback) = @_;

$options =
combine($options,
$Options,
qw(Swish_tags Swish_index_file Swish_max_hits Swish_program
Stripped_directory));
Stripped_directory Html_extension));

my $args = "-w";
while ($words =~ m/(\w+)/g) {
Expand All @@ -129,6 +133,7 @@ sub search {
}
if (($rank, $fn, $title, $size) = m/^(\d+) (\S+) \"([^\"]+)\" (\d+)/) {
$fn =~ s,^$options->{'Stripped_directory'}/,,;
$fn =~ s,\Q$options->{'Html_extension'}\E$,,;
&$callback($rank, $fn, $title, $size);
}
}
Expand Down
10 changes: 8 additions & 2 deletions Vend/Table/GDBM.pm
@@ -1,6 +1,6 @@
# Table/GDBM.pm: access a table stored in a GDBM file
#
# $Id: GDBM.pm,v 1.7 1996/03/12 16:16:49 amw Exp $
# $Id: GDBM.pm,v 1.8 1996/03/14 20:41:00 amw Exp $
#
package Vend::Table::GDBM;

Expand Down Expand Up @@ -211,7 +211,13 @@ sub each_record {

sub record_exists {
my ($s, $key) = @_;
$s->[$DBM]->exists("k$key");
# guess what? The GDBM "exists" function got renamed to "EXISTS"
# in 5.002.
my $r = eval { $s->[$DBM]->EXISTS("k$key") };
if ($@) {
$r = $s->[$DBM]->exists("k$key");
}
return $r;
}

sub delete_record {
Expand Down
4 changes: 2 additions & 2 deletions setup
@@ -1,6 +1,6 @@
# setup: sets up a Vend storefront.
#
# $Id: setup,v 1.27 1996/03/12 16:46:08 amw Exp $
# $Id: setup,v 1.28 1996/03/14 20:49:28 amw Exp $
#
# Copyright 1996 by Andrew M. Wilcox <awilcox@world.std.com>
#
Expand All @@ -18,7 +18,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

my $Version = "0.3.7";
my $Version = "0.3.8";

use Getopt::Long;
use strict;
Expand Down

0 comments on commit a38e8ec

Please sign in to comment.