Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
946b39b0
Commit
946b39b0
authored
Jan 23, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New distributor window
parent
60ddd53d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
17 deletions
+54
-17
wb/lib/wb/src/wb_pkg.cpp
wb/lib/wb/src/wb_pkg.cpp
+47
-13
wb/lib/wb/src/wb_pkg.h
wb/lib/wb/src/wb_pkg.h
+7
-4
No files found.
wb/lib/wb/src/wb_pkg.cpp
View file @
946b39b0
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include "co_time.h"
#include "co_time.h"
#include "rt_load.h"
#include "rt_load.h"
wb_pkg
::
wb_pkg
(
char
*
nodelist
)
wb_pkg
::
wb_pkg
(
char
*
nodelist
,
bool
distribute
)
{
{
if
(
nodelist
)
{
if
(
nodelist
)
{
char
node_str
[
32
][
20
];
char
node_str
[
32
][
20
];
...
@@ -32,7 +32,7 @@ wb_pkg::wb_pkg( char *nodelist)
...
@@ -32,7 +32,7 @@ wb_pkg::wb_pkg( char *nodelist)
readConfig
();
readConfig
();
fetchFiles
();
fetchFiles
(
distribute
);
}
}
void
wb_pkg
::
readConfig
()
void
wb_pkg
::
readConfig
()
...
@@ -250,7 +250,7 @@ pkg_node& wb_pkg::getNode( char *name)
...
@@ -250,7 +250,7 @@ pkg_node& wb_pkg::getNode( char *name)
throw
wb_error_str
(
"No such node"
);
throw
wb_error_str
(
"No such node"
);
}
}
void
pkg_node
::
fetchFiles
()
void
pkg_node
::
fetchFiles
(
bool
distribute
)
{
{
char
dev
[
80
];
char
dev
[
80
];
char
dir
[
80
];
char
dir
[
80
];
...
@@ -327,7 +327,10 @@ void pkg_node::fetchFiles()
...
@@ -327,7 +327,10 @@ void pkg_node::fetchFiles()
of
<<
of
<<
"#mv $pwrp_tmp/pkg_unpack.sh $pwrp_tmp/pkg_build"
<<
endl
<<
"#mv $pwrp_tmp/pkg_unpack.sh $pwrp_tmp/pkg_build"
<<
endl
<<
"cd $pwrp_tmp"
<<
endl
<<
"cd $pwrp_tmp"
<<
endl
<<
"tar -czf $pwrp_load/"
<<
pkg_name
<<
" pwr_pkg.dat pkg_unpack.sh pkg_build"
<<
endl
<<
"tar -czf $pwrp_load/"
<<
pkg_name
<<
" pwr_pkg.dat pkg_unpack.sh pkg_build"
<<
endl
;
if
(
distribute
)
of
<<
"cd $pwrp_load"
<<
endl
<<
"cd $pwrp_load"
<<
endl
<<
"ftp -vin "
<<
m_name
<<
" << EOF &>$pwrp_tmp/ftp_"
<<
m_name
<<
".log"
<<
endl
<<
"ftp -vin "
<<
m_name
<<
" << EOF &>$pwrp_tmp/ftp_"
<<
m_name
<<
".log"
<<
endl
<<
"user pwrp pwrp"
<<
endl
<<
"user pwrp pwrp"
<<
endl
<<
...
@@ -403,6 +406,37 @@ void pkg_node::fetchFiles()
...
@@ -403,6 +406,37 @@ void pkg_node::fetchFiles()
}
}
void
wb_pkg
::
copyPackage
(
char
*
pkg_name
)
{
char
pack_fname
[
200
];
char
node_name
[
80
];
char
*
s
;
// Extract node name from package name
strcpy
(
node_name
,
&
pkg_name
[
9
]);
if
(
(
s
=
strrchr
(
node_name
,
'_'
)))
*
s
=
0
;
dcli_translate_filename
(
pack_fname
,
"$pwrp_tmp/pkg_pack.sh"
);
ofstream
of
(
pack_fname
);
of
<<
"cd $pwrp_load"
<<
endl
<<
"ftp -vin "
<<
node_name
<<
" << EOF &>$pwrp_tmp/ftp_"
<<
node_name
<<
".log"
<<
endl
<<
"user pwrp pwrp"
<<
endl
<<
"binary"
<<
endl
<<
"put "
<<
pkg_name
<<
endl
<<
"quit"
<<
endl
<<
"EOF"
<<
endl
<<
"rsh -l pwrp "
<<
node_name
<<
"
\\
$pwr_exe/pwr_pkg.sh -i "
<<
pkg_name
<<
endl
;
of
.
close
();
// Execute the pack file
char
cmd
[
200
];
sprintf
(
cmd
,
"source %s"
,
pack_fname
);
system
(
cmd
);
}
void
pkg_pattern
::
fetchFiles
()
void
pkg_pattern
::
fetchFiles
()
{
{
char
found_file
[
200
];
char
found_file
[
200
];
...
...
wb/lib/wb/src/wb_pkg.h
View file @
946b39b0
...
@@ -25,6 +25,7 @@ class pkg_file {
...
@@ -25,6 +25,7 @@ class pkg_file {
char
*
source
()
{
return
m_source
;}
char
*
source
()
{
return
m_source
;}
char
*
target
()
{
return
m_target
;}
char
*
target
()
{
return
m_target
;}
pwr_tTime
date
()
{
return
m_date
;}
pwr_tTime
date
()
{
return
m_date
;}
};
};
class
pkg_pattern
{
class
pkg_pattern
{
...
@@ -82,7 +83,7 @@ class pkg_node {
...
@@ -82,7 +83,7 @@ class pkg_node {
void
push_back
(
pkg_pattern
&
pattern
)
{
void
push_back
(
pkg_pattern
&
pattern
)
{
m_pattern
.
push_back
(
pattern
);
m_pattern
.
push_back
(
pattern
);
}
}
void
fetchFiles
();
void
fetchFiles
(
bool
distribute
);
};
};
class
wb_pkg
{
class
wb_pkg
{
...
@@ -93,11 +94,13 @@ class wb_pkg {
...
@@ -93,11 +94,13 @@ class wb_pkg {
void
readConfig
();
void
readConfig
();
public:
public:
wb_pkg
(
char
*
nodelist
);
wb_pkg
(
char
*
nodelist
,
bool
distribute
=
true
);
pkg_node
&
getNode
(
char
*
name
);
pkg_node
&
getNode
(
char
*
name
);
void
fetchFiles
()
{
void
fetchFiles
(
bool
distribute
)
{
for
(
int
i
=
0
;
i
<
(
int
)
m_nodelist
.
size
();
i
++
)
m_nodelist
[
i
].
fetchFiles
();
for
(
int
i
=
0
;
i
<
(
int
)
m_nodelist
.
size
();
i
++
)
m_nodelist
[
i
].
fetchFiles
(
distribute
);
}
}
static
void
copyPackage
(
char
*
pkg_name
);
};
};
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment