git: 48f1d6049ac9 - 2026Q3 - Mk/Uses/npm.mk: Always use X' for denoting BLOB data type

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Thu, 10 Sep 2026 20:54:54 UTC
The branch 2026Q3 has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=48f1d6049ac9d439f87f23ae85c5349eadfff710

commit 48f1d6049ac9d439f87f23ae85c5349eadfff710
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2026-08-13 04:43:54 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2026-09-10 20:54:27 +0000

    Mk/Uses/npm.mk: Always use X' for denoting BLOB data type
    
    SQLite's .dump always uses X' (capital X) for BLOB. So it's better we
    use X' in the code for securing reproducibility of node modules
    tarball created by pnpm.
    
    Also, conversion from x' to X' in output dump file in case x' is
    accidentally mixed in.
    
    Reported by:    pkg-fallout
    
    (cherry picked from commit f3216dad74a016485bfcf09c6acbc830129cdf86)
---
 Mk/Uses/npm.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Mk/Uses/npm.mk b/Mk/Uses/npm.mk
index 266a0eac8452..3e998efa5fbe 100644
--- a/Mk/Uses/npm.mk
+++ b/Mk/Uses/npm.mk
@@ -383,14 +383,14 @@ npm-archive-node-modules:
 		while [ $${i} -le $${total_files} ]; do \
 			real_key=`${CAT} $${tmpdir}/$${i}.key`; \
 			{ \
-				${PRINTF} "INSERT INTO package_index (key, data) VALUES ('%s', x'" "$${real_key}"; \
+				${PRINTF} "INSERT INTO package_index (key, data) VALUES ('%s', X'" "$${real_key}"; \
 				hexdump -v -e '/1 "%02x"' $${tmpdir}/$${i}.normalized.msgpack; \
 				${PRINTF} "');\n"; \
 			} | sqlite3 $${output_db}; \
 			i=$$((i + 1)); \
 		done; \
 		sqlite3 $${output_db} "REINDEX; VACUUM;"; \
-		sqlite3 $${output_db} ".dump" > $${output_db_dump}; \
+		sqlite3 $${output_db} ".dump" | ${SED} -e "s/x'/X'/" > $${output_db_dump}; \
 		${RM} -r $${input_db} $${storedir}/tmp; \
 	fi
 .        else