summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-12-31 03:52:42 +0000
committerfukachan <fukachan>2003-12-31 03:52:42 +0000
commit048d27cfb7f24375bb3f7a4f95aea9489c890dcb (patch)
tree2aebdb7b8acb169116f168fde9eed370f3c6d3ca /fml
parent156bdd6446feb635800c0a0b0c353d8805a183a1 (diff)
downloadfml8-048d27cfb7f24375bb3f7a4f95aea9489c890dcb.tar.gz
fml8-048d27cfb7f24375bb3f7a4f95aea9489c890dcb.tar.bz2
fml8-048d27cfb7f24375bb3f7a4f95aea9489c890dcb.zip
update comments.
use $curproc->ml_*() methods if could. reset $ENV{'PATH'} while running editor.
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/FML/Command/Admin/edit.pm25
1 files changed, 13 insertions, 12 deletions
diff --git a/fml/lib/FML/Command/Admin/edit.pm b/fml/lib/FML/Command/Admin/edit.pm
index 889be5aa..d8f630ff 100644
--- a/fml/lib/FML/Command/Admin/edit.pm
+++ b/fml/lib/FML/Command/Admin/edit.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: edit.pm,v 1.16 2003/08/23 04:35:30 fukachan Exp $
+# $FML: edit.pm,v 1.17 2003/09/13 09:16:59 fukachan Exp $
#
package FML::Command::Admin::edit;
@@ -25,14 +25,14 @@ See C<FML::Command> for more details.
Tool to edit config.cf.
- not implemented
+ NOT IMPLEMENTED.
=head1 METHODS
=head2 process($curproc, $command_args)
C<TODO>:
-now we can read and write config.cf, not change it.
+now we can read and write config.cf, but can not change it.
=cut
@@ -58,25 +58,26 @@ sub need_lock { 0;}
# Descriptions: run "vi" or the specified editor to edit config.cf.
+# If environmental variable EDITOR is specified,
+# try to run "$EDITOR config.cf".
# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
# Side Effects: update config.cf
+# change $ENV{ PATH } withiin running editor.
# Return Value: none
sub process
{
my ($self, $curproc, $command_args) = @_;
- my $config = $curproc->config();
- my $ml_name = $curproc->ml_name();
- my $ml_home_dir = $curproc->ml_home_dir( $ml_name );
-
- use File::Spec;
- my $config_cf = File::Spec->catfile($ml_home_dir, "config.cf");
-
- # editor
- my $editor = $ENV{ 'EDITOR' } || 'vi';
+ my $ml_name = $curproc->ml_name();
+ my $ml_domain = $curproc->ml_domain();
+ my $config_cf = $curproc->config_cf_filepath($ml_name, $ml_domain);
+ my $editor = $ENV{ 'EDITOR' } || 'vi';
+ my $orig_path = $ENV{ 'PATH' };
if (-f $config_cf) {
+ $ENV{'PATH'} = '/bin/:/usr/bin:/usr/pkg/bin:/usr/local/bin';
$curproc->ui_message("$editor $config_cf");
system $editor, $config_cf;
+ $ENV{'PATH'} = $orig_path;
}
else {
warn("$config_cf not found\n");