Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #119 from mojohaus/118
Browse files Browse the repository at this point in the history
  • Loading branch information
dantran authored Jan 20, 2020
2 parents e353276 + 4d5a21f commit c7ed5ca
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/org/codehaus/mojo/rpm/SpecWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
* specific language governing permissions and limitations
* under the License.
*/

import java.io.*;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -238,8 +239,8 @@ private void writeFiles()
scanner.setExcludes( null );
scanner.scan();

if ( scanner.isEverythingIncluded() && links.isEmpty() && map.isDirectoryIncluded()
&& !map.isRecurseDirectories() )
final boolean noFiles = map.getSources().isEmpty() || (scanner.isEverythingIncluded() && links.isEmpty());
if ( noFiles && map.isDirectoryIncluded() && !map.isRecurseDirectories() )
{
log.debug( "writing attribute string for directory: " + destination );
spec.println( attrString + " \"" + destination + "\"" );
Expand Down Expand Up @@ -272,7 +273,7 @@ private void writeFiles()
}

// only list files if requested (directoryIncluded == false) or we have to
if ( !( map.isDirectoryIncluded() && scanner.isEverythingIncluded() && links.isEmpty() && !map.isRecurseDirectories()) )
if ( !map.isDirectoryIncluded() || !noFiles )
{
final String[] files = scanner.getIncludedFiles();

Expand Down

0 comments on commit c7ed5ca

Please sign in to comment.