public inbox for [email protected]  
help / color / mirror / Atom feed
Patch for yum.js
2+ messages / 2 participants
[nested] [flat]

* Patch for yum.js
@ 2025-06-02 16:59 Devrim Gündüz <[email protected]>
  2025-06-02 18:11 ` Re: Patch for yum.js Jonathan S. Katz <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Devrim Gündüz @ 2025-06-02 16:59 UTC (permalink / raw)
  To: pgsql-www <[email protected]>


Hi,

Attached is a patch for yum.js which is supposed to do the following:

* Remove mention of Oracle Linux. We don't test and/or support it.
* Remove RHEL 7 specific code.

I am not a js expert, so wanted to get a review before committing it.

Thanks!

Regards, 
-- 
Devrim Gündüz
Open Source Solution Architect, PostgreSQL Major Contributor
BlueSky: @devrim.gunduz.org , @gunduz.org


Attachments:

  [text/x-patch] pgweb-download-js.patch (1.2K, ../../[email protected]/2-pgweb-download-js.patch)
  download | inline diff:
diff --git a/templates/downloads/js/yum.js b/templates/downloads/js/yum.js
index ddcff2fd..7fcdf467 100644
--- a/templates/downloads/js/yum.js
+++ b/templates/downloads/js/yum.js
@@ -7,10 +7,7 @@ function sortNumeric(a,b) {
 
 function get_platform_name(plat, ver) {
     if (plat == 'EL') {
-        if (parseFloat(ver) <= 7)
-	    return "Red Hat Enterprise, CentOS, Scientific or Oracle";
-        else
-	    return "Red Hat Enterprise, Rocky, AlmaLinux or Oracle";
+	    return "Red Hat Enterprise, Rocky, or AlmaLinux";
     }
     else if (plat == 'F')
 	return "Fedora";
@@ -28,12 +25,8 @@ function get_rpm_prefix(plat) {
 function get_installer(plat) {
     if (plat.startsWith('F-'))
 	return 'dnf';
-    else if (plat.startsWith('EL-')) {
-	var a = plat.split('-');
-	if (a[1] >= 8)
-	    return 'dnf';
-    }
-    return 'yum';
+    else if (plat.startsWith('EL-'))
+        return 'dnf';
 }
 
 function disable_module_on(plat) {
@@ -46,11 +39,7 @@ function disable_module_on(plat) {
 }
 
 function uses_systemd(plat) {
-    if (plat.startsWith('EL-')) {
-	var a = plat.split('-');
-	if (a[1] < 7)
-	    return false;
-    }
+    if (plat.startsWith('EL-'))
     return true;
 }
 


  [application/pgp-signature] signature.asc (858B, ../../[email protected]/3-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Patch for yum.js
  2025-06-02 16:59 Patch for yum.js Devrim Gündüz <[email protected]>
@ 2025-06-02 18:11 ` Jonathan S. Katz <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Jonathan S. Katz @ 2025-06-02 18:11 UTC (permalink / raw)
  To: Devrim Gündüz <[email protected]>; pgsql-www <[email protected]>

On 6/2/25 12:59 PM, Devrim Gündüz wrote:
> 
> Hi,
> 
> Attached is a patch for yum.js which is supposed to do the following:
> 
> * Remove mention of Oracle Linux. We don't test and/or support it.
> * Remove RHEL 7 specific code.
> 
> I am not a js expert, so wanted to get a review before committing it.
> 
> Thanks!

Here's an untested modification of the patch; a couple of changes:

1. It seems like "get_installer" now should always return "dnf" (we may 
need to check how it's being called, which I didn't do, since now this 
function doesn't have any logic).

2. For "uses_systemd" I used a shorthand given we're just checking to 
see if the platform starts with "EL-". This also will guarantee it 
returns true or false.

I'm unsure if this captures the intent what you want, but wanted to 
propose it.

Thanks,

Jonathan

diff --git a/templates/downloads/js/yum.js b/templates/downloads/js/yum.js
index ddcff2f..f2388c7 100644
--- a/templates/downloads/js/yum.js
+++ b/templates/downloads/js/yum.js
@@ -7,10 +7,7 @@ function sortNumeric(a,b) {
 
 function get_platform_name(plat, ver) {
     if (plat == 'EL') {
-        if (parseFloat(ver) <= 7)
-	    return "Red Hat Enterprise, CentOS, Scientific or Oracle";
-        else
-	    return "Red Hat Enterprise, Rocky, AlmaLinux or Oracle";
+	    return "Red Hat Enterprise, Rocky, or AlmaLinux";
     }
     else if (plat == 'F')
 	return "Fedora";
@@ -26,14 +23,7 @@ function get_rpm_prefix(plat) {
 }
 
 function get_installer(plat) {
-    if (plat.startsWith('F-'))
-	return 'dnf';
-    else if (plat.startsWith('EL-')) {
-	var a = plat.split('-');
-	if (a[1] >= 8)
-	    return 'dnf';
-    }
-    return 'yum';
+    return 'dnf';
 }
 
 function disable_module_on(plat) {
@@ -46,12 +36,7 @@ function disable_module_on(plat) {
 }
 
 function uses_systemd(plat) {
-    if (plat.startsWith('EL-')) {
-	var a = plat.split('-');
-	if (a[1] < 7)
-	    return false;
-    }
-    return true;
+    return plat.startsWith('EL-');
 }
 
 function get_platform_text(p) {


Attachments:

  [text/plain] pgweb-download-js-v2.patch (1.2K, ../../[email protected]/2-pgweb-download-js-v2.patch)
  download | inline diff:
diff --git a/templates/downloads/js/yum.js b/templates/downloads/js/yum.js
index ddcff2f..f2388c7 100644
--- a/templates/downloads/js/yum.js
+++ b/templates/downloads/js/yum.js
@@ -7,10 +7,7 @@ function sortNumeric(a,b) {
 
 function get_platform_name(plat, ver) {
     if (plat == 'EL') {
-        if (parseFloat(ver) <= 7)
-	    return "Red Hat Enterprise, CentOS, Scientific or Oracle";
-        else
-	    return "Red Hat Enterprise, Rocky, AlmaLinux or Oracle";
+	    return "Red Hat Enterprise, Rocky, or AlmaLinux";
     }
     else if (plat == 'F')
 	return "Fedora";
@@ -26,14 +23,7 @@ function get_rpm_prefix(plat) {
 }
 
 function get_installer(plat) {
-    if (plat.startsWith('F-'))
-	return 'dnf';
-    else if (plat.startsWith('EL-')) {
-	var a = plat.split('-');
-	if (a[1] >= 8)
-	    return 'dnf';
-    }
-    return 'yum';
+    return 'dnf';
 }
 
 function disable_module_on(plat) {
@@ -46,12 +36,7 @@ function disable_module_on(plat) {
 }
 
 function uses_systemd(plat) {
-    if (plat.startsWith('EL-')) {
-	var a = plat.split('-');
-	if (a[1] < 7)
-	    return false;
-    }
-    return true;
+    return plat.startsWith('EL-');
 }
 
 function get_platform_text(p) {


  [application/pgp-signature] OpenPGP_signature.asc (840B, ../../[email protected]/3-OpenPGP_signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-06-02 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-06-02 16:59 Patch for yum.js Devrim Gündüz <[email protected]>
2025-06-02 18:11 ` Jonathan S. Katz <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox