xxh / xxh-plugin-fish-fisher

Fisher xxh-plugin
BSD 2-Clause "Simplified" License
9 stars 2 forks source link

Replace `cpio` #2

Closed frederickjh closed 4 years ago

frederickjh commented 4 years ago

Although cpio works with find to copy files into directory structures that do not exist and need created, in early testing it has been missing on some server and has also produced errors.

Try to replace cpio in the code with something like this:

mkdir -p /foo/bar && cp myfile "$_"
frederickjh commented 4 years ago

In pull request #1 the following error was reported:

1. Looks like `cpio` is a risk to get an error on remote host:
ufish@start ~> xxh -i id_rsa root@ubuntu_kf +s fish +if
...
Remove ubuntu_kf:/root/.xxh/.xxh
First time upload using rsync (this will be omitted on the next connections)
First run xxh-shell-fish on ubuntu_kf

~/.xxh/shells/xxh-shell-fish/build/../../../plugins/xxh-plugin-fish-fisher/build/pluginrc.fish (line 16): 
  find ".config/" -depth -print | cpio --quiet -pd  "$XXH_XDG_CONFIG_HOME" &>/dev/null
                                  ^
from sourcing file ~/.xxh/shells/xxh-shell-fish/build/../../../plugins/xxh-plugin-fish-fisher/build/pluginrc.fish
        called on line 14 of file ~/.xxh/shells/xxh-shell-fish/build/xxh-config.fish
from sourcing file ~/.xxh/shells/xxh-shell-fish/build/xxh-config.fish

Welcome to fish, the friendly interactive shell
Type `help` for instructions on how to use fish
root@ubuntu_kf ~# 

@anki-code If you have time to troubleshoot this on that host you could change the code to get more debug output. I probably should change the code to allow this to be easier to debug.

Change

find ".config/" -depth -print | cpio --quiet -pd  "$XXH_XDG_CONFIG_HOME" &>/dev/null

to

find ".config/" -depth -print | cpio  -pvd  "$XXH_XDG_CONFIG_HOME" &>/dev/null

So remove --quiet and add the -v option for verbose output. The output from that should give us a better idea what is going on.

anki-code commented 4 years ago

cpio just missed on host.

frederickjh commented 4 years ago

:+1: Good to know then replacing cpio in the code will fix this. Otherwise if I need to stay with cpio I should add a check for it and error out if it is not found with a useful error message.

frederickjh commented 4 years ago

@anki-code Just found a host where cpio is not installed. This will make this easier for me to troubleshoot and work on a fix for this.