fix_headers_nurandom.pl
Go to the documentation of this file.
1 use strict;
2 
3 use vars qw(%subdir_list);
4 use vars qw(%header_list);
5 
6 # explicit headers to avoid conflicts with experiment code
7 BEGIN { %header_list = (
8 "nutools/RandomUtils/ArtState.h" => "nurandom/RandomUtils/ArtState.h",
9 "nutools/RandomUtils/NuRandomService.h" => "nurandom/RandomUtils/NuRandomService.h",
10 "nutools/RandomUtils/Providers/EventSeedInputData.h" => "nurandom/RandomUtils/Providers/EventSeedInputData.h",
11 "nutools/RandomUtils/Providers/MapKeyIterator.h" => "nurandom/RandomUtils/Providers/MapKeyIterator.h",
12 "nutools/RandomUtils/Providers/RandomPolicy.h" => "nurandom/RandomUtils/Providers/RandomPolicy.h",
13 "nutools/RandomUtils/Providers/EngineId.h" => "nurandom/RandomUtils/Providers/EngineId.h",
14 "nutools/RandomUtils/Providers/BasePolicies.h" => "nurandom/RandomUtils/Providers/BasePolicies.h",
15 "nutools/RandomUtils/Providers/StandardPolicies.h" => "nurandom/RandomUtils/Providers/StandardPolicies.h",
16 "nutools/RandomUtils/Providers/Policies.h" => "nurandom/RandomUtils/Providers/Policies.h",
17 "nutools/RandomUtils/Providers/PerEventPolicy.h" => "nurandom/RandomUtils/Providers/PerEventPolicy.h",
18 "nutools/RandomUtils/Providers/SeedMaster.h" => "nurandom/RandomUtils/Providers/SeedMaster.h",
19 "nutools/RandomUtils/Providers/RandomSeedPolicyBase.h" => "nurandom/RandomUtils/Providers/RandomSeedPolicyBase.h"
20  ); }
21 
22 foreach my $inc (sort keys %header_list) {
23  s&^(\s*#include\s+["<])\Q$inc\E(.*)&${1}$header_list{$inc}${2}& and last;
24 }
25 
26 # also deal with definitions
27 s/NUTOOLS_RANDOMUTILS_NuRandomService_USECLHEP/NURANDOM_RANDOMUTILS_NuRandomService_USECLHEP/g;
28 s/NUTOOLS_RANDOMUTILS_NURANDOMSERVICE_USECLHEP/NURANDOM_RANDOMUTILS_NuRandomService_USECLHEP/g;
29 s/NUTOOLS_RANDOMUTILS_NuRandomService_USEROOT/NURANDOM_RANDOMUTILS_NuRandomService_USEROOT/g;