Would it be correct to assume you have access to the filesystem where these files are located? In other words, the Perl script, the input list of files, and the files themselves are all on the same machine?
Yes.
It's also still unclear to me if you want to mirror the files exactly as they are on the host machine, or if you want to manipulate the paths in any way?
Exactly the same.
Anyway, your code is exactly what I need, especially the first part ("gather all dirs, files, and links"). It's a good start. I have only one question for now. For that I will use the example I presented in the first post:
I have a path: /usr/vsa/pkgs/python3/3.6.3a/bin/python3.6. There are two links in the path:
/usr/vsa -> /root/site/tools/gauv
/usr/vsa/pkgs/python3/3.6.3a -> 3.6.3
With your code I get three links:
ln -snf /root/site/tools/gauv /usr/vsa
ln -snf 3.6.3 /usr/vsa/pkgs/python3/3.6.3a
ln -snf 3.6.3 /root/site/tools/gauv/pkgs/python3/3.6.3a
For the second link I get an error:
ln: failed to create symbolic link '/usr/vsa/pkgs/python3/3.6.3a': No
+such file or directory which is correct
Which makes sense since '/usr/vsa/pkgs/python3/3.6.3a' is not a realpath (even though I can access this path since it has a link on the way). Uncommenting this line works to build the recipe since this link is unnecessary because the third one is the correct one (it does what the second one wants to do). How can I "ignore"/"remove" those kind of links from %links?
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.