diff --git a/src/main/java/org/codehaus/mojo/rpm/SpecWriter.java b/src/main/java/org/codehaus/mojo/rpm/SpecWriter.java index b4f58dbb..28f45a9a 100644 --- a/src/main/java/org/codehaus/mojo/rpm/SpecWriter.java +++ b/src/main/java/org/codehaus/mojo/rpm/SpecWriter.java @@ -18,9 +18,8 @@ * specific language governing permissions and limitations * under the License. */ -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; + +import java.io.*; import java.util.Collection; import java.util.List; import java.util.Map; @@ -239,8 +238,8 @@ private void writeFiles() scanner.setExcludes( null ); scanner.scan(); - final boolean noFiles = map.getSources().isEmpty() || (scanner.isEverythingIncluded() && links.isEmpty()); - if ( noFiles && map.isDirectoryIncluded() && !map.isRecurseDirectories() ) + if ( scanner.isEverythingIncluded() && links.isEmpty() && map.isDirectoryIncluded() + && !map.isRecurseDirectories() ) { log.debug( "writing attribute string for directory: " + destination ); spec.println( attrString + " \"" + destination + "\"" ); @@ -273,7 +272,7 @@ private void writeFiles() } // only list files if requested (directoryIncluded == false) or we have to - if ( !map.isDirectoryIncluded() || !noFiles ) + if ( !( map.isDirectoryIncluded() && scanner.isEverythingIncluded() && links.isEmpty() && !map.isRecurseDirectories()) ) { final String[] files = scanner.getIncludedFiles();