Skip to content

Commit edb7b24

Browse files
committed
Handle licence linstallation filename conflicts
In case there is a license file called COPYING and a license text specified directly in build descriptor the dist should fail instead of silently overwritting the COPYING file. Closes #15
1 parent 037c8ed commit edb7b24

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mbi/dist/src/org/fedoraproject/mbi/tool/dist/LicensingDist.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.fedoraproject.mbi.tool.dist;
1717

1818
import java.nio.file.Files;
19+
import java.nio.file.StandardOpenOption;
1920

2021
import org.fedoraproject.mbi.Reactor;
2122
import org.fedoraproject.mbi.dist.DistRequest;
@@ -55,7 +56,8 @@ public void doDist()
5556
}
5657
if ( licensing.getText() != null )
5758
{
58-
Files.writeString( licensesDir.resolve( project.getName() + "-" + "COPYING" ), licensing.getText() );
59+
Files.writeString( licensesDir.resolve( project.getName() + "-" + "COPYING" ), licensing.getText(),
60+
StandardOpenOption.CREATE_NEW );
5961
}
6062
}
6163
}

0 commit comments

Comments
 (0)