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

elf-deps: Make single quotes and backslashes optional #4

Open
stephen-fox opened this issue Jan 20, 2024 · 0 comments
Open

elf-deps: Make single quotes and backslashes optional #4

stephen-fox opened this issue Jan 20, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@stephen-fox
Copy link
Collaborator

stephen-fox commented Jan 20, 2024

When parsing an ELF with -R, oki includes single quotes and backslashes in the output to help write shell scripts. For example:

$ oki -R rizin
-u 'r:/usr/local/lib/librz_util.so.0.7' \
-u 'r:/usr/lib/libm.so.10.1' \
-u 'r:/usr/lib/libutil.so.17.0' \
(...)

It would be nice if we could make this behavior optional so it does this instead:

$ oki -R rizin
-u r:/usr/local/lib/librz_util.so.0.7
-u r:/usr/lib/libm.so.10.1
-u r:/usr/lib/libutil.so.17.0
(...)

The latter format makes it easier to create shared config files that can be used in multiple shell scripts. For example:

#!/bin/sh

set -u

work_dir="${OKI_WORKDIR:-${HOME}/memla}"

oki \
  -p stdio \
  (...)
  -u rwc:/tmp \
  -u r:/usr/libexec/ld.so \
  -u r:/usr/lib \
  -u r:/usr/lib/libc.so.97.0 \
  $(/bin/cat /tmp/rules-example.txt) \
  -- rizin $@

... where /tmp/rules-example.txt contains:

-u r:/usr/local/lib/librz_util.so.0.7
-u r:/usr/lib/libm.so.10.1
-u r:/usr/lib/libutil.so.17.0
(...)

Perhaps this can even be the default behavior and the current behavior can be optional?

@stephen-fox stephen-fox added the enhancement New feature or request label Jan 20, 2024
@stephen-fox stephen-fox added this to the v0.0.2 milestone Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant