Launcher.pm 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. #
  2. # Software Index, Copyright 2010, Software Index Project Team
  3. # Link: http://swi.sourceforge.net
  4. #
  5. # This file is part of Software Index Tool.
  6. #
  7. # Software Index is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, version 3 of the License.
  10. #
  11. # Software Index is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Software Index. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. use strict;
  20. use XML::Simple;
  21. use FileHandle;
  22. #
  23. # Export section
  24. #
  25. require Exporter;
  26. use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $PREFERRED_PARSER);
  27. @ISA = qw(Exporter);
  28. @EXPORT = qw(swiLaunch);
  29. @EXPORT_OK = qw();
  30. $VERSION = '1.0';
  31. $PREFERRED_PARSER = undef;
  32. #
  33. # Subroutine for troubleshooting purposes
  34. #
  35. use Internal::Output;
  36. #
  37. # Include SWI libs
  38. #
  39. require SWI::Appraiser;
  40. require SWI::Converter;
  41. require SWI::Merger;
  42. require SWI::Processor;
  43. #
  44. # Global variables
  45. #
  46. my $config = undef;
  47. #
  48. # Enter point
  49. #
  50. sub swiLaunch
  51. {
  52. my $returnCode = 0;
  53. my $rootLocation = shift();
  54. my $swiConfiguration = shift();
  55. # $returnCode == 0 => no critical errors and warnings
  56. # $returnCode > 0 => no critical errors, there are warnings
  57. # $returnCode < 0 => there are critical errors
  58. if ( $returnCode >= 0 )
  59. {
  60. if ( $swiConfiguration eq "" )
  61. {
  62. STATUS("Configuration file should be specified!");
  63. $returnCode = -1;
  64. }
  65. else
  66. {
  67. STATUS("Configuration file: $swiConfiguration.");
  68. }
  69. }
  70. if ( $returnCode >= 0 )
  71. {
  72. if ( swiConfigurationValidate($swiConfiguration) != 0 )
  73. {
  74. STATUS("Wrong configuration file!");
  75. $returnCode = -2;
  76. }
  77. }
  78. if ( $returnCode >= 0 )
  79. {
  80. # Generate report for every module separately
  81. for (
  82. my $i = 0 ;
  83. $i <= $#{ $config->{"swi:modules"}->{"swi:module"} } ;
  84. $i++
  85. )
  86. {
  87. STATUS( "Processing module: '"
  88. . $config->{"swi:modules"}->{"swi:module"}[$i]->{"swi:name"}
  89. . "'." );
  90. my $result = swiProcess( $config, $i, $rootLocation );
  91. if ( $result < 0 )
  92. {
  93. STATUS("The are problems to report the index for the module!");
  94. $returnCode = -5;
  95. }
  96. elsif ( $result > 0 )
  97. {
  98. STATUS("The are scan warnings and/or errors.");
  99. $returnCode = $result;
  100. }
  101. else
  102. {
  103. STATUS("The module has been processed succesfully.");
  104. }
  105. }
  106. }
  107. if ( $returnCode >= 0 )
  108. {
  109. # Merge reports
  110. if ( swiMerge($config) )
  111. {
  112. STATUS("The are problems to merge files to one report!");
  113. $returnCode = -3;
  114. }
  115. else
  116. {
  117. STATUS("Merged report has been created.");
  118. }
  119. }
  120. if ( $returnCode >= 0 )
  121. {
  122. # Add average/min/max/total values and generate final XML report
  123. if ( swiAppraise($config) )
  124. {
  125. STATUS("The are problems to add average/min/max/total values!");
  126. $returnCode = -4;
  127. }
  128. else
  129. {
  130. STATUS("Average/min/max/total values have been added.");
  131. }
  132. }
  133. if ( $returnCode >= 0 )
  134. {
  135. # Convert results
  136. my $result = swiConvert($config);
  137. if ( $result < 0 )
  138. {
  139. STATUS("The are problems to convert the report!");
  140. $returnCode = -5;
  141. }
  142. elsif ( $result > 0 )
  143. {
  144. STATUS(
  145. "Report has been converted. There are exceeded limitations.");
  146. $returnCode = $result;
  147. }
  148. else
  149. {
  150. STATUS("Report has been converted.");
  151. }
  152. }
  153. return $returnCode;
  154. }
  155. sub swiConfigurationValidate
  156. {
  157. my $result = 0;
  158. $config =
  159. XMLin( shift(),
  160. ForceArray => [ "swi:module", "swi:rule", "swi:pattern" ] );
  161. if ( !defined( $config->{'swi:info'} ) )
  162. {
  163. STATUS("Wrong configuration: 'swi:info' section missed.");
  164. $result++;
  165. }
  166. else
  167. {
  168. if ( !defined( $config->{'swi:info'}->{'swi:version'} ) )
  169. {
  170. STATUS(
  171. "Wrong configuration: 'swi:info/swi:version' section missed.");
  172. $result++;
  173. }
  174. elsif ( $config->{'swi:info'}->{'swi:version'} != 1 )
  175. {
  176. STATUS(
  177. "Wrong configuration: Unsupported version of the configuration file. Check 'swi:info/swi:version' section."
  178. );
  179. $result++;
  180. }
  181. if ( !defined( $config->{'swi:info'}->{'swi:project'} ) )
  182. {
  183. STATUS(
  184. "Wrong configuration: 'swi:info/swi:project' section missed.");
  185. $result++;
  186. }
  187. else
  188. {
  189. if (
  190. !defined(
  191. $config->{'swi:info'}->{'swi:project'}->{'swi:name'}
  192. )
  193. )
  194. {
  195. STATUS(
  196. "Wrong configuration: 'swi:info/swi:project/swi:name' section missed."
  197. );
  198. $result++;
  199. }
  200. elsif ( $config->{'swi:info'}->{'swi:project'}->{'swi:name'} eq "" )
  201. {
  202. STATUS(
  203. "Wrong configuration: 'swi:info/swi:project/swi:name' is empty."
  204. );
  205. $result++;
  206. }
  207. }
  208. }
  209. if ( !defined( $config->{'swi:general'} )
  210. || ref( $config->{'swi:general'} ) ne 'HASH' )
  211. {
  212. $config->{'swi:general'} = {};
  213. }
  214. if ( !defined( $config->{'swi:general'}->{'swi:debug'} )
  215. || ref( $config->{'swi:general'}->{'swi:debug'} ) ne 'HASH' )
  216. {
  217. $config->{'swi:general'}->{'swi:debug'} = {};
  218. }
  219. if ( !defined( $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} ) )
  220. {
  221. $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} = 'off';
  222. }
  223. DEBUG_ENABLED(
  224. ( $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} eq 'on' )
  225. ? 1
  226. : 0
  227. );
  228. if ( !defined( $config->{'swi:modules'} )
  229. || ref( $config->{'swi:modules'} ) ne 'HASH' )
  230. {
  231. STATUS("Wrong configuration: 'swi:modules' section missed.");
  232. $result++;
  233. }
  234. else
  235. {
  236. if ( !defined( $config->{'swi:modules'}->{'swi:module'} )
  237. || ref( $config->{'swi:modules'}->{'swi:module'} ) ne 'ARRAY' )
  238. {
  239. STATUS(
  240. "Wrong configuration: 'swi:modules/swi:module' section missed."
  241. );
  242. $result++;
  243. }
  244. else
  245. {
  246. my $moduleId = 0;
  247. foreach my $module ( @{ $config->{'swi:modules'}->{'swi:module'} } )
  248. {
  249. if ( !defined( $module->{'swi:name'} ) )
  250. {
  251. STATUS(
  252. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:name' section missed."
  253. );
  254. $result++;
  255. }
  256. if ( !defined( $module->{'swi:location'} ) )
  257. {
  258. STATUS(
  259. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:location' section missed."
  260. );
  261. $result++;
  262. }
  263. if ( !defined( $module->{'swi:files'} )
  264. || ref( $module->{'swi:files'} ) ne 'HASH' )
  265. {
  266. $module->{'swi:files'} = {};
  267. }
  268. if ( !defined( $module->{'swi:files'}->{'swi:include'} ) )
  269. {
  270. $module->{'swi:files'}->{'swi:include'} = '.*';
  271. }
  272. if ( !defined( $module->{'swi:files'}->{'swi:exclude'} ) )
  273. {
  274. $module->{'swi:files'}->{'swi:exclude'} = '';
  275. }
  276. if ( !defined( $module->{'swi:preprocessor'} )
  277. || ref( $module->{'swi:preprocessor'} ) ne 'HASH' )
  278. {
  279. $module->{'swi:preprocessor'} = {};
  280. }
  281. if ( !defined( $module->{'swi:preprocessor'}->{'swi:rule'} ) )
  282. {
  283. $module->{'swi:preprocessor'}->{'swi:rule'} = [];
  284. }
  285. my $ruleId = 0;
  286. foreach
  287. my $rule ( @{ $module->{'swi:preprocessor'}->{'swi:rule'} } )
  288. {
  289. if ( !defined( $rule->{'swi:filepattern'} )
  290. || $rule->{'swi:filepattern'} eq "" )
  291. {
  292. STATUS(
  293. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:filepattern' section missed."
  294. );
  295. $result++;
  296. }
  297. if ( !defined( $rule->{'swi:searchpattern'} )
  298. || $rule->{'swi:searchpattern'} eq "" )
  299. {
  300. STATUS(
  301. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:searchpattern' section missed."
  302. );
  303. $result++;
  304. }
  305. if ( !defined( $rule->{'swi:replacepattern'} )
  306. || $rule->{'swi:replacepattern'} eq "" )
  307. {
  308. STATUS(
  309. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:replacepattern' section missed."
  310. );
  311. $result++;
  312. }
  313. $ruleId++;
  314. }
  315. if ( !defined( $module->{'swi:scanner'} )
  316. || ref( $module->{'swi:scanner'} ) ne 'HASH' )
  317. {
  318. $module->{'swi:scanner'} = {};
  319. }
  320. if ( !defined( $module->{'swi:scanner'}->{'swi:rule'} ) )
  321. {
  322. $module->{'swi:scanner'}->{'swi:rule'} = [];
  323. }
  324. $ruleId = 0;
  325. foreach my $rule ( @{ $module->{'swi:scanner'}->{'swi:rule'} } )
  326. {
  327. if ( !defined( $rule->{'swi:filepattern'} )
  328. || $rule->{'swi:filepattern'} eq "" )
  329. {
  330. STATUS(
  331. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:filepattern' section missed."
  332. );
  333. $result++;
  334. }
  335. if ( !defined( $rule->{'swi:searchpattern'} )
  336. || $rule->{'swi:searchpattern'} eq "" )
  337. {
  338. STATUS(
  339. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:searchpattern' section missed."
  340. );
  341. $result++;
  342. }
  343. if ( !defined( $rule->{'swi:messagepattern'} )
  344. || $rule->{'swi:messagepattern'} eq "" )
  345. {
  346. STATUS(
  347. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:messagepattern' section missed."
  348. );
  349. $result++;
  350. }
  351. if ( !defined( $rule->{'swi:codecontent'} )
  352. || $rule->{'swi:codecontent'} eq "" )
  353. {
  354. $rule->{'swi:codecontent'} = 'purified';
  355. }
  356. $ruleId++;
  357. }
  358. if ( !defined( $module->{'swi:scanner'}->{'swi:suppress'} ) )
  359. {
  360. $module->{'swi:scanner'}->{'swi:suppress'} = {};
  361. }
  362. if (
  363. !defined(
  364. $module->{'swi:scanner'}->{'swi:suppress'}
  365. ->{'swi:pattern'}
  366. )
  367. )
  368. {
  369. $module->{'swi:scanner'}->{'swi:suppress'}
  370. ->{'swi:pattern'} = [];
  371. }
  372. my $patternId = 0;
  373. foreach my $pattern (
  374. @{
  375. $module->{'swi:scanner'}->{'swi:suppress'}
  376. ->{'swi:pattern'}
  377. }
  378. )
  379. {
  380. if ( ref($pattern) ne 'HASH' )
  381. {
  382. STATUS(
  383. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]' section is incorrect."
  384. );
  385. $result++;
  386. }
  387. else
  388. {
  389. if ( !defined( $pattern->{'swi:message'} )
  390. || $pattern->{'swi:message'} eq "" )
  391. {
  392. STATUS(
  393. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]/swi:message' field is empty."
  394. );
  395. $result++;
  396. }
  397. if ( !defined( $pattern->{'content'} )
  398. || $pattern->{'content'} eq "" )
  399. {
  400. STATUS(
  401. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]' object pattern is empty."
  402. );
  403. $result++;
  404. }
  405. }
  406. $patternId++;
  407. }
  408. if ( !defined( $module->{'swi:indexer:common'} )
  409. || ref( $module->{'swi:indexer:common'} ) ne 'HASH' )
  410. {
  411. $module->{'swi:indexer:common'} = {};
  412. }
  413. if ( !defined( $module->{'swi:indexer:dup'} )
  414. || ref( $module->{'swi:indexer:dup'} ) ne 'HASH' )
  415. {
  416. $module->{'swi:indexer:dup'} = {};
  417. }
  418. if (
  419. !defined(
  420. $module->{'swi:indexer:dup'}->{'swi:codecontent'}
  421. )
  422. )
  423. {
  424. $module->{'swi:indexer:dup'}->{'swi:codecontent'} =
  425. 'purified';
  426. }
  427. if ( !defined( $module->{'swi:indexer:dup'}->{'swi:enabled'} ) )
  428. {
  429. $module->{'swi:indexer:dup'}->{'swi:enabled'} = 'off';
  430. }
  431. if ( !defined( $module->{'swi:indexer:dup'}->{'swi:minlength'} )
  432. )
  433. {
  434. $module->{'swi:indexer:dup'}->{'swi:minlength'} = 100;
  435. }
  436. if ( $module->{'swi:indexer:dup'}->{'swi:minlength'} <= 0 )
  437. {
  438. STATUS(
  439. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:indexer:dup/swi:minlength' can not be less than or equal to zero."
  440. );
  441. $result++;
  442. }
  443. if ( !defined( $module->{'swi:indexer:dup'}->{'swi:proximity'} )
  444. )
  445. {
  446. $module->{'swi:indexer:dup'}->{'swi:proximity'} = 100;
  447. }
  448. if ( $module->{'swi:indexer:dup'}->{'swi:proximity'} <= 0
  449. || $module->{'swi:indexer:dup'}->{'swi:proximity'} > 100 )
  450. {
  451. STATUS(
  452. "Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:indexer:dup/swi:proximity' should be in the range from 1 till 100."
  453. );
  454. $result++;
  455. }
  456. if (
  457. !defined(
  458. $module->{'swi:indexer:dup'}->{'swi:globalcode'}
  459. )
  460. )
  461. {
  462. $module->{'swi:indexer:dup'}->{'swi:globalcode'} = 'off';
  463. }
  464. $moduleId++;
  465. }
  466. }
  467. }
  468. if ( !defined( $config->{'swi:report'} )
  469. || ref( $config->{'swi:report'} ) ne 'HASH' )
  470. {
  471. STATUS("Wrong configuration: 'swi:report' section missed.");
  472. $result++;
  473. }
  474. else
  475. {
  476. if ( !defined( $config->{'swi:report'}->{'swi:destination'} ) )
  477. {
  478. STATUS(
  479. "Wrong configuration: 'swi:report/swi:destination' section missed."
  480. );
  481. $result++;
  482. }
  483. if ( !defined( $config->{'swi:report'}->{'swi:xml'} ) )
  484. {
  485. STATUS("Wrong configuration: 'swi:report/swi:xml' section missed.");
  486. $result++;
  487. }
  488. else
  489. {
  490. if (
  491. !defined( $config->{'swi:report'}->{'swi:xml'}->{'swi:name'} ) )
  492. {
  493. STATUS(
  494. "Wrong configuration: 'swi:report/swi:xml/swi:name' section is empty."
  495. );
  496. $result++;
  497. }
  498. }
  499. if ( !defined( $config->{'swi:report'}->{'swi:notifications'} ) )
  500. {
  501. STATUS(
  502. "Wrong configuration: 'swi:report/swi:notifications' section missed."
  503. );
  504. $result++;
  505. }
  506. else
  507. {
  508. if (
  509. !defined(
  510. $config->{'swi:report'}->{'swi:notifications'}->{'swi:name'}
  511. )
  512. )
  513. {
  514. STATUS(
  515. "Wrong configuration: 'swi:report/swi:notifications/swi:name' section is empty."
  516. );
  517. $result++;
  518. }
  519. if (
  520. !defined(
  521. $config->{'swi:report'}->{'swi:notifications'}
  522. ->{'swi:error'}
  523. )
  524. || ref(
  525. $config->{'swi:report'}->{'swi:notifications'}
  526. ->{'swi:error'}
  527. ) ne 'HASH'
  528. )
  529. {
  530. $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'} =
  531. {};
  532. }
  533. if (
  534. !defined(
  535. $config->{'swi:report'}->{'swi:notifications'}
  536. ->{'swi:error'}->{'swi:added'}
  537. )
  538. )
  539. {
  540. $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
  541. ->{'swi:added'} = 'on';
  542. }
  543. if (
  544. !defined(
  545. $config->{'swi:report'}->{'swi:notifications'}
  546. ->{'swi:error'}->{'swi:removed'}
  547. )
  548. )
  549. {
  550. $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
  551. ->{'swi:removed'} = 'on';
  552. }
  553. if (
  554. !defined(
  555. $config->{'swi:report'}->{'swi:notifications'}
  556. ->{'swi:error'}->{'swi:modified'}
  557. )
  558. )
  559. {
  560. $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
  561. ->{'swi:modified'} = 'on';
  562. }
  563. if (
  564. !defined(
  565. $config->{'swi:report'}->{'swi:notifications'}
  566. ->{'swi:error'}->{'swi:cloned'}
  567. )
  568. )
  569. {
  570. $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
  571. ->{'swi:cloned'} = 'on';
  572. }
  573. if (
  574. !defined(
  575. $config->{'swi:report'}->{'swi:notifications'}
  576. ->{'swi:error'}->{'swi:unmodified'}
  577. )
  578. )
  579. {
  580. $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
  581. ->{'swi:unmodified'} = 'on';
  582. }
  583. if (
  584. !defined(
  585. $config->{'swi:report'}->{'swi:notifications'}
  586. ->{'swi:print'}
  587. )
  588. || ref(
  589. $config->{'swi:report'}->{'swi:notifications'}
  590. ->{'swi:print'}
  591. ) ne 'HASH'
  592. )
  593. {
  594. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'} =
  595. {};
  596. }
  597. swiUtilConfigFill_PrintSection($config, 'swi:added');
  598. swiUtilConfigFill_PrintSection($config, 'swi:removed');
  599. swiUtilConfigFill_PrintSection($config, 'swi:modified');
  600. swiUtilConfigFill_PrintSection($config, 'swi:cloned');
  601. swiUtilConfigFill_PrintSection($config, 'swi:unmodified');
  602. }
  603. }
  604. # swi:limits section is verified in runtime
  605. # no precheck currently
  606. DEBUG( "Configuration structure is: " . Dumper($config) );
  607. return $result;
  608. }
  609. sub swiUtilConfigFill_PrintSection
  610. {
  611. my $config = shift();
  612. my $modType = shift();
  613. if (
  614. !defined(
  615. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  616. ->{$modType}
  617. )
  618. || ref(
  619. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  620. ->{$modType}
  621. ) ne 'HASH'
  622. )
  623. {
  624. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  625. ->{$modType} = {};
  626. }
  627. if (
  628. !defined(
  629. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  630. ->{$modType}->{'swi:failures'}
  631. )
  632. )
  633. {
  634. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  635. ->{$modType}->{'swi:failures'} = 'on';
  636. }
  637. if (
  638. !defined(
  639. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  640. ->{$modType}->{'swi:modifications'}
  641. )
  642. )
  643. {
  644. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  645. ->{$modType}->{'swi:modifications'} = 'on';
  646. }
  647. if (
  648. !defined(
  649. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  650. ->{$modType}->{'swi:duplications'}
  651. )
  652. )
  653. {
  654. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  655. ->{$modType}->{'swi:duplications'} = 'on';
  656. }
  657. if (
  658. !defined(
  659. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  660. ->{$modType}->{'swi:scanmessages'}
  661. )
  662. )
  663. {
  664. $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
  665. ->{$modType}->{'swi:scanmessages'} = 'on';
  666. }
  667. }
  668. return 1;