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
cefe58c3
Commit
cefe58c3
authored
22 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Defaults to lib-all.tgz if lib-<system-machine>.tgz doesn't exist.
parent
478a608e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/install/sbbsinst.c
+35
-23
35 additions, 23 deletions
src/sbbs3/install/sbbsinst.c
with
35 additions
and
23 deletions
src/sbbs3/install/sbbsinst.c
+
35
−
23
View file @
cefe58c3
...
...
@@ -418,6 +418,7 @@ void install_sbbs(struct dist_t *dist,struct server_ent_t *server) {
char
cmd
[
MAX_PATH
+
1
];
char
str
[
1024
];
char
fname
[
MAX_PATH
+
1
];
char
dstfname
[
MAX_PATH
+
1
];
char
sbbsdir
[
9
+
MAX_PATH
];
char
cvstag
[
7
+
MAX_PATH
];
char
buf
[
1024
];
...
...
@@ -470,45 +471,54 @@ void install_sbbs(struct dist_t *dist,struct server_ent_t *server) {
break
;
case
DIST_SET
:
for
(
i
=
0
;
dist
->
files
[
i
][
0
];
i
++
)
{
if
((
fout
=
open
(
dist
->
files
[
i
],
O_WRONLY
|
O_TRUNC
|
O_CREAT
,
S_IRUSR
|
S_IWUSR
))
<
0
)
{
printf
(
"Could not download distfile to %s (%d)
\n
"
,
dist
->
files
[
i
],
errno
);
sprintf
(
fname
,
dist
->
files
[
i
],
params
.
sys_desc
);
SAFECOPY
(
dstfname
,
fname
);
if
((
fout
=
open
(
fname
,
O_WRONLY
|
O_TRUNC
|
O_CREAT
,
S_IRUSR
|
S_IWUSR
))
<
0
)
{
printf
(
"Could not download distfile to %s (%d)
\n
"
,
fname
,
errno
);
exit
(
EXIT_FAILURE
);
}
sprintf
(
str
,
dist
->
files
[
i
],
params
.
sys_desc
);
sprintf
(
url
,
"%s%s"
,
server
->
addr
,
str
);
sprintf
(
url
,
"%s%s"
,
server
->
addr
,
fname
);
if
((
remote
=
ftpGetURL
(
url
,
ftp_user
,
ftp_pass
,
&
ret1
))
==
NULL
)
{
/* retry without machine type in name */
SAFECOPY
(
fname
,
str
);
sprintf
(
str
,
dist
->
files
[
i
],
params
.
name
.
sysname
);
sprintf
(
url
,
"%s%s"
,
server
->
addr
,
str
);
if
(
strcmp
(
str
,
fname
)
==
0
/* no change in name? */
SAFECOPY
(
str
,
fname
);
sprintf
(
fname
,
dist
->
files
[
i
],
params
.
name
.
sysname
);
sprintf
(
url
,
"%s%s"
,
server
->
addr
,
fname
);
if
(
str
i
cmp
(
str
,
fname
)
==
0
/* no change in name? */
||
(
remote
=
ftpGetURL
(
url
,
ftp_user
,
ftp_pass
,
&
ret1
))
==
NULL
)
{
printf
(
"Cannot get distribution file %s!
\n
"
,
str
);
printf
(
"%s
\n
- %s
\n
"
,
url
,
ftpErrString
(
ret1
));
unlink
(
str
);
exit
(
EXIT_FAILURE
);
/* retry using "all" for system name */
sprintf
(
fname
,
dist
->
files
[
i
],
"all"
);
if
((
remote
=
ftpGetURL
(
url
,
ftp_user
,
ftp_pass
,
&
ret1
))
==
NULL
)
{
printf
(
"Cannot get distribution file %s!
\n
"
,
fname
);
printf
(
"%s
\n
- %s
\n
"
,
url
,
ftpErrString
(
ret1
));
close
(
fout
);
unlink
(
dstfname
);
exit
(
EXIT_FAILURE
);
}
}
}
while
((
ret1
=
remote
->
read
(
remote
,
buf
,
sizeof
(
buf
)))
>
0
)
{
ret2
=
write
(
fout
,
buf
,
ret1
);
if
(
ret2
!=
ret1
)
{
printf
(
"Error writing to %s
\n
"
,
dist
->
files
[
i
]);
unlink
(
dist
->
files
[
i
]);
printf
(
"Error writing to %s
\n
"
,
dstfname
);
close
(
fout
);
unlink
(
dstfname
);
exit
(
EXIT_FAILURE
);
}
}
if
(
ret1
<
0
)
{
printf
(
"Error downloading %s
\n
"
,
dist
->
files
[
i
]);
unlink
(
dist
->
files
[
i
]);
printf
(
"Error downloading %s
\n
"
,
fname
);
close
(
fout
);
unlink
(
dstfname
);
exit
(
EXIT_FAILURE
);
}
sprintf
(
cmd
,
"gzip -dc %s | tar -xvf -"
,
dist
->
files
[
i
]);
close
(
fout
);
sprintf
(
cmd
,
"gzip -dc %s | tar -xvf -"
,
dstfname
);
if
(
system
(
cmd
))
{
printf
(
"Error extracting %s
\n
"
,
d
i
st
->
files
[
i
]
);
unlink
(
d
i
st
->
files
[
i
]
);
printf
(
"Error extracting %s
\n
"
,
dst
fname
);
unlink
(
dst
fname
);
exit
(
EXIT_FAILURE
);
}
unlink
(
d
i
st
->
files
[
i
]
);
unlink
(
dst
fname
);
}
if
(
system
(
params
.
make_cmdline
))
{
printf
(
MAKE_ERROR
);
...
...
@@ -537,7 +547,7 @@ struct dist_t **
get_distlist
(
void
)
{
int
ret1
,
ret2
,
ret3
,
ret4
;
int
i
,
j
;
int
i
;
char
in_line
[
256
];
struct
dist_t
**
dist
;
char
**
file
=
NULL
;
...
...
@@ -558,9 +568,11 @@ get_distlist(void)
allocfail
(
sizeof
(
struct
dist_t
));
sprintf
(
str
,
DEFAULT_LIBFILE
,
params
.
sys_desc
);
if
(
!
fexist
(
str
))
/* use lib-linux.tgz if lib-linux-i686.tgz doesn't exist */
if
(
!
fexist
case
(
str
))
/* use lib-linux.tgz if lib-linux-i686.tgz doesn't exist */
sprintf
(
str
,
DEFAULT_LIBFILE
,
params
.
name
.
sysname
);
if
(
fexist
(
DEFAULT_DISTFILE
)
&&
fexist
(
str
))
{
if
(
!
fexistcase
(
str
))
/* use lib-all.tgz if all else fails */
sprintf
(
str
,
DEFAULT_LIBFILE
,
"all"
);
if
(
fexist
(
DEFAULT_DISTFILE
)
&&
fexistcase
(
str
))
{
if
((
file
=
(
char
**
)
MALLOC
(
sizeof
(
char
*
)
*
MAX_DIST_FILES
))
==
NULL
)
allocfail
(
sizeof
(
char
*
)
*
MAX_DIST_FILES
);
for
(
i
=
0
;
i
<
MAX_DIST_FILES
;
i
++
)
...
...
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