Skip to content

Commit 345dc3b

Browse files
ThorAsgardDevctron
authored andcommitted
Solve the issue #36
1 parent 945c58d commit 345dc3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/de/dentrassi/rpm/builder/YumMojo.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ private void addSinglePackage(final Path path, final Context context) throws IOE
243243
ris.getPayloadHeader();
244244
ris.getSignatureHeader();
245245

246-
final CpioArchiveInputStream cpio = ris.getCpioStream();
247-
CpioArchiveEntry cpioEntry;
248-
while ((cpioEntry = cpio.getNextCPIOEntry()) != null) {
249-
providedFiles.add(RpmInformations.normalize(cpioEntry.getName()));
246+
try (CpioArchiveInputStream cpio = ris.getCpioStream()) {
247+
CpioArchiveEntry cpioEntry;
248+
while ((cpioEntry = cpio.getNextCPIOEntry()) != null) {
249+
providedFiles.add(RpmInformations.normalize(cpioEntry.getName()));
250+
}
250251
}
251-
cpio.close();
252252
}
253253

254254
// Remove provided files from the required list

0 commit comments

Comments
 (0)