all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint
@ 2023-06-23  6:37 Dominik Csapak
  2023-06-23  6:37 ` [pve-devel] [PATCH eslint v2 1/1] change binary name from 'eslint' to 'pve-eslint' Dominik Csapak
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Dominik Csapak @ 2023-06-23  6:37 UTC (permalink / raw)
  To: pve-devel

from 'eslint' to 'pve-eslint' to avoid a conflict with debians 'eslint'
package which ships the same binary

to avoid breakage, pull out the eslint binary into a make variable and
use pve-eslint if it exists, and eslint otherwise

changes from v1:
* use $(ESLINT)
* use $(wildcard) make builtin to check if pve-eslint exists, use eslint as fallback
* introduce defines.mk in pmg-gui for ESLINT variable

pve-eslint:

Dominik Csapak (1):
  change binary name from 'eslint' to 'pve-eslint'

 debian/links | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

pve-manager

Dominik Csapak (1):
  try using 'pve-eslint' if it exists

 defines.mk            | 7 +++++++
 www/manager6/Makefile | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

proxmox-widget-toolkit:

Dominik Csapak (1):
  try using 'pve-eslint' if it exists

 src/Makefile   | 6 +++---
 src/defines.mk | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

pmg-gui:

Dominik Csapak (1):
  try using 'pve-eslint' if it exists

 defines.mk         | 5 +++++
 js/Makefile        | 6 ++++--
 js/mobile/Makefile | 3 ++-
 3 files changed, 11 insertions(+), 3 deletions(-)
 create mode 100644 defines.mk

proxmox-backup:

Dominik Csapak (1):
  try using 'pve-eslint' if it exists

 defines.mk   | 6 ++++++
 www/Makefile | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.30.2





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

* [pve-devel] [PATCH eslint v2 1/1] change binary name from 'eslint' to 'pve-eslint'
  2023-06-23  6:37 [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
@ 2023-06-23  6:37 ` Dominik Csapak
  2023-06-23  6:37 ` [pve-devel] [PATCH manager v2 1/1] try using 'pve-eslint' if it exists Dominik Csapak
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dominik Csapak @ 2023-06-23  6:37 UTC (permalink / raw)
  To: pve-devel

so that we don't conflict with 'eslint' package in debian, which ships
the same binary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 debian/links | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/links b/debian/links
index 99342ed..0a1546f 100644
--- a/debian/links
+++ b/debian/links
@@ -1 +1 @@
-usr/share/nodejs/pve-eslint/bin/app.js usr/bin/eslint
+usr/share/nodejs/pve-eslint/bin/app.js usr/bin/pve-eslint
-- 
2.30.2





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

* [pve-devel] [PATCH manager v2 1/1] try using 'pve-eslint' if it exists
  2023-06-23  6:37 [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
  2023-06-23  6:37 ` [pve-devel] [PATCH eslint v2 1/1] change binary name from 'eslint' to 'pve-eslint' Dominik Csapak
