[w3m-dev 02690] RC_DIR in scripts
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
@@ -4,6 +4,7 @@ DESTDIR =
|
||||
BIN_DIR = $(prefix)/bin
|
||||
LIB_DIR = $(prefix)/lib/w3m
|
||||
HELP_DIR = $(prefix)/lib/w3m
|
||||
RC_DIR = ~/.w3m
|
||||
|
||||
LIB_TARGETS = dirlist.cgi w3mhelp.cgi
|
||||
HELP_LIBS = w3mhelp-funcname.pl w3mhelp-funcdesc.pl
|
||||
@@ -24,7 +25,8 @@ all: $(LIB_TARGETS) $(HELP_LIBS)
|
||||
.in:
|
||||
@echo "generating $@..."
|
||||
@sed -e 's%@PERL@%$(PERL)%' -e 's%@HELP_DIR@%$(HELP_DIR)%' \
|
||||
-e 's%@DOCDIRS@%$(DOCDIRS)%' $< > $@
|
||||
-e 's%@DOCDIRS@%$(DOCDIRS)%' \
|
||||
-e 's%@RC_DIR@%$(RC_DIR)%' $< > $@
|
||||
@chmod +x $@
|
||||
@echo done
|
||||
|
||||
|
@@ -15,8 +15,7 @@ else {
|
||||
$WIN32 = 0;
|
||||
$CYGPATH = 0;
|
||||
}
|
||||
$RC_DIR = '~/.w3m/';
|
||||
|
||||
$RC_DIR = '@RC_DIR@';
|
||||
$RC_DIR =~ s@^~/@$ENV{'HOME'}/@;
|
||||
if ($CYGPATH) {
|
||||
$RC_DIR = &cygwin_pathconv("$RC_DIR");
|
||||
|
@@ -1,5 +1,9 @@
|
||||
#!@PERL@
|
||||
# $Id: w3mhelp.cgi.in,v 1.6 2001/12/21 19:25:01 ukai Exp $
|
||||
# $Id: w3mhelp.cgi.in,v 1.7 2001/12/21 20:30:54 ukai Exp $
|
||||
|
||||
if ( $^O =~ /^(ms)?(dos|win(32|nt)?)/i ) {
|
||||
$CYGPATH = 1;
|
||||
}
|
||||
|
||||
$helpdir = "@HELP_DIR@";
|
||||
unshift(@INC, $helpdir);
|
||||
@@ -15,7 +19,12 @@ $lang = 'en';
|
||||
'&', '&'
|
||||
);
|
||||
|
||||
$keymap = "$ENV{'HOME'}/.w3m/keymap";
|
||||
$RC_DIR = '@RC_DIR@';
|
||||
$RC_DIR =~ s/^~/$ENV{'HOME'}/;
|
||||
if ($CYGPATH) {
|
||||
$RC_DIR = &cygwin_pathconv("$RC_DIR");
|
||||
}
|
||||
$keymap = "$RC_DIR/keymap";
|
||||
$version = '*unknown*';
|
||||
if (defined($ENV{'QUERY_STRING'})) {
|
||||
print "QUERY_STRING=$ENV{'QUERY_STRING'}\n";
|
||||
@@ -191,3 +200,17 @@ PAGE
|
||||
}
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
|
||||
sub cygwin_pathconv {
|
||||
local($_) = @_;
|
||||
local(*CYGPATH);
|
||||
|
||||
open(CYGPATH, '-|') || exec('cygpath', '-w', $_);
|
||||
$_ = <CYGPATH>;
|
||||
close(CYGPATH);
|
||||
s/\r?\n$//;
|
||||
s!\\!/!g;
|
||||
s!/$!!;
|
||||
return $_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user