Commit ff42d43a authored by Claes Sjofors's avatar Claes Sjofors

Wb command 'build all' added

parent 4114ccaa
......@@ -176,6 +176,11 @@ void wb_build::all( int no_export, int no_classvolumes, int no_flowfiles)
int force = opt.force;
opt.force = 1;
// Save directory volume
if ( ((wb_session *)m_wnav->ldhses)->cid() == pwr_eClass_DirectoryVolume)
sts = lfu_SaveDirectoryVolume( m_wnav->ldhses, m_wnav->wow, 1);
// Import, export files and build directories
import_files( bld_ePass_BeforeNode);
if ( evenSts())
sumsts = m_sts;
......@@ -210,14 +215,6 @@ void wb_build::all( int no_export, int no_classvolumes, int no_flowfiles)
sprintf( cmd, "create snapshot/file=\"$pwrp_db/%s.wb_load\"/out=\"$pwrp_load/%s.dbs\"",
cdh_Low(vol[i].name), cdh_Low(vol[i].name));
m_wnav->command( cmd);
if ( !no_flowfiles) {
sprintf( cmd, "wb_cmd -c %s create flow/templ/all", cdh_Low(vol[i].name));
sts = system( cmd);
if ( sts != 0) {
printf( "** Create flow for classvolume %s error\n", vol[i].name);
}
}
break;
default: ;
}
......
......@@ -466,7 +466,8 @@ dcli_tCmdTable wnav_command_table[] = {
"BUILD",
&wnav_build_func,
{ "dcli_arg1", "dcli_arg2", "/FORCE", "/DEBUG", "/CROSSREFERENCE",
"/MANUAL", "/NAME", "/WINDOW", "/NODE", ""}
"/MANUAL", "/NAME", "/WINDOW", "/NODE", "/EXPORT", "/NOCLASSVOLUMES", "/FLOWFILES",
""}
},
{
"CHECK",
......@@ -5530,6 +5531,30 @@ static int wnav_build_func( void *client_data,
command_sts = build.sts();
}
}
else if ( cdh_NoCaseStrncmp( arg1_str, "ALL", strlen( arg1_str)) == 0) {
// command is "BUILD ALL"
int exp, noclassvolumes, flowfiles;
// if ( !(CoLogin::privilege() & pwr_mPrv_DevConfig)) {
// wnav->message( 'E', "User is not authorized to build");
// return WNAV__NOTAUTHORIZED;
// }
if ( ((wb_session *)wnav->ldhses)->cid() != pwr_eClass_DirectoryVolume) {
wnav->message( 'E', "Can only build all from Directory volume");
return WNAV__SYNTAX;
}
wb_build build( *(wb_session *)wnav->ldhses, wnav);
build.opt.debug = ODD( dcli_get_qualifier( "/DEBUG", 0, 0));
exp = ODD( dcli_get_qualifier( "/EXPORT", 0, 0));
noclassvolumes = ODD( dcli_get_qualifier( "/NOCLASSVOLUMES", 0, 0));
flowfiles = ODD( dcli_get_qualifier( "/FLOWFILES", 0, 0));
build.all( !exp, noclassvolumes, !flowfiles);
wnav->message(' ', wnav_get_message(build.sts()));
command_sts = build.sts();
}
else {
wnav->message('E', "Syntax error");
return WNAV__SYNTAX;
......
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