);
use bsta_lib (
'STATE', 'INTF_STATE', 'CHAT_STATE',
- 'write_index'
+ 'write_index',
+ 'merge_settings'
);
binmode STDIN, ':encoding(UTF-8)';
###PERL_PATH_SEPARATOR: PATH_SEPARATOR = /
+###PERL_DATA_PATH: DATA_PATH = /botm/data/bsta/
+###PERL_DATA_ATTACH_PATH: DATA_ATTACH_PATH = /botm/data/bsta/a
###PERL_DATA_CHAT_PATH: DATA_CHAT_PATH = /botm/data/bsta/chat
+###PERL_DATA_DEFAULT_PATH: DATA_DEFAULT_PATH = /botm/data/bsta/default
###PERL_DATA_LIST_PATH: DATA_LIST_PATH = /botm/data/bsta/list
###PERL_DATA_SETTINGS_PATH: DATA_SETTINGS_PATH = /botm/data/bsta/state
###PERL_DATA_STATE_PATH: DATA_STATE_PATH = /botm/data/bsta/state
###PERL_DATA_STORY_PATH: DATA_STORY_PATH = /botm/data/bsta/story
###PERL_DATA_WORDS_PATH: DATA_WORDS_PATH = /botm/data/bsta/words/
+###PERL_WWW_PATH: WWW_PATH = /botm/www/
+
###PERL_RESET_PASSWORD: RESET_PASSWORD = ''
my %story;
my %chat;
my %settings;
my %goto_list;
+my %default;
+my $last_frame;
+my @remove_list;
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
###PERL_SET_PATH: $ENV{'PATH'} = /usr/local/bin:/usr/bin:/bin;
exit 1;
}
+$last_frame = int($settings{'last'});
+%default = read_data_file(DATA_DEFAULT_PATH());
+
+for (my $frame=0; $frame<=$last_frame; $frame+=1) {
+ my %frame_data =read_data_file(
+ join_path(PATH_SEPARATOR(), DATA_PATH(), $frame)
+ );
+ %frame_data = merge_settings(\%default, \%frame_data);
+ unless ($frame == 0) {
+ push @remove_list, (
+ ($frame_data{'page'} ne '') ?
+ $frame_data{'page'} :
+ sprintf(
+ $settings{'frame'},
+ $frame, 'htm'
+ )
+ );
+ }
+ push @remove_list, (
+ ($frame_data{'frame'} ne '') ?
+ $frame_data{'frame'} :
+ sprintf(
+ $settings{'frame'},
+ $frame, $frame_data{'ext'}
+ )
+ );
+}
+push @remove_list, 'goto.htm';
+for (my $i=0; ;$i+=1) {
+ my %file_data;
+
+ %file_data = read_data_file(DATA_ATTACH_PATH().$i);
+ if ($file_data{'frame'} eq '') {
+ last;
+ }
+ if ($file_data{'content'} ne '') {
+ next;
+ }
+ push @remove_list, $file_data{'filename'};
+}
+
%state = (
'state' => STATE->{'inactive'},
'last' => 0,
next;
}
my $full_path = join_path(PATH_SEPARATOR(), DATA_WORDS_PATH(), $file_name);
+ # print "RM $full_path\n";
unlink_encoded ($full_path);
}
}
+foreach my $file_name (@remove_list) {
+ my $full_path = join_path(PATH_SEPARATOR(), WWW_PATH(), $file_name);
+ # print "RM $full_path\n";
+ unlink_encoded ($full_path);
+}
use Encode::Locale ('decode_argv');
use Encode ('encode', 'decode');
-use lib '/botm/lib/test-bsta';
+###PERL_LIB: use lib /botm/lib/bsta
use botm_common (
'read_data_file',
'join_path'
}
}
+# duplicated - before AND after normal pages!
+if ($update_goto) {
+ print 'static GOTO';
+ my $r = write_static_goto(
+ \%state,
+ \%settings,
+ '' # \%goto_list
+ );
+ if ($r) {
+ print " OK\n";
+ }
+ else {
+ print " FAIL\n";
+ $fail += 1;
+ }
+}
+
foreach my $id (@list) {
print "ONG $id\n";
my $r = ong(
}
make_static_pages($id);
}
+
+# duplicated - before AND after normal pages!
if ($update_goto) {
print 'static GOTO';
my $r = write_static_goto(