11package de .variantsync .evolution .repository ;
22
3+ import de .variantsync .evolution .util .Logger ;
34import de .variantsync .evolution .variability .SPLCommit ;
45import org .eclipse .jgit .api .errors .GitAPIException ;
56
1516
1617/***
1718 * A specialized SPLRepository that performs the necessary preprocessing of BusyBox source files, whenever a new
18- * commit is checked out. The preprocessing includes splitting of lines into multiple lines in order to deal with
19- * inline preprocessor macros used to model variability.
19+ * commit or branch is checked out. The preprocessing includes splitting of lines into multiple lines in order to deal
20+ * with inline preprocessor macros used to model variability.
2021 * <br>
2122 * The preprocessing was copied from KernelHaven: net.ssehub.kernel_haven.busyboot.PrepareBusybox;
2223 * Copyright 2018-2019 University of Hildesheim, Software Systems Engineering
@@ -31,14 +32,25 @@ public BusyboxRepository(Path path) {
3132 @ Override
3233 public SPLCommit checkoutCommit (final SPLCommit c , boolean forced ) throws GitAPIException , IOException {
3334 SPLCommit previousCommit = super .checkoutCommit (c , forced );
34- BusyboxRepository . normalizeDir ( this .getPath (). toFile () );
35+ this .preprocess ( );
3536 return previousCommit ;
3637 }
3738
3839 @ Override
3940 public void checkoutBranch (final Branch branch ) throws GitAPIException , IOException {
4041 super .checkoutBranch (branch );
41- BusyboxRepository .normalizeDir (this .getPath ().toFile ());
42+ this .preprocess ();
43+ }
44+
45+ public void preprocess () throws IOException {
46+ try {
47+ Logger .debug ("Normalizing Busybox files." );
48+ BusyboxRepository .normalizeDir (this .getPath ().toFile ());
49+ Logger .debug ("Finished normalization of Busybox files." );
50+ } catch (IOException e ) {
51+ Logger .error ("Was not able to normalize Busybox files." , e );
52+ throw e ;
53+ }
4254 }
4355
4456 /*
0 commit comments