@ 2023-06-23  6:37 ` Dominik Csapak
  2023-06-23  6:37 ` [pve-devel] [PATCH widget-toolkit " Dominik Csapak
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dominik Csapak @ 2023-06-23  6:37 UTC (permalink / raw)
  To: pve-devel

but fallback to 'eslint' otherwise

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 defines.mk            | 7 +++++++
 www/manager6/Makefile | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/defines.mk b/defines.mk
index 3a5792ad..b75671f4 100644
--- a/defines.mk
+++ b/defines.mk
@@ -19,3 +19,10 @@ WWWTOUCHDIR=${WWWBASEDIR}/touch
 WWWCSSDIR=${WWWBASEDIR}/css
 WWWFONTSDIR=${WWWBASEDIR}/css/fonts
 WWWJSDIR=${WWWBASEDIR}/js
+
+ifneq ("$(wildcard /usr/bin/pve-eslint)", "")
+    ESLINT ?= /usr/bin/pve-eslint
+else
+    ESLINT ?= /usr/bin/eslint
+endif
+
diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 2d884f4a..ff113aa2 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -314,13 +314,13 @@ WIDGETKIT=/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
 all:
 
 .lint-incremental: $(JSSRC)
-	eslint $?
+	$(ESLINT) $?
 	touch "$@"
 
 .PHONY: lint
 check: lint
 lint: $(JSSRC)
-	eslint --strict $(JSSRC)
+	$(ESLINT) --strict $(JSSRC)
 	touch ".lint-incremental"
 
 pvemanagerlib.js: .lint-incremental OnlineHelpInfo.js $(JSSRC)
-- 
2.30.2





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

* [pve-devel] [PATCH widget-toolkit v2 1/1] try using 'pve-eslint' if it exists
  2023-06-23  6:37 [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
  2023-06-23  6:37 ` [pve-devel] [PATCH eslint v2 1/1] change binary name from 'eslint' to 'pve-eslint' Dominik Csapak
  2023-06-23  6:37 ` [pve-devel] [PATCH manager v2 1/1] try using 'pve-eslint' if it exists Dominik Csapak
@ 2023-06-23  6:37 ` Dominik Csapak
  2023-06-23  6:37 ` [pve-devel] [PATCH pmg-gui " Dominik Csapak
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dominik Csapak @ 2023-06-23  6:37 UTC (permalink / raw)
  To: pve-devel

but fallback to 'eslint' otherwise

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/Makefile   | 6 +++---
 src/defines.mk | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 7cff5dd..2fca191 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -110,14 +110,14 @@ all: $(SUBDIRS)
 	set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done
 
 .lint-incremental: $(JSSRC)
-	eslint $?
+	$(ESLINT) $?
 	touch "$@"
 
 .PHONY: lint
 check: lint
-	eslint --strict api-viewer/APIViewer.js
+	$(ESLINT) --strict api-viewer/APIViewer.js
 lint: $(JSSRC)
-	eslint --strict $(JSSRC)
+	$(ESLINT) --strict $(JSSRC)
 	touch ".lint-incremental"
 
 BUILD_TIME=$(or $(SOURCE_DATE_EPOCH),$(shell date '+%s.%N'))
diff --git a/src/defines.mk b/src/defines.mk
index 36d5353..545560c 100644
--- a/src/defines.mk
+++ b/src/defines.mk
@@ -6,3 +6,9 @@ WWWBASEDIR=$(DESTDIR)/usr/share/javascript/$(PACKAGE)
 WWWCSSDIR=$(WWWBASEDIR)/css
 WWWIMAGESDIR=$(WWWBASEDIR)/images
 WWWTHEMEDIR=$(WWWBASEDIR)/themes
+
+ifneq ("$(wildcard /usr/bin/pve-eslint)", "")
+    ESLINT ?= /usr/bin/pve-eslint
+else
+    ESLINT ?= /usr/bin/eslint
+endif
-- 
2.30.2





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

* [pve-devel] [PATCH pmg-gui v2 1/1] try using 'pve-eslint' if it exists
  2023-06-23  6:37 [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
                   ` (2 preceding siblings ...)
  2023-06-23  6:37 ` [pve-devel] [PATCH widget-toolkit " Dominik Csapak
@ 2023-06-23  6:37 ` Dominik Csapak
  2023-06-23  6:37 ` [pve-devel] [PATCH proxmox-backup " Dominik Csapak
  2023-06-23  6:42 ` [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
  5 siblings, 0 replies; 7+ messages in thread
From: Dominik Csapak @ 2023-06-23  6:37 UTC (permalink / raw)
  To: pve-devel

but fallback to 'eslint' otherwise

introduce the defines.mk for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 defines.mk         | 5 +++++
 js/Makefile        | 6 ++++--
 js/mobile/Makefile | 3 ++-
 3 files changed, 11 insertions(+), 3 deletions(-)
 create mode 100644 defines.mk

diff --git a/defines.mk b/defines.mk
new file mode 100644
index 0000000..b88eef1
--- /dev/null
+++ b/defines.mk
@@ -0,0 +1,5 @@
+ifneq ("$(wildcard /usr/bin/pve-eslint)", "")
+    ESLINT ?= /usr/bin/pve-eslint
+else
+    ESLINT ?= /usr/bin/eslint
+endif
diff --git a/js/Makefile b/js/Makefile
index fad2bd6..612a185 100644
--- a/js/Makefile
+++ b/js/Makefile
@@ -1,3 +1,5 @@
+include ../defines.mk
+
 JSSRC=							\
 	Utils.js					\
 	FilterProxy.js					\
@@ -106,7 +108,7 @@ OnlineHelpInfo.js: /usr/bin/asciidoc-pmg
 	mv $@.tmp $@
 
 .lint-incremental: ${JSSRC}
-	eslint $?
+	$(ESLINT) $?
 	touch "$@"
 
 .PHONY: lint
@@ -114,7 +116,7 @@ lint: .lint-incremental
 
 .PHONY: check
 check: ${JSSRC}
-	eslint --strict ${JSSRC}
+	$(ESLINT) --strict ${JSSRC}
 	touch ".lint-incremental"
 
 pmgmanagerlib.js: OnlineHelpInfo.js ${JSSRC}
diff --git a/js/mobile/Makefile b/js/mobile/Makefile
index 3e379d2..31afab8 100644
--- a/js/mobile/Makefile
+++ b/js/mobile/Makefile
@@ -1,3 +1,4 @@
+include ../../defines.mk
 
 # caution: order is important
 MOBILESRC=				\
@@ -10,7 +11,7 @@ MOBILESRC=				\
 	  app.js			\
 
 lint: pmgmanagerlib-mobile.js
-	eslint $^
+	$(ESLINT) $^
 
 .PHONY: check
 check: lint
-- 
2.30.2





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

* [pve-devel] [PATCH proxmox-backup v2 1/1] try using 'pve-eslint' if it exists
  2023-06-23  6:37 [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
                   ` (3 preceding siblings ...)
  2023-06-23  6:37 ` [pve-devel] [PATCH pmg-gui " Dominik Csapak
@ 2023-06-23  6:37 ` Dominik Csapak
  2023-06-23  6:42 ` [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
  5 siblings, 0 replies; 7+ messages in thread
From: Dominik Csapak @ 2023-06-23  6:37 UTC (permalink / raw)
  To: pve-devel

but fallback to 'eslint' otherwise

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 defines.mk   | 6 ++++++
 www/Makefile | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/defines.mk b/defines.mk
index cd5b52a2..68e7741c 100644
--- a/defines.mk
+++ b/defines.mk
@@ -11,5 +11,11 @@ JSDIR = $(DATAROOTDIR)/javascript/proxmox-backup
 SYSCONFDIR = /etc
 ZSH_COMPL_DEST = $(PREFIX)/share/zsh/vendor-completions
 
+ifneq ("$(wildcard /usr/bin/pve-eslint)", "")
+    ESLINT ?= /usr/bin/pve-eslint
+else
+    ESLINT ?= /usr/bin/eslint
+endif
+
 # For local overrides
 -include local.mak
diff --git a/www/Makefile b/www/Makefile
index 476c80b6..2f1df442 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -133,11 +133,11 @@ js/proxmox-backup-gui.js: .lint-incremental js OnlineHelpInfo.js ${JSSRC}
 
 .PHONY: check
 check:
-	eslint --strict ${JSSRC}
+	$(ESLINT) --strict ${JSSRC}
 	touch ".lint-incremental"
 
 .lint-incremental: ${JSSRC}
-	eslint $?
+	$(ESLINT) $?
 	touch "$@"
 
 .PHONY: clean
-- 
2.30.2





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

* Re: [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint
  2023-06-23  6:37 [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
                   ` (4 preceding siblings ...)
  2023-06-23  6:37 ` [pve-devel] [PATCH proxmox-backup " Dominik Csapak
@ 2023-06-23  6:42 ` Dominik Csapak
  5 siblings, 0 replies; 7+ messages in thread
From: Dominik Csapak @ 2023-06-23  6:42 UTC (permalink / raw)
  To: pve-devel

sorry i forgot to add,

basically all patches (feel free to fixup on commit):

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>




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

end of thread, other threads:[~2023-06-23  6:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-23  6:37 [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak
2023-06-23  6:37 ` [pve-devel] [PATCH eslint v2 1/1] change binary name from 'eslint' to 'pve-eslint' Dominik Csapak
2023-06-23  6:37 ` [pve-devel] [PATCH manager v2 1/1] try using 'pve-eslint' if it exists Dominik Csapak
2023-06-23  6:37 ` [pve-devel] [PATCH widget-toolkit " Dominik Csapak
2023-06-23  6:37 ` [pve-devel] [PATCH pmg-gui " Dominik Csapak
2023-06-23  6:37 ` [pve-devel] [PATCH proxmox-backup " Dominik Csapak
2023-06-23  6:42 ` [pve-devel] [PATCH eslint/manager/wt/pmg-gui/proxmox-backup v2] change eslint Dominik Csapak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal