From a0728f754b366036fc8fa1b16c5f1cfa296ec4ca Mon Sep 17 00:00:00 2001 From: Michel Jung Date: Fri, 18 Oct 2024 10:53:08 +0200 Subject: [PATCH] Truncate existing RPM file before writing new one Fixes #420 --- .../groovy/com/netflix/gradle/plugins/rpm/RpmCopyAction.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/groovy/com/netflix/gradle/plugins/rpm/RpmCopyAction.groovy b/src/main/groovy/com/netflix/gradle/plugins/rpm/RpmCopyAction.groovy index bf9e0610..9f1efa4f 100755 --- a/src/main/groovy/com/netflix/gradle/plugins/rpm/RpmCopyAction.groovy +++ b/src/main/groovy/com/netflix/gradle/plugins/rpm/RpmCopyAction.groovy @@ -236,6 +236,7 @@ class RpmCopyAction extends AbstractPackagingCopyAction { RandomAccessFile rpmFile try { rpmFile = new RandomAccessFile(task.getArchiveFile().get().asFile, "rw") + rpmFile.setLength(0); builder.build(rpmFile.getChannel()) logger.info 'Created rpm {}', rpmFile } finally {