You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by wy...@apache.org on 2026/10/23 03:59:40 UTC

(maka) 05/07: build: allow form-feed pages in license texts

This is an automated email from the ASF dual-hosted git repository.

M4n5ter pushed a commit to branch rust-preview
in repository https://gitbox.apache.org/repos/asf/maka.git

commit 7ea3624b231073ace371738b7429e083ad419fb2
Author: M4n5ter <m4...@gmail.com>
AuthorDate: Fri Oct 23 11:52:46 2026 +0800

    build: allow form-feed pages in license texts
---
 scripts/asf-source-release.mjs      |  2 +-
 scripts/asf-source-release.test.mjs | 29 +++++++++++++++++++++--------
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/scripts/asf-source-release.mjs b/scripts/asf-source-release.mjs
index 3b9dc0aeb1..1024e8da5a 100644
--- a/scripts/asf-source-release.mjs
+++ b/scripts/asf-source-release.mjs
@@ -644,7 +644,7 @@ function validateNonTextInputs(candidateRoot, identity, entries) {
       const basename = entry.slice(entry.lastIndexOf('/') + 1);
       const extension = extname(basename).toLowerCase();
       if (
-        !/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/u.test(text) &&
+        !/[\u0000-\u0008\u000b\u000e-\u001f\u007f]/u.test(text) &&
         (textSourceExtensions.has(extension) || textSourceBasenames.has(basename))
       ) {
         continue;
diff --git a/scripts/asf-source-release.test.mjs b/scripts/asf-source-release.test.mjs
index bf85553ee8..e83676f9e7 100644
--- a/scripts/asf-source-release.test.mjs
+++ b/scripts/asf-source-release.test.mjs
@@ -272,7 +272,7 @@ describe('ASF source release verification', () => {
       'fixtures/shader.wgsl': '@compute @workgroup_size(1) fn main() {}\n',
       'fixtures/Cargo.toml.orig': '[package]\nname = "source"\nversion = "0.1.0"\n',
       'fixtures/CNAME': 'nsh.dev\n',
-      'fixtures/LICENSE-APACHE': 'Apache License, Version 2.0\n',
+      'fixtures/LICENSE-APACHE': 'Apache License, Version 2.0\n\f\nTERMS AND CONDITIONS\n',
       'fixtures/LICENSE-MIT': 'Permission is hereby granted, free of charge.\n',
       'fixtures/default-env': '# Presentation metadata\nLANG\n',
       'fixtures/layerfs': '#!/bin/sh\nexec python3 layerfs.py\n',
@@ -298,14 +298,27 @@ describe('ASF source release verification', () => {
   });
 
   test('rejects unknown non-text release inputs', async () => {
-    const fixture = createFixtureCandidate({ 'fixtures/unknown.bin': Buffer.from([0x01, 0x02]) });
-    try {
-      await assert.rejects(
-        () => verifySourceCandidate({ archivePath: fixture.archivePath }),
+    for (const [path, contents, expected] of [
+      [
+        'fixtures/unknown.bin',
+        Buffer.from([0x01, 0x02]),
         /Cannot safely classify non-text release input.*fixtures\/unknown\.bin/,
-      );
-    } finally {
-      fixture.cleanup();
+      ],
+      [
+        'fixtures/control.txt',
+        Buffer.from('page\u000bseparator\n'),
+        /Cannot safely classify non-text release input.*fixtures\/control\.txt/,
+      ],
+    ]) {
+      const fixture = createFixtureCandidate({ [path]: contents });
+      try {
+        await assert.rejects(
+          () => verifySourceCandidate({ archivePath: fixture.archivePath }),
+          expected,
+        );
+      } finally {
+        fixture.cleanup();
+      }
     }
   });
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org