Hi, thanks for your suggestions. I think that my mistake is that I didn't explain the big picture. I have a file of paths that define my tool (all the needed paths to run my tool). I want to create a Dockerfile/Podman-file/Sing-file based on those dependencies so the container will be able to run the tool inside it. I want to find all the RPM packages of those paths. For that I use:
rpm -qf --queryformat "[%{NAME}]" [path]
But this command does not give me all the packages I need. I noticed that if I use
ldd [path] to get all shared libs and then for each lib, run the above RPM command, then I'll get all the needed packages.
Now that I have explained the big picture, I'll talk about your suggestions. The
locate is a good suggestion. I'll have to combine it with the
objdump that was mentioned here. The
ldd was working pretty well, but is
objdump -p /path/to/program | grep NEEDED and then
locate (and then rpm find) is a better approach?
Now that I have explained the big picture (sorry again that it was not in the main post), is it possible to suggest a better approach? Ideally I would want the rpm command to be able to get a path and return the packages of both the path and the shared libs of the path. This way I won't have to use the
ldd command.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.