help concerning sed command:
Can someone help me undertand what is doing the following command, it's called for building xfsdump:
------------------ sed -i -e "s:enable_curses=[a-z]*:enable_curses=$(usex ncurses):" -e "s:libcurses="[^"]*":libcurses='$(use ncurses && $(tc-getPKG_CONFIG) --libs ncurses)':" configure || die ------------------- |
The normal delimiters for search and replace are slashes, as in s/// but they can be any character as long as they are three of a kind. So here you have s::: instead.
Then you have double quotes so that means the shell is interpreting the contents before passing them on to sed. That brings you to the command substitution indicated by $( ... ) Then the logical OR operator || means that if sed fails, then die will be run. Maybe die is a function defined earlier in the script. I'm not sure at all under which conditions sed would fail. It also looks like a pair of double quotes needed to be escaped: Code:
sed -i \ |
what part is unclear?
Code:
sed is the command |
Quote:
Where it finds "libcurses=something" it replaces the "something" with the output from the command string, "use ncurses && $(tc-getPKG_CONFIG) --libs ncurses", which presumably gives the installed version of the ncurses library. |
well I tried to use it in a 'slackware' script and it doesn't recognize 'usex ncurses' and 'use ncurses'?
|
Are you sure those functions are not defined somewhere above in the configure script, or perhaps in some file sourced by the configure script? If not, then that script was apparently intended for a build environment where those commands exist. Maybe there is a README file that tells what is required.
|
Quote:
Code:
sed -i \ Code:
didier[/storage/slackware64-14.2/source/ap/xfsdump/xfsdump-3.1.6]$ diff -u configure.orig configure |
Well, I'm trying to solve the xfdsdump building in slackware-current (for Slackware From Scratch), and for the time being, I've not found a way to solve it.
So I pick ideas and patches in every distribution (gentoo, debian, fedora, archlinux...) to try to solve the problem. Thanks for you answer, I'll try to see if it solves my problem. |
Quote:
Quote:
Good luck, though. |
You're right it builds fine in stable (14.2), not in -current.
I didn't say anything else. ThanXX |
All times are GMT -5. The time now is 03:09 PM. |