From nobody Thu Apr 9 13:31:48 2026 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98480336EF8 for ; Sun, 8 Mar 2026 11:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772968417; cv=none; b=bR5h68m5b5tcRpicV4t1SU7lD3Gtb2Jqbh2YDSGeLtC/kbdhG2jcTSRc/W1+n8+J5AXg6YbXMDDYkM9yrOVx4uiZ1R8WnTxzmIow89HS/fiOlKXJRyu4GYjY31Au0TMTTAhlKsXwz+M51wJLc4qcXIHngmX55JEqIj11GQ05kQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772968417; c=relaxed/simple; bh=rUIInd5K6kOACS1tWqup7nK+dUyf7CQRanumz9cLbow=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DIuY5gMZJP0NTzvI4c3sVjpADJcSuXnJytI6LRhEoZEMZn1ynu7O9yQ+HKvBbI3milHxFyqnEop5qanH2FZG8k/kEpj2tihIw9fMi2SQJ6+L7DnC8/67pp8tgQv9tk6287S5XAXEJKXZUk8cAIvf5YOMh70gfltuCpLEFWpfTs4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WpSJHO1J; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WpSJHO1J" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-824c9da9928so6070204b3a.3 for ; Sun, 08 Mar 2026 04:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772968416; x=1773573216; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=e9z7EGgDIs51XBH02ZmG5zUVGonDeGX7qmX1TqKhzyE=; b=WpSJHO1JrXYekFDqyC5VD72EDLcCfYjntUJEPu1mJ/RJ/37ruTJmSkxq75WJh4lieZ JsuP9N9xEx9kw3AMZirNlKuFcbeVIzgpFjign4FRx2/ECLw1FlV3uwgIG0dvOrKVoLmY ibvSpBf+YBc9V6PYWPdrO48NAvedbrpUyuSPshG1giwxzPSpALMm+DeBPY4xi1aD43lo 0LK7Hr0m1uN4Iu6Qi2A4/cbsuPXzbUSCF10B3/y/bVfsNBlE6IQYRtRQUpxtBqYg6ey6 /PVpjXpwgLURr0gO4xzuTGooAOh3auJ2EIO3mr24SP805QobLoHFhvOyX9iC9qiivAu1 eCCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772968416; x=1773573216; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=e9z7EGgDIs51XBH02ZmG5zUVGonDeGX7qmX1TqKhzyE=; b=u9sAikI6z1OC0h413FuADLLyq5LRlP9a98baxwzLPWMZoW8momeAgfWKeTV6ops5d+ Uhfo2oITs4ioW0xCjVso6gveicED7A38IwV6v9+PTX+GVJYi8WPObDJaw6Ijtc9yAKuP wG0rS60nJhJ5ghrPxOGfx3JrDDem78Bb5PB1RqzgpQ+qjGQkKDjqWdGVIFzuznkifVlp M7+gaDI4Y50vFAFi2CEr2OMmxo4gHLgni3VG5AIlaVNJoSUjT1MMfu4dDtHxIXxsSONI ZFoBqJWpAo6hr0apnGRefMYjnSkEYvJGFq8pwwqmUaOIGFfEY44Oa1kuDvFYTd5AkiQs BYSw== X-Forwarded-Encrypted: i=1; AJvYcCUlnN5XCAIF09eabDAJiqZOmkBoNgOyTMVvPgo3eRAn5Wzp00FY6/3M/qgepZbE2ysChBe3W/pZU3tPIYM=@vger.kernel.org X-Gm-Message-State: AOJu0YzUUjxvCQoBRqoAccjh0+MigrTaGfkXlrXxdfUqjB78f/9gzqjM z8b1YtF8XNHwUq8jQLYcG+fIDdKP2LWlIt1xghpg4b4dLNdPNcYY9tG0 X-Gm-Gg: ATEYQzzJQ7Nk8NpfdiNTaEpcCiTzaCCzK2sHkE9Xy0mJFhDO/2MkBxE+BRQWaADZENg Z9CIVvNB1177vA8v50R5q11KUOArAvcZci8qSZDw0a17X+duFgLmMG3vaCQtP7WhtjyXOdTxdmB 5KXTyIrf4thCL4bliBsMxMdOiND8jqcexnhRs3JwObcvPX2eFwzTjEIjEEpgXEHoVRifVgBN30L qAtJ9tOua98+151QW0dNJaN5Qspt+bLJuod6GDy1+e4ITya2aUVmMdpgqO5yuo2L0xVi6AnD7cf SyMT+wY9KRBSYOQU9uOuN2KDEZNSNC6HZ/fVqn2Ug5utVywmSe+C82cXO32VvoIwS1YB2+NvICD RXIAleKd/lUODp0Uj+xQ/QKVO4bm624OJXgcmO6Y5GBfIR980G+K1hYWOCwivVy3tSdZXKnIT4Z QIKVQKao/nMVCHi7t1rDmr7vHo26z9RNiNEJzGjt4F X-Received: by 2002:a05:6a00:7444:b0:827:3c74:e6a6 with SMTP id d2e1a72fcca58-829a30b9fd6mr5378887b3a.58.1772968415956; Sun, 08 Mar 2026 04:13:35 -0700 (PDT) Received: from russ.ust.hk (wf121-083.ust.hk. [175.159.121.83]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829a46369d3sm6923755b3a.2.2026.03.08.04.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Mar 2026 04:13:35 -0700 (PDT) From: Haoyang LIU To: Dongliang Mu , Yanteng Si , Alex Shi , Jonathan Corbet , Shuah Khan , Mauro Carvalho Chehab , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: Haoyang LIU , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] tools/docs/checktransupdate.py: add support for scanning directory Date: Sun, 8 Mar 2026 19:13:13 +0800 Message-ID: <20260308111314.27333-1-tttturtleruss@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Origin script can only accept a file as parameter, this commit enables it to scan a directory. Usage example: ./scripts/checktransupdate.py Documentation/translations/zh_CN/dev-tools And it will output something like: """ [1772967203.351603] Documentation/translations/zh_CN/dev-tools/kmemleak.rst [1772967205.074201] commit 7591c127f3b1 ("kmemleak: iommu/iova: fix transie= nt kmemleak false positive") [1772967205.074337] 1 commits needs resolving in total [1772967205.301705] Documentation/translations/zh_CN/dev-tools/index.rst [1772967206.912395] commit a592a36e4937 ("Documentation: use a source-read = extension for the index link boilerplate") [1772967206.921424] commit 6eac13c87680 ("Documentation: dev-tools: add con= tainer.rst page") [1772967206.930220] commit 8f32441d7a53 ("Documentation: Add documentation = for Compiler-Based Context Analysis") [1772967206.939002] commit 1e9ddbb2cd34 ("docs: Pull LKMM documentation int= o dev-tools book") [1772967206.948636] commit d5af79c05e93 ("Documentation: move dev-tools deb= ugging files to process/debugging/") [1772967206.957562] commit d5dc95836147 ("kbuild: Add Propeller configurati= on for kernel build") [1772967206.966255] commit 315ad8780a12 ("kbuild: Add AutoFDO support for C= lang build") [1772967206.966410] 7 commits needs resolving in total """ Signed-off-by: Haoyang LIU --- tools/docs/checktransupdate.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/docs/checktransupdate.py b/tools/docs/checktransupdate.py index bf735562aeeb..b0bc61f958cf 100755 --- a/tools/docs/checktransupdate.py +++ b/tools/docs/checktransupdate.py @@ -13,6 +13,8 @@ The usage is as follows: This will print all the files that need to be updated or translated in the= zh_CN locale. - tools/docs/checktransupdate.py Documentation/translations/zh_CN/dev-tool= s/testing-overview.rst This will only print the status of the specified file. +- tools/docs/checktransupdate.py Documentation/translations/zh_CN/dev-tools +This will print the status of all files under the directory. =20 The output is something like: Documentation/dev-tools/kfence.rst @@ -262,7 +264,7 @@ def main(): help=3D'Set the logging file (default: checktransupdate.log)') =20 parser.add_argument( - "files", nargs=3D"*", help=3D"Files to check, if not specified, ch= eck all files" + "files", nargs=3D"*", help=3D"Files or directories to check, if no= t specified, check all files" ) args =3D parser.parse_args() =20 @@ -293,6 +295,17 @@ def main(): if args.print_missing_translations: logging.info(os.path.relpath(os.path.abspath(file), li= nux_path)) logging.info("No translation in the locale of %s\n", a= rgs.locale) + else: + # check if the files are directories or files + new_files =3D [] + for file in files: + if os.path.isfile(file): + new_files.append(file) + elif os.path.isdir(file): + # for directories, list all files in the directory and its= subfolders + new_files.extend(list_files_with_excluding_folders( + file, [], "rst")) + files =3D new_files =20 files =3D list(map(lambda x: os.path.relpath(os.path.abspath(x), linux= _path), files)) =20 --=20 2.53.0