Skip to content

Commit

Permalink
Add plugin configuration parameter generateIntermediateDirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
moedan authored and ctron committed Feb 21, 2024
1 parent fec0073 commit a7a69a3
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/main/java/de/dentrassi/rpm/builder/RpmMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,28 @@ public void setGenerateDefaultSourcePackage(final boolean generateDefaultSourceP
this.generateDefaultSourcePackage = generateDefaultSourcePackage;
}

/**
* Whether implicitly created intermediate directories should explicitly
* added to package.
* <p>
* If enabled, all from entries implicitly created intermediate directories
* are added as explicit entries to package. Also the rules with file
* information are applied to these directories.
* </p>
* <p>
* To exclude directories like {@code /usr} from being added, you have
* to add these as prefix property (see {@code prefixes}). Directories
* that match a whole prefix or a sub path of it, are not added.
* </p>
*/
@Parameter(property = "rpm.generateIntermediateDirectories", defaultValue = "true")
boolean generateIntermediateDirectories = true;

public void setGenerateIntermediateDirectories(final boolean generateIntermediateDirectories) {
this.generateIntermediateDirectories = generateIntermediateDirectories;
}


/**
* The prefix of the release if this is a snapshot build, will be suffixed
* with the snapshot build id
Expand Down Expand Up @@ -1096,7 +1118,9 @@ protected void fillPayload(final RpmBuilder builder) throws MojoFailureException
}

ctx.removeListener(missingDirectoryTracker);
missingDirectoryTracker.addMissingIntermediateDirectoriesToContext(ctx);
if (generateIntermediateDirectories) {
missingDirectoryTracker.addMissingIntermediateDirectoriesToContext(ctx);
}
}

private void customizeHeader(final RpmBuilder builder) {
Expand Down

0 comments on commit a7a69a3

Please sign in to comment.