On 30/08/12 20:57, Sale, Devin M wrote:
Hi,

In the base_libs.spec there's this little bit of perl code.

# remove absolute paths from text search files (if they exist)
perl -w -e '
     @ARGV = grep { `file $_` =~ m,ASCII C program text, } @ARGV;
     exit(0) unless @ARGV;
     $^I = ".bak";
     while(<>) {
         s,[\S/]+/,,g if m,^GROUP,;
         print;
     }
     ' $RPM_BUILD_ROOT/%{pfx}/lib/libc.so \
       $RPM_BUILD_ROOT/%{pfx}/lib/libpthread.so \
       $RPM_BUILD_ROOT/%{pfx}/usr/lib/libc.so \
       $RPM_BUILD_ROOT/%{pfx}/usr/lib/libpthread.so

which does what the comment says and leaves a libc.so.bak and lipthread.so.bak 
in the rootfs.

When moving LTIB from Ubuntu 10.04 to 12.04 the *.bak files go away because the 
file utility changed like this:
On 10.04:
dzq92s@ubuntu:~$ file libc.so.bak
libc.so.bak: ASCII C program text

On 12.04:
dzq92s:~$ file libc.so
libc.so: ASCII English text


Why remove the absolute paths?

What is the ramification of not doing this?

Should the *.bak files be left in the rootfs?



Hi Devin,

I can't remember exactly why you need to remove the absolute paths (I wrote this at least 5 years ago), but you do. I think it was so that you can re-locate the libraries to not be in /usr/lib, but without my notes I can't be sure. Just thought of one more; another reason is that we copy (not build) the C library from the cross compiler. If this was not build in a standard way (standard prefix), the paths in these files will be incorrect.

The *.bak files are left so you can see what was there before the change, and a change was made. You can remove them if you like, but they do no harm.

Regards, Stuart




_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/ltib

Reply via email to