Bug 105461

Summary: man: Suggest using shell function from make to process pkg-config output correctly.
Product: pkg-config Reporter: Tomasz <tomasz.miasko>
Component: srcAssignee: pkg-config
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: [PATCH] man: Use shell function from make to process pkg-config
[PATCH] man: Use shell function from make to process pkg-config

Description Tomasz 2018-03-12 16:13:22 UTC
Created attachment 138029 [details] [review]
[PATCH] man: Use shell function from make to process pkg-config

pkg-config uses backslashes to escape special characters (including
spaces among others) in its --cflags and --libs output.

This is incompatible with command substitution as used in POSIX shell,
i.e., $(cmd ...) or `cmd ...`, because field splitting following such
substitution splits the result using sequences of <space>, <tab>, and
<newline> characters as separators (supposing default value of IFS).
Backslash does not have any special meaning in this process, and thus
escaping for those characters is ineffective.

Suggest using shell make function instead, which will expand the
results into the command output (converting newlines into spaces, but
not processing it further), and then when final command is executed
by POSIX shell, the shell tokenization rules will take into effect
which do respect backquotes and split input using unquoted <blank>
(<space> or <tab> in POSIX locale).
Comment 1 Tomasz 2018-03-12 16:17:12 UTC
Created attachment 138030 [details] [review]
[PATCH] man: Use shell function from make to process pkg-config

In last sentence of my previous comment backquotes should be backslash instead.
Comment 2 GitLab Migration User 2018-08-25 12:55:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/32.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.