Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gcc-cobol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COBOLworx
gcc-cobol
Commits
e835fd1a
Commit
e835fd1a
authored
16 years ago
by
Geoffrey Keating
Committed by
Geoffrey Keating
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
* mkindex.pl: New.
From-SVN: r142251
parent
2ddc34ba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/regression/ChangeLog
+4
-0
4 additions, 0 deletions
contrib/regression/ChangeLog
contrib/regression/mkindex.pl
+107
-0
107 additions, 0 deletions
contrib/regression/mkindex.pl
with
111 additions
and
0 deletions
contrib/regression/ChangeLog
+
4
−
0
View file @
e835fd1a
2008-11-27 Geoff Keating <geoffk@geoffk.org>
* mkindex.pl: New.
2007-12-24 Geoff Keating <geoffk@geoffk.org>
* objs-gcc.sh: Revert previous change.
...
...
This diff is collapsed.
Click to expand it.
contrib/regression/mkindex.pl
0 → 100755
+
107
−
0
View file @
e835fd1a
#!/usr/bin/perl
# Copy log files from a GCC build for HTTP access.
# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# INPUT:
# mkindex.pl <srcdir> <destdir> <branchname>
# This script copies log files from a GCC build directory, compresses
# and indexes them for web browser access. It's aimed at having an
# easy-to-access collection of files for analyzing regressions without
# needing to run the build yourself. Binary files (.o, executables)
# are intentionally not included since usually if they are needed it's
# better to just run a build, and because they take up a lot of space.
# 'srcdir' is the root directory of a GCC build (was $objdir in the build).
# 'destdir' will be erased and replaced with the log files, and should be an
# absolute path.
# 'branchname' is used only to produce the title of the index page,
# which will be named 'index.html'.
use
warnings
;
use
strict
;
use
File::
Path
qw(mkpath rmtree)
;
use
File::
Find
qw(find)
;
if
(
$#ARGV
!=
2
)
{
print
"
usage: $0 <srcdir> <destdir> <branchname>
\n
";
exit
1
;
}
my
(
$srcdir
,
$destdir
,
$branchname
)
=
@ARGV
;
die
"
destdir is not absolute
"
unless
(
$destdir
=~
m,^/,
);
# Erase the destination.
rmtree
$destdir
;
mkdir
$destdir
or
die
"
${destdir}
: $!
";
# Copy and compress the files into the destination, and keep a list in @files.
my
@files
=
();
sub
my_wanted
{
# Copy all files ending with .log or .sum.
if
(
/\.(log|sum)$/
&&
-
f
)
{
die
unless
(
substr
(
$
File::Find::
dir
,
0
,(
length
$srcdir
))
eq
$srcdir
);
my
$dir
=
substr
$
File::Find::
dir
,(
length
$srcdir
);
$dir
=
substr
$dir
,
1
unless
(
$dir
eq
'');
my
$name
=
$_
;
$name
=
$dir
.
'
/
'
.
$_
if
(
$dir
ne
'');
mkpath
$destdir
.
'
/
'
.
$dir
;
# Compress the files. Use .gzip instead of .gz for the
# extension to avoid (broken) browser workarounds for broken
# web servers.
system
("
gzip -c -q -9
$_
>
$destdir
/
${name}
.gzip
")
==
0
or
exit
2
;
# Write the (compressed) size consistently in Kbytes.
my
$size
=
-
s $destdir .'/' . $name . '.gzip';
my $prin
table_size
=
(
sprintf
"
%.0fK
",
$size
/
1024
);
push
@files
,[
$name
.
'
.gzip
',
$name
,
$printable_size
];
}
}
find
({
wanted
=>
\
&my_wanted
},
$srcdir
);
# Sort the list of files for the index.
@files
=
sort
{
$a
->
[
1
]
cmp
$b
->
[
1
]}
@files
;
# Create the index.
open
INDEX
,'
>
',
$destdir
.
'
/index.html
'
or
die
"
${destdir}
/index.html: $!
";
# Use strict XHTML 1.0, and set charset to UTF-8.
print
INDEX
<<
EOF
or
die
"
writing index: $!
";
<!
DOCTYPE
html
PUBLIC
"
-//W3C//DTD XHTML 1.0 Strict//EN
"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
"
>
<
html
xmlns
=
"
http://www.w3.org/1999/xhtml
"
xml:lang
=
"
en
"
lang
=
"
en
"
>
<
head
>
<
title
>
Log
files
for
$branchname
</
title
>
<
meta
http
-
equiv
=
"
Content-Type
"
content
=
"
text/html;charset=utf-8
"
/>
</
head
>
<
body
>
<
h1
>
Log
files
for
$branchname
</
h1
>
<
table
><
tr><th>Name</th>
<
th
align
=
'
right
'
>
Size
<
/th></tr>
EOF
# The index will have two columns, filename (without .gzip) and
# compressed size.
foreach my $f (@files) {
printf INDEX "<tr><td>
<
a
href
=\
"
%s
\"
>%s</a></td><td align=
\
'right
\
'>%s</td></tr>
\n
",
$f
->
[
0
],
$f
->
[
1
],
$f
->
[
2
]
or
die
"
writing index: $!
";
}
print
INDEX
"
</table></body></html>
\n
"
or
die
"
writing index: $!
";
close
INDEX
or
die
"
writing index: $!
";
exit
0
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment