|
From: <ix...@us...> - 2002-01-04 00:29:58
|
ixjonez 02/01/03 16:29:57
Modified: . Tag: Ü `¶@h¶@h¶@@Q 8² PÏ PÏ ØÑ `
¶@¶@¶@¶@¶@¶@ ¶@ ¶@¨¶@¨¶@ðË ðË
¸¶@¸¶@À¶@À¶@ȶ@ȶ@ж@ж@ض@ض@à¶@à¶@è¶@è¶@ð¶@ð¶@ø¶@ø¶@
/tmp/cvs-serv12409/Makefile.PL No tag Makefile.PL
Added: bin .cvsignore lab.PL
Log:
add bin directory with lab command line script
Revision Changes Path
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
1.2 +3 -3 lab/Makefile.PL
Index: /tmp/cvs-serv12409/Makefile.PL
===================================================================
RCS file: /cvsroot/liveframe/lab/Makefile.PL,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /tmp/cvs-serv12409/Makefile.PL 2001/11/30 01:03:03 1.1
+++ /tmp/cvs-serv12409/Makefile.PL 2002/01/04 00:29:56 1.2
@@ -10,9 +10,9 @@
HTML::Entities => 0,
Template => 2.0.6,
URI => 0},
- PL_FILES => {'cgi-bin/lab.cgi.PL' =>
- 'cgi-bin/lab.cgi'},
- clean => {FILES => 'cgi-bin/lab.cgi'},
+ PL_FILES => {'cgi-bin/lab.cgi.PL' => 'cgi-bin/lab.cgi',
+ 'bin/lab.PL' => 'bin/lab'},
+ clean => {FILES => 'cgi-bin/lab.cgi bin/lab'},
($] >= 5.005 ?
(ABSTRACT_FROM => 'lib/LiveFrame/Lab.pm',
AUTHOR => 'Brian Moseley <bc...@ma...>') : ()),
No revision
No revision
1.2 +3 -3 lab/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /cvsroot/liveframe/lab/Makefile.PL,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile.PL 2001/11/30 01:03:03 1.1
+++ Makefile.PL 2002/01/04 00:29:56 1.2
@@ -10,9 +10,9 @@
HTML::Entities => 0,
Template => 2.0.6,
URI => 0},
- PL_FILES => {'cgi-bin/lab.cgi.PL' =>
- 'cgi-bin/lab.cgi'},
- clean => {FILES => 'cgi-bin/lab.cgi'},
+ PL_FILES => {'cgi-bin/lab.cgi.PL' => 'cgi-bin/lab.cgi',
+ 'bin/lab.PL' => 'bin/lab'},
+ clean => {FILES => 'cgi-bin/lab.cgi bin/lab'},
($] >= 5.005 ?
(ABSTRACT_FROM => 'lib/LiveFrame/Lab.pm',
AUTHOR => 'Brian Moseley <bc...@ma...>') : ()),
1.1 lab/bin/.cvsignore
Index: .cvsignore
===================================================================
lab
1.1 lab/bin/lab.PL
Index: lab.PL
===================================================================
# -*- Mode: Perl; indent-tabs-mode: nil; -*-
# ripped off from LWP. Thanks!
use strict;
use Config;
use File::Basename qw(basename dirname);
use File::Spec::Functions qw(catfile);
chdir dirname $0;
(my $file = basename $0) =~ s/\.PL$//;
$file =~ s/\.pl$// if ($Config{'osname'} eq 'VMS' or
$Config{'osname'} eq 'OS2'); # "case-forgiving"
open OUT,">$file" or die "Can't create $file: $!";
chmod 0755, $file;
print "Extracting $file (with variable substitutions)\n";
my $default_config_file = catfile($Config{prefix}, 'etc', 'lab.conf');
print OUT <<"!GROK!THIS!";
$Config{startperl} -wT
!GROK!THIS!
print OUT <<'!NO!SUBS!';
use lib "./lib";
use lib "../commons/lib";
use strict;
use File::Basename ();
use Getopt::Long ();
use LiveFrame::Lab ();
BEGIN { $0 = File::Basename::basename($0) }
use constant VERSION => '0.01';
use constant PROGRAM => 'LiveFrame Lab';
use constant USAGE => <<EOT;
Usage: $0 [OPTIONS...] action
Actions:
$0 -s <site> -g <gallery> [-p <position>] gallery
create gallery directory <gallery> within site directory <site> and
add the gallery at position <order> in the site's order file (or last,
if no position is specified)
Options:
-f specify the location of the configuration file (defaults to
!NO!SUBS!
print OUT <<"!GROK!THIS!";
${default_config_file})
!GROK!THIS!
print OUT <<'!NO!SUBS!';
-s specify the location of the site directory
-g specify the basename of the gallery directory within the
site directory
-p specify the position (as an integer from 0..n) of the gallery
within the site's order file
-d print debugging information to STDOUT
-h list available command line options (this page)
-v print version information and exit
EOT
use constant FORMS =>
{
gallery => 'spec',
};
# variable declarations (configurable)
my ($opt_config_file);
my ($opt_debug, $opt_help, $opt_version);
# make visible for use in symbolic refs later
use vars qw($opt_site_dir $opt_gallery_dir $opt_gallery_position);
# process command line options
Getopt::Long::GetOptions(
"f=s" => \$opt_config_file,
"s=s" => \$opt_site_dir,
"g=s" => \$opt_gallery_dir,
"p=i" => \$opt_gallery_position,
"d" => \$opt_debug,
"h" => \$opt_help,
"v" => \$opt_version,
);
(print USAGE and exit) if $opt_help;
(print sprintf("%s/%s\n", PROGRAM, VERSION) and exit) if $opt_version;
#
# MAIN PROGRAM
#
my $action_name = shift @ARGV or
die USAGE;
my $config_file = $opt_config_file ||
!NO!SUBS!
print OUT <<"!GROK!THIS!";
'${default_config_file}';
!GROK!THIS!
print OUT <<'!NO!SUBS!';
my $lab = LiveFrame::Lab->new();
eval { $lab->start({config_file => $config_file}) };
if ($@) {
die "$0: application could not be started: $@\n";
}
# force the config file to be read.
eval { $lab->process_config() };
if ($@) {
die "$0: config file error: $@\n";
}
$lab->current_action_name($action_name);
my $action = eval { $lab->current_action() };
if ($@) {
die "$0: error finding action `$action_name': $@\n";
}
unless ($action) {
die "$0: no action `", $lab->current_action_name(), "' defined\n";
}
$lab->current_form_name(FORMS->{$action_name});
my $form = eval { $lab->current_form() };
if ($@) {
die "$0: can't get current form: $@\n";
}
unless ($form) {
die "$0: no form `", $lab->current_form_name(), "' defined\n";
}
# load up the form with command line options
for (qw(site_dir gallery_dir gallery_position)) {
no strict 'refs';
my $opt = join '_', 'opt', $_;
$form->$_($$opt) if defined $$opt;
}
# validate the form
eval { $form->validate($lab) };
if ($@) {
die "$0: invalid input:\n - ", join("\n - ", $@->errors()), "\n";
}
# perform the action
eval { $action->perform($lab, $form) };
if ($@) {
die "$0: error performing action: $@\n";
}
exit;
!NO!SUBS!
|