]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Config: Don't interpret file names as regular expressions
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Dec 2024 11:50:51 +0000 (11:50 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Dec 2024 12:06:30 +0000 (12:06 +0000)
When we are searching for changes in rootfiles, we walk through each
file that we have found in the build and check if it exists in the
rootfile. That check interpreted filenames as regular expressions which
caused a problem in the case of "/usr/bin/[".

This patch changes that grep will only search for an exact string match
(-F) and the string must be the entire line (-x).

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/Config

index 1a59ebe1edcf9f9d30bb8131c03e655d5eacebc0..8547f69c6372a6a7eacf3f858bcc92fe26ad03d4 100644 (file)
@@ -292,13 +292,13 @@ define POSTBUILD
                fi; \
                sed -e "s/BUILDTARGET/$(BUILDTARGET)/g" -e "s/KVER/$(KVER)/g" -e "s/xxxMACHINExxx/$(BUILD_ARCH)/g" $$ROOTFILE > $(TARGET)_rootfile; \
                while read -r line; do \
-                       if grep -qG "^#$$line$$" $(TARGET)_rootfile; then echo "#$$line" >> $(TARGET); \
-                       elif grep -qG "^$$line$$" $(TARGET)_rootfile ; then echo "$$line" >> $(TARGET); \
+                       if grep -qFx "#$$line" $(TARGET)_rootfile; then echo "#$$line" >> $(TARGET); \
+                       elif grep -qFx "$$line" $(TARGET)_rootfile ; then echo "$$line" >> $(TARGET); \
                        else echo "+$$line" >> $(TARGET); \
                        fi; \
                done < $(TARGET)_diff; \
                grep -v "^#" $(TARGET)_rootfile | while read -r line; do \
-                       if ! grep -qG "^$$line$$" $(TARGET)_diff ; then echo "-$$line" >> $(TARGET); \
+                       if ! grep -qFx "$$line" $(TARGET)_diff ; then echo "-$$line" >> $(TARGET); \
                        fi; \
                done; \
                rm -f $(TARGET)_rootfile; \