Bug 105461 - man: Suggest using shell function from make to process pkg-config output correctly.
Summary: man: Suggest using shell function from make to process pkg-config output corr...
Status: RESOLVED MOVED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pkg-config
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-12 16:13 UTC by Tomasz
Modified: 2018-08-25 12:55 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
[PATCH] man: Use shell function from make to process pkg-config (1.52 KB, patch)
2018-03-12 16:13 UTC, Tomasz
Details | Splinter Review
[PATCH] man: Use shell function from make to process pkg-config (1.54 KB, patch)
2018-03-12 16:17 UTC, Tomasz
Details | Splinter Review

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.