This is an automated email from the ASF dual-hosted git repository.

srowen pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/spark-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new c0f7dd2  Link to sigs on www.apache.org; provide direct link to 
release's sigs, checksums
c0f7dd2 is described below

commit c0f7dd27612d14cfd57e19bfeeecf683246ba40f
Author: Sean Owen <sean.o...@databricks.com>
AuthorDate: Sun Mar 3 09:40:37 2019 -0600

    Link to sigs on www.apache.org; provide direct link to release's sigs, 
checksums
    
    See https://issues.apache.org/jira/browse/SPARK-26274
    This also cleans up some weirdness in the JS.
    I tested it manually and all the links appear to work fine.
    
    Author: Sean Owen <sean.o...@databricks.com>
    
    Closes #184 from srowen/SPARK-26274.
---
 js/downloads.js      | 36 +++++++++++++++---------------------
 site/js/downloads.js | 36 +++++++++++++++---------------------
 2 files changed, 30 insertions(+), 42 deletions(-)

diff --git a/js/downloads.js b/js/downloads.js
index be6c29c..49ceb36 100644
--- a/js/downloads.js
+++ b/js/downloads.js
@@ -74,10 +74,8 @@ function onPackageSelect() {
 function onVersionSelect() {
   var versionSelect = document.getElementById("sparkVersionSelect");
   var packageSelect = document.getElementById("sparkPackageSelect");
-  var verifyLink = document.getElementById("sparkDownloadVerify");
 
   empty(packageSelect);
-  empty(verifyLink);
 
   var version = getSelectedValue(versionSelect);
   var packages = releases[version]["packages"];
@@ -88,10 +86,6 @@ function onVersionSelect() {
     append(packageSelect, option);
   }
 
-  var href = "https://archive.apache.org/dist/spark/spark-"; + version + "/";
-  var link = "<a href=\"" + href + "\">" + versionShort(version) + " 
signatures and checksums</a>";
-  append(verifyLink, link);
-
   // Populate releases
   updateDownloadLink(releases[version].mirrored);
 }
@@ -100,32 +94,32 @@ function updateDownloadLink(isMirrored) {
   var versionSelect = document.getElementById("sparkVersionSelect");
   var packageSelect = document.getElementById("sparkPackageSelect");
   var downloadLink = document.getElementById("spanDownloadLink");
+  var verifyLink = document.getElementById("sparkDownloadVerify");
 
   empty(downloadLink);
+  empty(verifyLink);
 
   var version = getSelectedValue(versionSelect);
   var pkg = getSelectedValue(packageSelect);
 
-  var artifactName = "spark-$ver-bin-$pkg.tgz"
-    .replace(/\$ver/g, version)
-    .replace(/\$pkg/g, pkg)
+  var artifactName = "spark-" + version + "-bin-" + pkg + ".tgz"
     .replace(/-bin-sources/, ""); // special case for source packages
 
-  var link = "";
+  var downloadHref = "";
   if (isMirrored) {
-    link = "https://www.apache.org/dyn/closer.lua/spark/spark-$ver/$artifact";;
+    downloadHref = "https://www.apache.org/dyn/closer.lua/spark/spark-"; + 
version + "/" + artifactName;
   } else {
-    link = "https://archive.apache.org/dist/spark/spark-$ver/$artifact";;
+    downloadHref = "https://archive.apache.org/dist/spark/spark-"; + version + 
"/" + artifactName;
   }
-  link = link
-    .replace(/\$ver/, version)
-    .replace(/\$artifact/, artifactName);
-  var text = link.split("/").reverse()[0];
-
+  var text = downloadHref.split("/").reverse()[0];
   var onClick =
-    "trackOutboundLink(this, 'Release Download Links', 'apache_$artifact'); 
return false;"
-    .replace(/\$artifact/, artifactName);
-
-  var contents = "<a href=\"" + link + "\" onClick=\"" + onClick + "\">" + 
text + "</a>";
+    "trackOutboundLink(this, 'Release Download Links', 'apache_" + 
artifactName + "'); return false;";
+  var contents = "<a href=\"" + downloadHref + "\" onClick=\"" + onClick + 
"\">" + text + "</a>";
   append(downloadLink, contents);
+
+  var sigHref = "https://www.apache.org/dist/spark/spark-"; + version + "/" + 
artifactName + ".asc";
+  var checksumHref = "https://www.apache.org/dist/spark/spark-"; + version + 
"/" + artifactName + ".sha512";
+  var verifyLinks = versionShort(version) + " <a href=\"" + sigHref + 
"\">signatures</a>, <a href=\"" +
+    checksumHref + "\">checksums</a>";
+  append(verifyLink, verifyLinks);
 }
diff --git a/site/js/downloads.js b/site/js/downloads.js
index be6c29c..49ceb36 100644
--- a/site/js/downloads.js
+++ b/site/js/downloads.js
@@ -74,10 +74,8 @@ function onPackageSelect() {
 function onVersionSelect() {
   var versionSelect = document.getElementById("sparkVersionSelect");
   var packageSelect = document.getElementById("sparkPackageSelect");
-  var verifyLink = document.getElementById("sparkDownloadVerify");
 
   empty(packageSelect);
-  empty(verifyLink);
 
   var version = getSelectedValue(versionSelect);
   var packages = releases[version]["packages"];
@@ -88,10 +86,6 @@ function onVersionSelect() {
     append(packageSelect, option);
   }
 
-  var href = "https://archive.apache.org/dist/spark/spark-"; + version + "/";
-  var link = "<a href=\"" + href + "\">" + versionShort(version) + " 
signatures and checksums</a>";
-  append(verifyLink, link);
-
   // Populate releases
   updateDownloadLink(releases[version].mirrored);
 }
@@ -100,32 +94,32 @@ function updateDownloadLink(isMirrored) {
   var versionSelect = document.getElementById("sparkVersionSelect");
   var packageSelect = document.getElementById("sparkPackageSelect");
   var downloadLink = document.getElementById("spanDownloadLink");
+  var verifyLink = document.getElementById("sparkDownloadVerify");
 
   empty(downloadLink);
+  empty(verifyLink);
 
   var version = getSelectedValue(versionSelect);
   var pkg = getSelectedValue(packageSelect);
 
-  var artifactName = "spark-$ver-bin-$pkg.tgz"
-    .replace(/\$ver/g, version)
-    .replace(/\$pkg/g, pkg)
+  var artifactName = "spark-" + version + "-bin-" + pkg + ".tgz"
     .replace(/-bin-sources/, ""); // special case for source packages
 
-  var link = "";
+  var downloadHref = "";
   if (isMirrored) {
-    link = "https://www.apache.org/dyn/closer.lua/spark/spark-$ver/$artifact";;
+    downloadHref = "https://www.apache.org/dyn/closer.lua/spark/spark-"; + 
version + "/" + artifactName;
   } else {
-    link = "https://archive.apache.org/dist/spark/spark-$ver/$artifact";;
+    downloadHref = "https://archive.apache.org/dist/spark/spark-"; + version + 
"/" + artifactName;
   }
-  link = link
-    .replace(/\$ver/, version)
-    .replace(/\$artifact/, artifactName);
-  var text = link.split("/").reverse()[0];
-
+  var text = downloadHref.split("/").reverse()[0];
   var onClick =
-    "trackOutboundLink(this, 'Release Download Links', 'apache_$artifact'); 
return false;"
-    .replace(/\$artifact/, artifactName);
-
-  var contents = "<a href=\"" + link + "\" onClick=\"" + onClick + "\">" + 
text + "</a>";
+    "trackOutboundLink(this, 'Release Download Links', 'apache_" + 
artifactName + "'); return false;";
+  var contents = "<a href=\"" + downloadHref + "\" onClick=\"" + onClick + 
"\">" + text + "</a>";
   append(downloadLink, contents);
+
+  var sigHref = "https://www.apache.org/dist/spark/spark-"; + version + "/" + 
artifactName + ".asc";
+  var checksumHref = "https://www.apache.org/dist/spark/spark-"; + version + 
"/" + artifactName + ".sha512";
+  var verifyLinks = versionShort(version) + " <a href=\"" + sigHref + 
"\">signatures</a>, <a href=\"" +
+    checksumHref + "\">checksums</a>";
+  append(verifyLink, verifyLinks);
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to