before this change, install.sh errors out if openjdk-11 is not installed, because dpkg -L and rpm -ql fail if the package being queried is not installed at all. but this is not the behavior by design, we want to continue searching for openjdk-8, and fall back to /usr/bin/java.
so, in this change, we check if the specified package is installed before listing its content.
before this change,
install.sh
errors out if openjdk-11 is not installed, becausedpkg -L
andrpm -ql
fail if the package being queried is not installed at all. but this is not the behavior by design, we want to continue searching for openjdk-8, and fall back to /usr/bin/java.so, in this change, we check if the specified package is installed before listing its content.
this problem was surfaced by https://github.com/scylladb/scylladb/issues/13414, but the issue should be fixed by installing openjdk-11 first.
Refs https://github.com/scylladb/scylladb/issues/13414 Signed-off-by: Kefu Chai kefu.chai@scylladb.com