From d478f6b6bcda546a0e31206cabc248a92721ab82 Mon Sep 17 00:00:00 2001 From: anki-code Date: Sun, 16 Feb 2020 19:44:51 +0300 Subject: [PATCH 1/7] bump version --- xonssh_xxh/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xonssh_xxh/settings.py b/xonssh_xxh/settings.py index aa1dd6e..cb83edd 100644 --- a/xonssh_xxh/settings.py +++ b/xonssh_xxh/settings.py @@ -1,7 +1,7 @@ import sys global_settings = { - 'XXH_VERSION': '0.2.7' + 'XXH_VERSION': '0.3.0' } if __name__ == "__main__": From 54521f3b6f551b4b2b69d9fada3b9836d724cea0 Mon Sep 17 00:00:00 2001 From: anki-code Date: Sun, 16 Feb 2020 21:06:58 +0300 Subject: [PATCH 2/7] remove README.plugins.md --- README.plugins.md | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 README.plugins.md diff --git a/README.plugins.md b/README.plugins.md deleted file mode 100644 index 7dcf0d7..0000000 --- a/README.plugins.md +++ /dev/null @@ -1,29 +0,0 @@ -**xxh plugin** — is the set of files which will be run when xonsh will be installed or started though xxh. - -## xxh plugins list - -[Search xxh plugins on Github](https://github.com/search?q=xxh-plugin&type=Repositories) - -Pinned plugins: - -* [Pipe Liner](https://github.com/xonssh/xxh-plugin-pipe-liner) -* [Bar Theme](https://github.com/xonssh/xxh-plugin-theme-bar) -* [Autojump](https://github.com/xonssh/xxh-plugin-autojump) - -## Install xxh plugin - -To install xxh plugin just place the plugin directory to the `plugins` in xxh home path. Example: -``` -cd ~/.xxh/plugins/ -git clone --depth 1 https://github.com/xonssh/xxh-plugin-theme-bar -``` -Then run: -``` -xxh -``` - -## Create xxh plugin - -To create xxh plugin you can create `your_plugin` directory in `~/.xxh/plugins/your_plugin` (by default) on your home host with files: -* `install.xsh` will be executed once after xxh installation on the host -* `xonshrc.xsh` will be executed every time you'll be connect via xxh to the host From 6b3846ab6e24fcedcdaa840361cc7bcc696b168c Mon Sep 17 00:00:00 2001 From: anki-code Date: Sun, 16 Feb 2020 23:42:06 +0300 Subject: [PATCH 3/7] wip --- xxh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/xxh b/xxh index 8f8b3e4..8d21c53 100755 --- a/xxh +++ b/xxh @@ -246,7 +246,7 @@ if opt.install: eprint(f'Method "{opt.method}" is not supported now') if opt.install_force: - eprint(f'Before upload xxh remove host directory {host}:{host_xxh_home}') + eprint(f'Remove host xxh home {host}:{host_xxh_home}') echo @(f"rm -rf {host_xxh_home}/*") | ssh @(ssh_v) @(ssh_arguments) @(host) -T "bash -s" eprint(f"Install xxh to {host}:{host_xxh_home}" ) @@ -269,16 +269,18 @@ if opt.install: plugins_fullpath = os.path.join(local_xxh_home_path, 'plugins') if os.path.exists(plugins_fullpath): - eprint(f'Run plugins post install on {host}') - scripts='' - for script in sorted(glob.glob(os.path.join(plugins_fullpath, os.path.join('*','post_install.xsh')), recursive=True)): - scripts += " && %s -i --rc %s -- %s" % (host_xonsh_bin, host_xonshrc, script.replace(local_xxh_home_path + os.sep, '')) - eprint(f' * {script}') + plugin_post_installs = sorted(glob.glob(os.path.join(plugins_fullpath, os.path.join('*', 'post_install.xsh')), recursive=True)) + if len(plugin_post_installs) > 0: + eprint(f'Run plugins post install on {host}') + scripts='' + for script in plugin_post_installs: + scripts += " && %s -i --rc %s -- %s" % (host_xonsh_bin, host_xonshrc, script.replace(local_xxh_home_path + os.sep, '')) + eprint(f' * {script}') - if scripts: - echo @(f"cd {host_xxh_home} {scripts}" ) | ssh @(ssh_v) @(ssh_arguments) @(host) -T "bash -s" 1>&2 + if scripts: + echo @(f"cd {host_xxh_home} {scripts}" ) | ssh @(ssh_v) @(ssh_arguments) @(host) -T "bash -s" 1>&2 - eprint('Check xonsh') + eprint(f'Check {opt.method}') host_settings_file = os.path.join(host_xxh_home, 'settings.py') check = $(ssh @(ssh_v) @(ssh_arguments) @(host) -t @(host_xonsh_bin) --no-script-cache -i --rc @(host_xonshrc) -- @(host_settings_file) ) @@ -286,7 +288,7 @@ if opt.install: eprint(f'Check xonsh result:\n{check}') if check == '' or 'AppImages require FUSE to run' in check: - eprint('Check failed. Unpack AppImage...') + eprint('AppImage is not supported by host. Trying to unpack and run...') host_xonsh_bin_new = os.path.join(host_xxh_home, 'xonsh-squashfs/usr/python/bin/xonsh') ssh @(ssh_v) @(ssh_arguments) @(host) -t @(f"cd {host_xxh_home} && ./{xonsh_bin_name} --appimage-extract | grep -E 'usr/python/bin/xonsh$' && mv squashfs-root xonsh-squashfs && mv {host_xonsh_bin} {host_xonsh_bin}-disabled && ln -s {host_xonsh_bin_new}") 1>&2 host_xonsh_bin = host_xonsh_bin_new From a71d80b54dd4e79c16a26f365965c083a6354194 Mon Sep 17 00:00:00 2001 From: anki-code Date: Sun, 16 Feb 2020 23:53:37 +0300 Subject: [PATCH 4/7] wip --- xonssh_xxh/host_info.sh | 1 - xonssh_xxh/xxh_plugins_rc.xsh | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 xonssh_xxh/xxh_plugins_rc.xsh diff --git a/xonssh_xxh/host_info.sh b/xonssh_xxh/host_info.sh index 294e91c..9b38e41 100644 --- a/xonssh_xxh/host_info.sh +++ b/xonssh_xxh/host_info.sh @@ -17,7 +17,6 @@ echo xxh_version=$xxh_version echo xxh_home_writable=`[ -w $xxh_home_realpath ] && echo "1" ||echo "0"` echo xxh_parent_home_writable=`[ -w $(dirname $xxh_home_realpath) ] && echo "1" ||echo "0"` echo xxh_home_freespace=`[ -d $xxh_home_realpath ] && df -k --output=avail $xxh_home_realpath | tail -n1` -echo xxh_plugins_rc=`[ -d $xxh_plugins_path ] && find $xxh_plugins_path | grep xonshrc.xsh` echo bash=`command -v bash` echo rsync=`command -v rsync` diff --git a/xonssh_xxh/xxh_plugins_rc.xsh b/xonssh_xxh/xxh_plugins_rc.xsh deleted file mode 100644 index 542cd77..0000000 --- a/xonssh_xxh/xxh_plugins_rc.xsh +++ /dev/null @@ -1,9 +0,0 @@ -import os, glob - -import_path = os.path.join($XXH_HOME, 'plugins') -xonshrc_plugins_rc=[] -for rc in sorted(glob.glob(os.path.join(import_path, '*/xonshrc.xsh'))): - xonshrc_plugins_rc.append(rc) - -# Prefix `xxh-plugins: ` is needed to workaround some cases when ssh write warnings to stdout and return before this -print(f"xxh-plugins# {' '.join(xonshrc_plugins_rc)}") From 88a5edb11fe6d06b8acbcb24ce0a411f3a3b54b6 Mon Sep 17 00:00:00 2001 From: anki-code Date: Mon, 17 Feb 2020 00:00:25 +0300 Subject: [PATCH 5/7] wip --- xonssh_xxh/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xonssh_xxh/settings.py b/xonssh_xxh/settings.py index cb83edd..7f712f4 100644 --- a/xonssh_xxh/settings.py +++ b/xonssh_xxh/settings.py @@ -1,7 +1,7 @@ import sys global_settings = { - 'XXH_VERSION': '0.3.0' + 'XXH_VERSION': '0.2.9' } if __name__ == "__main__": From a294d5eae4544379c6062bcde7aca04eaa7608ee Mon Sep 17 00:00:00 2001 From: anki-code Date: Mon, 17 Feb 2020 00:03:03 +0300 Subject: [PATCH 6/7] wip --- xonssh_xxh/host_info.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/xonssh_xxh/host_info.sh b/xonssh_xxh/host_info.sh index 9b38e41..a649393 100644 --- a/xonssh_xxh/host_info.sh +++ b/xonssh_xxh/host_info.sh @@ -16,8 +16,5 @@ echo xxh_home_realpath=$xxh_home_realpath echo xxh_version=$xxh_version echo xxh_home_writable=`[ -w $xxh_home_realpath ] && echo "1" ||echo "0"` echo xxh_parent_home_writable=`[ -w $(dirname $xxh_home_realpath) ] && echo "1" ||echo "0"` -echo xxh_home_freespace=`[ -d $xxh_home_realpath ] && df -k --output=avail $xxh_home_realpath | tail -n1` - -echo bash=`command -v bash` echo rsync=`command -v rsync` echo scp=`command -v scp` From 123935d85cfcfb326522c8fdddc7abf946f50de8 Mon Sep 17 00:00:00 2001 From: anki-code Date: Mon, 17 Feb 2020 00:05:39 +0300 Subject: [PATCH 7/7] wip --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8e79e43..9b907ae 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ xxh arguments: The xxh xonsh will use pip and python from `xonsh.AppImage` by default. You can install pip packages ordinally with `pip install`. They will appear in `$XXH_HOME/pip`. -## How it works? +### How it works? When you run `xxh ` command: @@ -104,13 +104,13 @@ When you run `xxh ` command: ## Development Use [xxh-tests](https://github.com/xonssh/xxh-tests) environment for development and contribution. -## Known Issues +### Known Issues -### GLIBs versions +#### GLIBs versions Current method to make xonsh portable is using an [AppImage](https://appimage.org/) which was built on [manylinux2010 (PEP 571)](https://github.com/niess/linuxdeploy-plugin-python/issues/12). In case you see the error like ``/xonsh-x86_64.AppImage: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.25 not found (required by /ppp/xonsh-x86_64.AppImage)`` this means you should rebuild the AppImage for older version of linux distributive. Try [linuxdeploy-plugin-python](https://github.com/niess/linuxdeploy-plugin-python/). -### WSL1: ^Z +#### WSL1: ^Z ``` # xxh YT-1300 @@ -121,7 +121,7 @@ This issue was addressed to Xonsh team in [3367](https://github.com/xonsh/xonsh/ WSL2 is not tested yet. -### Related issues +#### Related issues What will make xxh more universal and stable in the future: * [AppImages run on Alpine](https://github.com/AppImage/AppImageKit/issues/1015)