RPM

Comment 1 for bug 647053

Revision history for this message
In , Joe (joe-redhat-bugs) wrote :

Description of problem:
When using a filename list for %files in a SPEC file, backslash escaping is not applied. The documentation in "/usr/share/doc/rpm-4.8.1/spec" gives the following example to generate a file list, inserting escapes for special characters:

\verbatim
        rm -f $RPM_BUILD_DIR/filelist.rpm
        echo '%defattr(-,root,root)' >> $RPM_BUILD_DIR/filelist.rpm
        find $RPM_BUILD_ROOT/%{_prefix} -type f -print | \
            sed "s!$RPM_BUILD_ROOT!!" | perl -pe 's/([?|*.\'"])/\\$1/g' \
                >> $RPM_BUILD_DIR/filelist.rpm

        %files -f filelist.rpm
\endverbatim

This does not work. The correct approach for a file list seems to be to just quote all filenames. I did not check the behavior of filenames listed directly in the %files section. It is probably best just to update the documentation.

Version-Release number of selected component (if applicable):
4.8.1