This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 586ed007925 SOLR-17490: Check for existence of perl executable and
skip if it doesnt exist (#2753)
586ed007925 is described below
commit 586ed007925cfb3a52f791fa1e3facc1b75fe397
Author: Eric Pugh <[email protected]>
AuthorDate: Sat Nov 16 08:04:03 2024 -0500
SOLR-17490: Check for existence of perl executable and skip if it doesnt
exist (#2753)
---
gradle/documentation/changes-to-html.gradle | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/gradle/documentation/changes-to-html.gradle
b/gradle/documentation/changes-to-html.gradle
index 3b4ca69bf9d..af9d1b5fa9a 100644
--- a/gradle/documentation/changes-to-html.gradle
+++ b/gradle/documentation/changes-to-html.gradle
@@ -76,6 +76,13 @@ class ChangesToHtmlTask extends DefaultTask {
def toHtml(File versionsFile) {
def output = new ByteArrayOutputStream()
+
+ // Check if the perl executable exists
+ if (!perlExists()) {
+ logger.warn("WARNING: Perl is not installed, skipping creating
Changes.html")
+ return
+ }
+
def result = project.exec {
executable project.externalTool("perl")
standardInput changesFile.newInputStream()
@@ -114,4 +121,14 @@ class ChangesToHtmlTask extends DefaultTask {
throw new GradleException("Changes file ${changesFile} or Doap file
${changesDoapFile} not found.")
}
}
+
+ def perlExists() {
+ try {
+ def process = "perl -v".execute()
+ process.waitFor()
+ return process.exitValue() == 0
+ } catch (Exception e) {
+ return false
+ }
+ }
}