[interchange-cvs] interchange - racke modified dist/lib/UI/usertag/regenerate
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Sun Oct 28 10:47:00 2001
User: racke
Date: 2001-10-28 15:46:46 GMT
Modified: dist/lib/UI/usertag Tag: LINUXIA regenerate
Log:
up-to-date again
Revision Changes Path
No revision
No revision
1.3.4.2 +26 -3 interchange/dist/lib/UI/usertag/Attic/regenerate
rev 1.3.4.2, prev_rev 1.3.4.1
Index: regenerate
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/usertag/Attic/regenerate,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -u -r1.3.4.1 -r1.3.4.2
--- regenerate 2001/10/10 22:40:50 1.3.4.1
+++ regenerate 2001/10/28 15:46:46 1.3.4.2
@@ -9,6 +9,19 @@
my $regen_out;
my $regen_arg;
my $initial;
+
+sub regen_track {
+ return unless $Vend::Cfg->{StaticTrack};
+ my(@parm) = @_;
+
+ Vend::Util::logData(
+ $Vend::Cfg->{StaticTrack},
+ POSIX::strftime('%Y%m%d %H%M%S', localtime()),
+ join('&', @parm),
+ );
+ return;
+}
+
sub regen_build {
my $ref = shift;
my $page;
@@ -81,6 +94,9 @@
mv_no_count => 1,
};
+ # bindings for Safe are no longer valid
+ $Vend::Calc_initialized = 0;
+
eval {
($pageref) = ::cache_html($page, 1);
};
@@ -98,6 +114,7 @@
#EOF
if($@) {
push @regen_messages, "$ref->[0]: $@";
+ regen_track("Problem with $ref->[0]: $@");
undef $Vend::CachePage;
undef $Vend::ForceBuild;
}
@@ -107,7 +124,7 @@
sub {
$initial = shift || $CGI::values{ui_initial_page} || $Vend::Cfg->{SpecialPage}{catalog};
my $verbose = $CGI::values{ui_build_verbose} || '';
- my $max_links = $CGI::values{ui_build_max} || '500';
+ my $max_links = $CGI::values{ui_max_build} || '500';
my $links_done = 0;
if($CGI::values{ui_force_build}) {
my @tmp = split /\0/, $CGI::values{ui_force_build};
@@ -148,7 +165,7 @@
::response(::interpolate_html ($output));
::response(" " x 1024);
::response("<PRE> Checking for links.....\n");
-
+ regen_track("Starting static page build");
my $suffix = $Vend::Cfg->{StaticSuffix} || '.html';
$output = '';
$Vend::Cookie = 'REGENERA';
@@ -167,6 +184,7 @@
while(@links) {
if($links_done++ > $max_links) {
::response("Reached maximum link count of $max_links, stopping.\n");
+ regen_track("Reached maximum link count of $max_links");
last;
}
$output .= '.';
@@ -179,8 +197,9 @@
undef $Vend::CachePage;
undef $Vend::ForceBuild;
$verbose and ::response(qq{ Checking page $ref->[0]....});
+ regen_track("Checking $ref->[0]");
regen_build($ref);
-
+ regen_track("Finished with $ref->[0]");
if($Vend::CachePage || $Vend::ForceBuild) {
$verbose and ::response(qq{will build.\n});
push (@links, @Vend::Links);
@@ -244,7 +263,9 @@
}
open(REGENFILE, ">$file")
or die "create $file: $!\n";
+ regen_track("Building $ref->[0]");
my $pageref = regen_build($ref);
+ regen_track("Finished with $ref->[0]");
if(! $pageref) {
push (@regen_messages, "problem building $_.");
push @bad, $_;
@@ -299,10 +320,12 @@
my $out = "Messages during regen:<blockquote>";
$out .= join "<br>", @regen_messages;
$out .= "</blockquote>";
+ regen_track(join("\n", @regen_messages));
::response($out);
}
my $end = (times)[0] - $start;
$end = int($end);
+ regen_track("Finished static page building in $end seconds.");
::response(::interpolate_html(<<EOF, 1));
<table cellpadding=2 cellspacing=0 width=__UI_OVERALL_WIDTH__ bgcolor=__UI_C_TITLEBARBG__ border=0>
<tr>