@@ -515,4 +515,46 @@ public void removeNonFileLocs(str systemName, str systemVersion) {
515
515
logMessage ("Writing binary for <systemName > , version <systemVersion > " ,2 );
516
516
writeBinaryValueFile (binLoc , pt , compression =false );
517
517
}
518
+ }
519
+
520
+ public void patchBinaries () {
521
+ for (systemName <- getProducts (), systemVersion <- getVersions (systemName )) {
522
+ patchBinaries (systemName , systemVersion );
523
+ }
524
+ }
525
+
526
+ public void patchBinaries (str systemName ) {
527
+ for (systemVersion <- getVersions (systemName )) {
528
+ patchBinaries (systemName , systemVersion );
529
+ }
530
+ }
531
+
532
+ public void patchBinaries (str systemName , str systemVersion ) {
533
+ pt = loadBinary (systemName , systemVersion );
534
+
535
+ // Find any locations of files that did not parse correctly
536
+ errorLocs = { l | l <- pt .files , pt .files [l ] is errscript };
537
+
538
+ if (size (errorLocs ) == 0 ) {
539
+ logMessage ("No errored locations found for <systemName > , version <systemVersion > " , 2 );
540
+ return ;
541
+ }
542
+
543
+ fixedLocs = { };
544
+
545
+ for (l <- errorLocs ) {
546
+ s = loadPHPFile (l );
547
+ if (s is errscript ) {
548
+ logMessage ("Unable to fix script at location <l > for <systemName > , version <systemVersion > " , 2 );
549
+ } else {
550
+ fixedLocs += l ;
551
+ pt .files [l ] = s ;
552
+ logMessage ("Fixed script at location <l > for <systemName > , version <systemVersion > " , 2 );
553
+ }
554
+ }
555
+
556
+ if (size (fixedLocs ) > 0) {
557
+ loc binLoc = parsedDir + " <systemName >-<systemVersion >.pt ";
558
+ writeBinaryValueFile(binLoc, pt, compression=false);
559
+ }
518
560
}
0 commit comments