Commit 59e12976 authored by Claes Sjofors's avatar Claes Sjofors

Wtt command 'distribute /file' to copy a specific package added

parent 2fd78f4d
...@@ -9300,10 +9300,12 @@ Distribute files to operator or process station. ...@@ -9300,10 +9300,12 @@ Distribute files to operator or process station.
Creates a distribution package, copies the package to Creates a distribution package, copies the package to
the station and unpacks the package. the station and unpacks the package.
<B>wtt> distribute /node= [/package] <B>wtt> distribute /node= [/package] [/file=]
/node <t>Node to distribute to. /node <t>Node to distribute to.
/package <t>Only create package. The packaged is created but not copied. /package <t>Only create package. The package is created but not copied.
/file <t>Package file name. Copies an existing package without creating a
<t>new package.
</TOPIC> </TOPIC>
......
...@@ -9183,10 +9183,11 @@ Distribuerar filer till operat ...@@ -9183,10 +9183,11 @@ Distribuerar filer till operat
Skapar ett distributions paket, kopierar paketet till Skapar ett distributions paket, kopierar paketet till
stationen och packar upp det. stationen och packar upp det.
<B>wtt> distribute /node= [/package] <B>wtt> distribute /node= [/package] [/file=]
/node <t>Nod att distribuera till. /node <t>Nod att distribuera till.
/package <t>Skapar enbar ett paket. Paketet skapas men kopieras inte. /package <t>Skapar enbar ett paket. Paketet skapas men kopieras inte.
/file <t>Namn på paket. Kopierar angivet paket utan att skapa ett nytt.
</TOPIC> </TOPIC>
......
...@@ -444,7 +444,7 @@ dcli_tCmdTable wnav_command_table[] = { ...@@ -444,7 +444,7 @@ dcli_tCmdTable wnav_command_table[] = {
{ {
"DISTRIBUTE", "DISTRIBUTE",
&wnav_distribute_func, &wnav_distribute_func,
{ "/NODE", "/PACKAGE", ""} { "/NODE", "/PACKAGE", "/FILE", ""}
}, },
{ {
"RELEASE", "RELEASE",
...@@ -5003,8 +5003,10 @@ static int wnav_distribute_func( void *client_data, ...@@ -5003,8 +5003,10 @@ static int wnav_distribute_func( void *client_data,
int sts; int sts;
char *node_ptr; char *node_ptr;
char node_str[80]; char node_str[80];
pwr_tFileName file_str, file;
int package; int package;
bool distribute; bool distribute;
char *s;
if ( ODD( dcli_get_qualifier( "/NODE", node_str, sizeof(node_str)))) if ( ODD( dcli_get_qualifier( "/NODE", node_str, sizeof(node_str))))
node_ptr = node_str; node_ptr = node_str;
...@@ -5014,17 +5016,42 @@ static int wnav_distribute_func( void *client_data, ...@@ -5014,17 +5016,42 @@ static int wnav_distribute_func( void *client_data,
package = ODD( dcli_get_qualifier( "/PACKAGE", 0, 0)); package = ODD( dcli_get_qualifier( "/PACKAGE", 0, 0));
distribute = package ? false : true; distribute = package ? false : true;
sts = WNAV__SUCCESS; if ( ODD( dcli_get_qualifier( "/FILE", file_str, sizeof(file_str)))) {
try { if ( !node_ptr) {
wb_pkg *pkg = new wb_pkg( node_ptr, distribute); wnav->message('E', "Syntax error, node is missing");
delete pkg; return WNAV__SYNTAX;
}
if ( (s = strchr( file_str, '/')) != 0)
strncpy( file, s+1, sizeof(file));
else
strncpy( file, file_str, sizeof(file));
sts = WNAV__SUCCESS;
try {
wb_pkg *pkg = new wb_pkg( node_ptr, false, false);
pkg->copyPackage( file);
delete pkg;
}
catch ( wb_error &e) {
wnav->message(' ', (char *)e.what().c_str());
sts = e.sts();
}
if ( EVEN(sts))
return sts;
} }
catch ( wb_error &e) { else {
wnav->message(' ', (char *)e.what().c_str()); sts = WNAV__SUCCESS;
sts = e.sts(); try {
wb_pkg *pkg = new wb_pkg( node_ptr, distribute);
delete pkg;
}
catch ( wb_error &e) {
wnav->message(' ', (char *)e.what().c_str());
sts = e.sts();
}
if ( EVEN(sts))
return sts;
} }
if ( EVEN(sts))
return sts;
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment