[pve-devel] [PATCH xtermjs 1/4] change from submodule to tgz download and update to 3.2.0

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Apr 11 11:18:32 CEST 2018


On Tue, Apr 10, 2018 at 02:16:57PM +0200, Dominik Csapak wrote:
> since xtermjs does not ship the built version anymore in git
> (starting with 3.0.0), we change it so that we have a download
> target where we download the tarball from npm
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  .gitmodules     |  3 ---
>  Makefile        | 23 ++++++++++++++++-------
>  src/www/main.js |  1 +
>  xtermjs         |  1 -
>  4 files changed, 17 insertions(+), 11 deletions(-)
>  delete mode 160000 xtermjs
> 
> diff --git a/.gitmodules b/.gitmodules
> index a22f66b..e69de29 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -1,3 +0,0 @@
> -[submodule "xtermjs"]
> -	path = xtermjs
> -	url = ../mirror_xterm.js
> diff --git a/Makefile b/Makefile
> index f16e464..fafa9b3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,6 +1,14 @@
>  include defines.mk
>  
> -XTERMJSDIR=xtermjs
> +XTERMJSVER=3.2.0
> +XTERMJSTGZ=xterm-${XTERMJSVER}.tgz
> +XTERMJSDIR=package
> +XTERMDATA = \
> +	   ${XTERMJSDIR}/dist/xterm.js     \
> +	   ${XTERMJSDIR}/dist/xterm.js.map \
> +	   ${XTERMJSDIR}/dist/xterm.css    \
> +	   ${XTERMJSDIR}/dist/addons/fit/fit.js
> +
>  SRCDIR=src
>  
>  ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
> @@ -13,7 +21,7 @@ all: ${DEB}
>  
>  .PHONY: deb
>  deb: ${DEB}
> -${DEB}: | submodule
> +${DEB}: ${XTERMDATA}
>  	rm -rf ${SRCDIR}.tmp
>  	cp -rpa ${SRCDIR} ${SRCDIR}.tmp
>  	cp -a debian ${SRCDIR}.tmp/
> @@ -23,13 +31,14 @@ ${DEB}: | submodule
>  	lintian ${DEB}
>  	@echo ${DEB}
>  
> -.PHONY: submodule
> -submodule:
> -	test -f "${XTERMJSDIR}/README.md" || git submodule update --init
> +${XTERMDATA}: ${XTERMJSTGZ}

This is not -j compatible, either put only 1 element in XTERMDATA or
split it in one main component depending on the rest of it.

> +	rm -rf ${XTTERMDIR}
> +	tar -xf ${XTERMJSTGZ}
>  
>  .PHONY: download
>  download ${SRCDIR}:
> -	git submodule foreach 'git pull --ff-only origin master'
> +	wget https://registry.npmjs.org/xterm/-/${XTERMJSTGZ} -O ${XTERMJSTGZ}.tmp
> +	mv ${XTERMJSTGZ}.tmp ${XTERMJSTGZ}
>  
>  .PHONY: upload
>  upload: ${DEB}
> @@ -40,7 +49,7 @@ distclean: clean
>  
>  .PHONY: clean
>  clean:
> -	rm -rf *~ debian/*~ *_${ARCH}.deb ${SRCDIR}.tmp *_all.deb *.changes *.dsc *.buildinfo
> +	rm -rf *~ debian/*~ *_${ARCH}.deb ${SRCDIR}.tmp ${XTERMJSDIR} *_all.deb *.changes *.dsc *.buildinfo
>  
>  .PHONY: dinstall
>  dinstall: deb
> diff --git a/src/www/main.js b/src/www/main.js
> index 62ec1c1..4aa856c 100644
> --- a/src/www/main.js
> +++ b/src/www/main.js
> @@ -65,6 +65,7 @@ function updateState(newState, msg) {
>  
>  var terminalContainer = document.getElementById('terminal-container');
>  document.getElementById('status_bar').addEventListener('click', hideMsg);
> +Terminal.applyAddon(fit);
>  
>  createTerminal();
>  
> diff --git a/xtermjs b/xtermjs
> deleted file mode 160000
> index ea07bf8..0000000
> --- a/xtermjs
> +++ /dev/null
> @@ -1 +0,0 @@
> -Subproject commit ea07bf8f694a6e9714779b19c174e26162c39196
> -- 
> 2.11.0




More information about the pve-devel mailing list