1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-30 21:49:25 +00:00
freebsd-ports/www/webglimpse/files/patch-al
Andrey A. Chernov 0a1257cfcd autosense localization from env vars
always put site cache locally
1998-11-04 04:17:03 +00:00

93 lines
3.0 KiB
Plaintext

--- confarc.orig Mon Jul 27 21:30:54 1998
+++ confarc Wed Nov 4 06:03:42 1998
@@ -75,6 +75,8 @@
elsif (/^-l/) { $nu_list = &get_option("-list"); }
elsif (/^-T/) { $nu_title = &get_option("-Title"); }
elsif (/^-b/) { $nu_addboxes = 1; }
+ elsif (/^-L/) { $nu_locale = &get_option("-Locale"); }
+ elsif (/^-C/) { $nu_charset = &get_option("-Charset"); }
elsif (/^-[\?hH]/) { &usage; }
else { &usage("unknown argument: $_"); }
}
@@ -142,6 +144,8 @@
$addboxes = 0;
$usemaxmem = 0;
$vhost = "";
+$locale = '';
+$charset = '';
@urllist = ();
# pre-set localscope
@@ -219,7 +223,7 @@
print "\nFound archive. Reading in previous settings for update.\n";
($title, $urlpath, $traverse_type, $explicit_only, $numhops,
- $nhhops, $local_limit, $remote_limit, $addboxes, $vhost, $usemaxmem, @urllist) = ReadConfig($indexdir);
+ $nhhops, $local_limit, $remote_limit, $addboxes, $vhost, $usemaxmem, $locale, $charset, @urllist) = ReadConfig($indexdir);
}
# If we had a virtual host on the command line, revert to that.
@@ -423,6 +427,35 @@
}
}
+if ($nu_locale) {
+ $locale = $nu_locale;
+} else {
+ if ($locale eq '') {
+ $locale = $ENV{LANG} if defined($ENV{LANG});
+ $locale = $ENV{LC_ALL} if defined($ENV{LC_ALL});
+ $locale = $ENV{LC_CTYPE} if defined($ENV{LC_CTYPE});
+ }
+ if (! $nu_quiet) {
+ $oldlocale=$locale;
+
+ $locale = &prompt("System locale (press return to leave it as is or * to cancel old one)\n",$oldlocale);
+ $locale = '' if ($locale eq "*");
+ }
+}
+
+if ($nu_charset) {
+ $charset = $nu_charset;
+} else {
+ if ($charset eq '') {
+ $charset = $ENV{MM_CHARSET} if defined($ENV{MM_CHARSET});
+ }
+ if (! $nu_quiet) {
+ $oldcharset=$charset;
+
+ $charset = &prompt("Charset for CGI (press return to leave it as is or * to cancel old one)\n",$oldcharset);
+ $charset = '' if ($charset eq "*");
+ }
+}
# generate the comment
if ($found_archive) {
@@ -452,6 +485,8 @@
# vhost Hostname = name of virtual host to use for this index
# usemaxmem 0 = 0 to NOT use maximum available memory
# = 1 to use maximum memory to speed up indexing
+# locale LOCALE = system locale or empty
+# charset CHARSET = character set for CGI output or empty
# urllist Url1,Url2,.. = List of starting URL's or Directories to index
# ";
}
@@ -473,7 +508,7 @@
# save the configuration
if(&SaveConfig($indexdir, $topcomment,
$title,$url,$traverse_type,$explicit_only,$numhops,$nhhops,
- $local_limit, $remote_limit, $addboxes, $vhost, $usemaxmem, @urllist) == 0){
+ $local_limit, $remote_limit, $addboxes, $vhost, $usemaxmem, $locale, $charset, @urllist) == 0){
print "Error saving configuration to file!\n";
exit 3;
}
@@ -483,7 +518,7 @@
&copy_files($indexdir);
# construct the cron file
-if (system("$MAKECRON $indexdir $usemaxmem") < 0) {
+if (system("$MAKECRON $indexdir $usemaxmem $locale") < 0) {
print "ERROR: Unable to create cronfile $mycronfile\n";
exit 6;
}