Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Main
Synchronet
Commits
6e89567d
Commit
6e89567d
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Now cleans-up after itself.
Updated README.TXT and FILE_ID.DIZ contents.
parent
82383c2f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/testbuild.js
+32
-9
32 additions, 9 deletions
exec/testbuild.js
with
32 additions
and
9 deletions
exec/testbuild.js
+
32
−
9
View file @
6e89567d
...
...
@@ -22,13 +22,18 @@ var platform = system.platform.toLowerCase();
var
make
=
(
platform
==
"
win32
"
?
"
make
"
:
"
gmake
"
);
var
msdev
=
'
"C:
\\
Program Files
\\
Microsoft Visual Studio
\\
Common
\\
MSDev98
\\
Bin
\\
msdev"
'
;
var
build_output
=
"
build_output.txt
"
;
var
archive
;
var
archive_cmd
;
var
cleanup
;
if
(
platform
==
"
win32
"
)
{
archive
=
"
sbbs_src.zip
"
;
archive_cmd
=
"
pkzip25 -exclude=*output.txt -add -dir
"
+
archive
;
archive_cmd
=
"
pkzip25 -exclude=*output.txt -add -dir -max
"
+
archive
;
cleanup
=
"
rmdir /s /q
"
;
}
else
{
archive
=
"
sbbs_src.tgz
"
;
archive_cmd
=
"
tar --exclude=*output.txt -czvf
"
+
archive
+
"
*
"
;
cleanup
=
"
rm -r -f
"
}
var
builds
...
...
@@ -65,9 +70,10 @@ var file = new File("README.TXT");
if
(
file
.
open
(
"
wt
"
))
{
file
.
writeln
(
format
(
"
Synchronet-%s C/C++ Source Code Archive (%s)
\n
"
,
system
.
platform
,
system
.
datestr
()));
file
.
writeln
(
"
This archive contains a snap-shot of all the source code and library files
"
file
.
writeln
(
"
necessary for a successful
"
+
system
.
platform
+
"
build of the following
"
file
.
writeln
(
"
Synchronet projects as of
"
+
system
.
datestr
()
+
"
:
"
);
file
.
writeln
(
"
This archive contains a snap-shot of all the source code and library files
"
);
file
.
writeln
(
"
necessary for a successful
"
+
system
.
platform
+
"
build of the following Synchronet projects
"
);
file
.
writeln
(
"
as of
"
+
system
.
datestr
()
+
"
:
"
);
file
.
writeln
();
file
.
writeln
(
format
(
"
%-20s %s
"
,
"
Project Directory
"
,
"
Build Command
"
));
for
(
i
in
builds
)
{
...
...
@@ -75,7 +81,8 @@ if(file.open("wt")) {
file
.
writeln
(
format
(
"
%-20s %s
"
,
builds
[
i
][
0
],
builds
[
i
][
1
]));
}
file
.
writeln
();
file
.
writeln
(
format
(
"
Builds verified on %s by %s
"
,
system
.
timestr
(),
system_description
));
file
.
writeln
(
"
Builds verified on
"
+
system
.
timestr
());
file
.
writeln
(
system_description
);
file
.
writeln
();
file
.
writeln
(
"
For more details, see http://synchro.net/docs/source.html
"
);
if
(
platform
!=
"
win32
"
)
...
...
@@ -85,8 +92,11 @@ if(file.open("wt")) {
var
file
=
new
File
(
"
FILE_ID.DIZ
"
);
if
(
file
.
open
(
"
wt
"
))
{
file
.
writeln
(
format
(
"
Synchronet-%s C/C++ source code archive
"
,
system
.
platform
));
file
.
writeln
(
format
(
"
(%s)
"
,
system
.
datestr
()));
file
.
writeln
(
format
(
"
Synchronet-%s BBS Software
"
,
system
.
platform
));
file
.
writeln
(
format
(
"
C/C++ source code archive (%s)
"
,
system
.
datestr
()));
if
(
platform
==
"
win32
"
)
file
.
writeln
(
"
Unzip *with* directories!
"
);
file
.
writeln
(
"
http://www.synchro.net
"
);
file
.
close
();
}
...
...
@@ -101,7 +111,7 @@ for(i in builds) {
log
(
LOG_INFO
,
"
Build sub-directory:
"
+
sub_dir
);
if
(
!
chdir
(
build_dir
))
{
semd_email
(
subject
,
log
(
LOG_ERR
,
"
!FAILED to chdir to:
"
+
build_dir
));
exit
(
1
);
bail
(
1
);
}
builds
[
i
].
start
=
time
();
...
...
@@ -115,7 +125,7 @@ for(i in builds) {
send_email
(
subject
,
log
(
LOG_ERR
,
"
!ERROR
"
+
retval
+
"
executing: '
"
+
cmd_line
+
"
' in
"
+
sub_dir
)
+
"
\n\n
"
+
file_contents
(
build_output
));
exit
(
1
);
bail
(
1
);
}
builds
[
i
].
end
=
time
();
...
...
@@ -140,8 +150,21 @@ log(LOG_INFO,format("Copying %s to %s",archive,dest));
if
(
!
file_copy
(
archive
,
dest
))
log
(
LOG_ERR
,
format
(
"
!ERROR copying %s to %s
"
,
archive
,
dest
));
bail
(
0
);
/* end */
function
bail
(
code
)
{
if
(
cleanup
)
{
chdir
(
temp_dir
+
"
/..
"
);
log
(
LOG_INFO
,
"
Executing:
"
+
cleanup
+
temp_dir
);
var
retval
=
system
.
exec
(
cleanup
+
temp_dir
);
if
(
retval
)
log
(
LOG_ERR
,
format
(
"
!ERROR %d executing %s
"
,
retval
,
cleanup
+
temp_dir
));
}
exit
(
code
);
}
function
elapsed_time
(
t
)
{
return
format
(
"
%02u:%02u
"
,
t
/
60
,
t
%
60
);
...
...
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