Skip to content

Commit 9230c2a

Browse files
author
Andy Herrick
committed
8253747: tools/jpackage/share/AppImagePackageTest.java fails with InstalledPackageSize: 0
Reviewed-by: almatvee, prr
1 parent cfd41c0 commit 9230c2a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LinuxHelper.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,17 @@ static long getInstalledPackageSizeKB(JPackageCommand cmd) {
229229
final Path packageFile = cmd.outputBundle();
230230
switch (cmd.packageType()) {
231231
case LINUX_DEB:
232-
return Long.parseLong(getDebBundleProperty(packageFile,
232+
Long estimate = Long.parseLong(getDebBundleProperty(packageFile,
233233
"Installed-Size"));
234+
if (estimate == 0L) {
235+
// if the estimate in KB is 0, check if it is really empty
236+
// or just < 1KB as with AppImagePackageTest.testEmpty()
237+
if (getPackageFiles(cmd).count() > 01L) {
238+
// there is something there so round up to 1 KB
239+
estimate = 01L;
240+
}
241+
}
242+
return estimate;
234243

235244
case LINUX_RPM:
236245
String size = getRpmBundleProperty(packageFile, "Size");

0 commit comments

Comments
 (0)