From patchwork Sat Dec 7 11:50:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 8307 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Y56050SDCz3wxg for ; Sat, 7 Dec 2024 11:51:01 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y56022TtWznC; Sat, 7 Dec 2024 11:50:58 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Y56020HLlz32wS; Sat, 7 Dec 2024 11:50:58 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Y55zy1DqBz2xbk for ; Sat, 7 Dec 2024 11:50:54 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "michael.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y55zx59hyznC; Sat, 7 Dec 2024 11:50:53 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4Y55zx3jw0zThvG; Sat, 7 Dec 2024 11:50:53 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH] Config: Don't interpret file names as regular expressions Date: Sat, 7 Dec 2024 11:50:51 +0000 Message-Id: <20241207115051.3730583-1-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Message-ID-Hash: HTVGRI46OT5IHG6FU6X5E4GIB4JZB3KS X-Message-ID-Hash: HTVGRI46OT5IHG6FU6X5E4GIB4JZB3KS X-MailFrom: root@michael.haj.ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Michael Tremer X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Adolf Belka --- lfs/Config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lfs/Config b/lfs/Config index 1a59ebe1e..8547f69c6 100644 --- a/lfs/Config +++ b/lfs/Config @@ -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; \