8232024: Don't pollute log output with multiple errors of the same type

Reviewed-by: almatvee, herrick
This commit is contained in:
Alexey Semenyuk 2020-10-23 18:36:31 +00:00
parent 185c8bcf8a
commit cf821b0bd3
4 changed files with 24 additions and 15 deletions

View File

@ -79,17 +79,24 @@ abstract class LinuxPackageBundler extends AbstractBundler {
}
}
withFindNeededPackages = LibProvidersLookup.supported();
if (!withFindNeededPackages) {
final String advice;
if ("deb".equals(getID())) {
advice = "message.deb-ldd-not-available.advice";
} else {
advice = "message.rpm-ldd-not-available.advice";
if (!isDefault()) {
withFindNeededPackages = false;
Log.verbose(MessageFormat.format(I18N.getString(
"message.not-default-bundler-no-dependencies-lookup"),
getName()));
} else {
withFindNeededPackages = LibProvidersLookup.supported();
if (!withFindNeededPackages) {
final String advice;
if ("deb".equals(getID())) {
advice = "message.deb-ldd-not-available.advice";
} else {
advice = "message.rpm-ldd-not-available.advice";
}
// Let user know package dependencies will not be generated.
Log.error(String.format("%s\n%s", I18N.getString(
"message.ldd-not-available"), I18N.getString(advice)));
}
// Let user know package dependencies will not be generated.
Log.error(String.format("%s\n%s", I18N.getString(
"message.ldd-not-available"), I18N.getString(advice)));
}
// Packaging specific validation
@ -192,7 +199,6 @@ abstract class LinuxPackageBundler extends AbstractBundler {
neededLibPackages = Collections.emptyList();
if (!Files.exists(thePackage.sourceRoot())) {
Log.info(I18N.getString("warning.foreign-app-image"));
}
}

View File

@ -62,6 +62,7 @@ message.deb-ldd-not-available.advice=Install "libc-bin" DEB package to get ldd.
message.rpm-ldd-not-available.advice=Install "glibc-common" RPM package to get ldd.
warning.foreign-app-image=Warning: app-image dir not generated by jpackage.
message.not-default-bundler-no-dependencies-lookup={0} is not the default package type. Package dependencies will not be generated.
error.unexpected-package-property=Expected value of "{0}" property is [{1}]. Actual value in output package is [{2}]. Looks like custom "{3}" file from resource directory contained hard coded value of "{0}" property
error.unexpected-package-property.advice=Use [{0}] pattern string instead of hard coded value [{1}] of {2} property in custom "{3}" file

View File

@ -40,8 +40,6 @@ resource.menu-shortcut-descriptor=\u30E1\u30CB\u30E5\u30FC\u30FB\u30B7\u30E7\u30
resource.menu-icon=\u30E1\u30CB\u30E5\u30FC\u30FB\u30A2\u30A4\u30B3\u30F3
resource.rpm-spec-file=RPM\u4ED5\u69D8\u30D5\u30A1\u30A4\u30EB
warning.foreign-app-image=Warning: app-image dir not generated by jpackage.
error.tool-not-found.advice=\u5FC5\u8981\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044
error.tool-old-version.advice=\u5FC5\u8981\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044
@ -63,6 +61,9 @@ message.ldd-not-available=ldd\u30B3\u30DE\u30F3\u30C9\u304C\u898B\u3064\u304B\u3
message.deb-ldd-not-available.advice="libc-bin" DEB\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066ldd\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002
message.rpm-ldd-not-available.advice="glibc-common" RPM\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066ldd\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002
warning.foreign-app-image=Warning: app-image dir not generated by jpackage.
message.not-default-bundler-no-dependencies-lookup={0} is not the default package type. Package dependencies will not be generated.
error.unexpected-package-property="{0}"\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u5FC5\u8981\u306A\u5024\u306F[{1}]\u3067\u3059\u3002\u51FA\u529B\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u5B9F\u969B\u306E\u5024\u306F[{2}]\u3067\u3059\u3002\u30EA\u30BD\u30FC\u30B9\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AB\u30B9\u30BF\u30E0"{3}"\u30D5\u30A1\u30A4\u30EB\u306B\u306F\u3001"{0}"\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u30CF\u30FC\u30C9\u30B3\u30FC\u30C9\u3055\u308C\u305F\u5024\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u3088\u3046\u3067\u3059
error.unexpected-package-property.advice=\u30AB\u30B9\u30BF\u30E0"{3}"\u30D5\u30A1\u30A4\u30EB\u3067{2}\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u30CF\u30FC\u30C9\u30B3\u30FC\u30C9\u3055\u308C\u305F\u5024[{1}]\u3067\u306F\u306A\u304F\u3001[{0}]\u30D1\u30BF\u30FC\u30F3\u6587\u5B57\u5217\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044
error.unexpected-default-package-property.advice=\u30AB\u30B9\u30BF\u30E0"{1}"\u30D5\u30A1\u30A4\u30EB\u3067{0}\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5024\u3092\u660E\u793A\u7684\u306B\u8A2D\u5B9A\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044

View File

@ -40,8 +40,6 @@ resource.menu-shortcut-descriptor=\u83DC\u5355\u5FEB\u6377\u65B9\u5F0F\u63CF\u8F
resource.menu-icon=\u83DC\u5355\u56FE\u6807
resource.rpm-spec-file=RPM \u89C4\u8303\u6587\u4EF6
warning.foreign-app-image=Warning: app-image dir not generated by jpackage.
error.tool-not-found.advice=\u8BF7\u5B89\u88C5\u6240\u9700\u7684\u7A0B\u5E8F\u5305
error.tool-old-version.advice=\u8BF7\u5B89\u88C5\u6240\u9700\u7684\u7A0B\u5E8F\u5305
@ -63,6 +61,9 @@ message.ldd-not-available=\u672A\u627E\u5230 ldd \u547D\u4EE4\u3002\u5C06\u4E0D\
message.deb-ldd-not-available.advice=\u5B89\u88C5 "libc-bin" DEB \u7A0B\u5E8F\u5305\u4EE5\u83B7\u53D6 ldd\u3002
message.rpm-ldd-not-available.advice=\u5B89\u88C5 "glibc-common" RPM \u7A0B\u5E8F\u5305\u4EE5\u83B7\u53D6 ldd\u3002
warning.foreign-app-image=Warning: app-image dir not generated by jpackage.
message.not-default-bundler-no-dependencies-lookup={0} is not the default package type. Package dependencies will not be generated.
error.unexpected-package-property="{0}" \u5C5E\u6027\u7684\u9884\u671F\u503C\u4E3A [{1}]\u3002\u8F93\u51FA\u7A0B\u5E8F\u5305\u4E2D\u7684\u5B9E\u9645\u503C\u4E3A [{2}]\u3002\u4E0E\u5B9A\u5236\u7684 "{3}" \u6587\u4EF6\u76F8\u4F3C\uFF0C\u8BE5\u6587\u4EF6\u6240\u5728\u7684\u8D44\u6E90\u76EE\u5F55\u4E2D\u5305\u542B "{0}" \u5C5E\u6027\u7684\u786C\u7F16\u7801\u503C
error.unexpected-package-property.advice=\u5728\u5B9A\u5236\u7684 "{3}" \u6587\u4EF6\u4E2D\u4F7F\u7528 [{0}] \u6A21\u5F0F\u5B57\u7B26\u4E32\uFF0C\u800C\u975E {2} \u5C5E\u6027\u7684\u786C\u7F16\u7801\u503C [{1}]
error.unexpected-default-package-property.advice=\u8BF7\u52FF\u5728\u5B9A\u5236\u7684 "{1}" \u6587\u4EF6\u4E2D\u663E\u5F0F\u8BBE\u7F6E {0} \u5C5E\u6027\u7684\u503C