Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rmlint.sh: RMLINT_BINARY is set to '(null)' #232

Closed
hungrywolf27 opened this issue Jun 6, 2017 · 2 comments
Closed

rmlint.sh: RMLINT_BINARY is set to '(null)' #232

hungrywolf27 opened this issue Jun 6, 2017 · 2 comments
Labels

Comments

@hungrywolf27
Copy link
Contributor

Line 5 of the generated rmlint.sh:

RMLINT_BINARY='(null)'

When running rmlint.sh -p this produces the following errors:

./rmlint.sh: line 119: (null): command not found
 ^^^^^^ Error: files no longer identical - cancelling.....

Further experimentation:

running rmlint test1/ test2/ produces rmlint.sh with RMLINT_BINARY='(null)'

but running /usr/bin/rmlint test1/ test2/ produces rmlint.sh with RMLINT_BINARY='/usr/bin/rmlint'

(This is 2.6.0 compiled and installed from source according to instructions)

@sahib
Copy link
Owner

sahib commented Jun 6, 2017

Thanks for finding this.

I wrote some code that was supposed to find the full path to the own binary, but it was very simplistic and easy to break. For now it falls back to $(which rmlint) if it failed. Later on a better solution should probably use some library like binreloc. Turns out finding the path to the own binary is neither portable, nor easy.

@sahib sahib added the bug label Jun 6, 2017
@sahib
Copy link
Owner

sahib commented Jun 10, 2017

As of 0f8c139 rmlint will look at /proc/self/exe to find where it's own executable resides. This will work reliable on linux, but most likely not on other systems. There we fall back to $(which rmlint) which should work.

Maybe as an explanation why all this hassle:
The script output needs the path to rmlint for some special commands that are hard to implement otherwise. Those are especially --equal and --btrfs-clone. With the correct path we want to assure that we use a compatible rmlint version (i.e. the one that also wrote the script).

This issue can likely be closed now since the original issue was addressed.

@sahib sahib closed this as completed Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants