The Build-Tools script creates some files like install,
cp, mv and ln in build/*/tools.*/wrapper.
This directory is added to the begin of the PATH environment variable in the
parse-config script and so this programs are used instead of the standard
tools when one of this commands is used during the build.
This wrapper files are just symbolic links to the install_wrapper
program which is modifying the parameter list based on the
INSTALL_WRAPPER_FILTER variable and then running the original
program from the standard bin directories.
The INSTALL_WRAPPER_FILTER variable is initialized to an empty text
in scripts/parse-config and can be extended in the package, target,
architecture or misc parse-config files and the package
*.conf file using the var_append and var_insert functions.
The INSTALL_WRAPPER_FILTER variable must contain a shell command
which is reading the destination filenames for install and the other
commands from input and writing the new filenames to the output. Multiple
commands might be concatenated using the pipe character.
So, e.g. if a package installs a usr/share/man/man1/ls.1 (which creates a
shared-file conflict with coreutils), it's possible to add something like
var_append INSTALL_WRAPPER_FILTER "|" \
'sed "s,share/man/man1/ls.1\$,share/man/man1/ls_x.1,"'
to the package *.conf file and the file will be installed using the
new name ls_x.1.
Use this wrapper with care! It's possible to break a lot with it
because all install, cp, mv and ln
commands during the build are wrapped with it - not only those executed
in make install.
The install wrapper is writing a log file containing the old and new
parameter lists so it's easier do debug problems. This log file is named
src.*/install_wrapper.log (or in chroot builds
src.*/R.src/install_wrapper.log). You might want to run
Build-Pkg with the option noclearsrc if you want
the log file (and the entire src.* directory) be kept for debugging
reasons.
The source code for the install wrapper shell script can be found at
misc/tools-source/install_wrapper.sh.
|