[PR #4139] [MERGED] makefiles: replace character class with plain char #5040

Closed
opened 2026-05-05 10:31:11 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/4139
Author: @kmk3
Created: 3/24/2021
Status: Merged
Merged: 3/24/2021
Merged by: @netblue30

Base: masterHead: makefiles-rm-cclass


📝 Commits (1)

  • 7c2ef65 makefiles: replace character class with plain char

📊 Changes

4 files changed (+4 additions, -4 deletions)

View changed files

📝 src/common.mk.in (+1 -1)
📝 src/libpostexecseccomp/Makefile.in (+1 -1)
📝 src/libtrace/Makefile.in (+1 -1)
📝 src/libtracelog/Makefile.in (+1 -1)

📄 Description

When using the "wildcard" internal functions.

This usage has been present since the first "real" commit in the
repository: commit 137985136 ("Baseline firejail 0.9.28").

H_FILE_LIST       = $(sort $(wildcard *.[h]))
C_FILE_LIST       = $(sort $(wildcard *.c))

There is only a single character (i.e.: "h") inside the character class,
so its usage should make no functional difference. It may stem from a
construct that could have originally looked something like this:

C_FILE_LIST       = $(sort $(wildcard *.[ch]))

Which would match both the implementation files and the headers.

From Section 4.4, Using Wildcard Characters in File Names of the
GNU make manual:

A single file name can specify many files using wildcard characters.
The wildcard characters in make are ‘*’, ‘?’ and ‘[…]’, the same as in
the Bourne shell. For example, *.c specifies a list of all the files
(in the working directory) whose names end in ‘.c’.

See also Section 2.13, Pattern Matching Notation of POSIX.1-2017.

Commands used to search, replace and clean up:

$ find . -name .git -prune -o -type f \
  \( -name Makefile -o -name Makefile.in \
  -o -name '*.mk' -o -name '*.mk.in' \) -print0 |
  xargs -0 grep -Fl '$(wildcard *.[h])' | tr '\n' '\000' |
  xargs -0 sed -i.bak -e \
  's/\$(wildcard \*.\[h\])/$(wildcard *.h)/'

$ find . -name .git -prune -o -type f \
  -name '*.bak' -exec rm '{}' +

Note: To make sure that this doesn't actually change anything
functionally, I built firejail-git (AUR) on Artix from master and from
this commit and diffing the resulting files produced no output (other
than showing changes related to the build timestamps).

Misc: Reference to the previous makefile-related changes: commit
2465f9248 ("makefiles: make all, clean and distclean PHONY") /
https://github.com/netblue30/firejail/pull/4024


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/4139 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 3/24/2021 **Status:** ✅ Merged **Merged:** 3/24/2021 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `makefiles-rm-cclass` --- ### 📝 Commits (1) - [`7c2ef65`](https://github.com/netblue30/firejail/commit/7c2ef659cc98959b58f0c3f33c56176da4ed2bc0) makefiles: replace character class with plain char ### 📊 Changes **4 files changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/common.mk.in` (+1 -1) 📝 `src/libpostexecseccomp/Makefile.in` (+1 -1) 📝 `src/libtrace/Makefile.in` (+1 -1) 📝 `src/libtracelog/Makefile.in` (+1 -1) </details> ### 📄 Description When using the "wildcard" internal functions. This usage has been present since the first "real" commit in the repository: commit 137985136 ("Baseline firejail 0.9.28"). > H_FILE_LIST = $(sort $(wildcard *.[h])) > C_FILE_LIST = $(sort $(wildcard *.c)) There is only a single character (i.e.: "h") inside the character class, so its usage should make no functional difference. It may stem from a construct that could have originally looked something like this: C_FILE_LIST = $(sort $(wildcard *.[ch])) Which would match both the implementation files and the headers. From Section 4.4, [Using Wildcard Characters in File Names][1] of the GNU make manual: > A single file name can specify many files using wildcard characters. > The wildcard characters in make are ‘*’, ‘?’ and ‘[…]’, the same as in > the Bourne shell. For example, *.c specifies a list of all the files > (in the working directory) whose names end in ‘.c’. See also Section 2.13, [Pattern Matching Notation][2] of POSIX.1-2017. Commands used to search, replace and clean up: $ find . -name .git -prune -o -type f \ \( -name Makefile -o -name Makefile.in \ -o -name '*.mk' -o -name '*.mk.in' \) -print0 | xargs -0 grep -Fl '$(wildcard *.[h])' | tr '\n' '\000' | xargs -0 sed -i.bak -e \ 's/\$(wildcard \*.\[h\])/$(wildcard *.h)/' $ find . -name .git -prune -o -type f \ -name '*.bak' -exec rm '{}' + Note: To make sure that this doesn't actually change anything functionally, I built firejail-git (AUR) on Artix from master and from this commit and diffing the resulting files produced no output (other than showing changes related to the build timestamps). Misc: Reference to the previous makefile-related changes: commit 2465f9248 ("makefiles: make all, clean and distclean PHONY") / https://github.com/netblue30/firejail/pull/4024 [1]: https://www.gnu.org/software/make/manual/html_node/Wildcards.html [2]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:31:11 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5040
No description provided.