scripts/kernel-doc.py: properly handle KBUILD_BUILD_TIMESTAMP

The logic that handles KBUILD_BUILD_TIMESTAMP is wrong, and adds
a dependency of a third party module (dateutil).

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/ffc70a1b741b010365ed82f31611018f24f91ce7.1744106242.git.mchehab+huawei@kernel.org
This commit is contained in:
Mauro Carvalho Chehab
2025-04-08 18:09:29 +08:00
committed by Jonathan Corbet
parent 2ab867a494
commit 91d00bd54f
2 changed files with 21 additions and 16 deletions

View File

@@ -13,9 +13,6 @@ import logging
import os
import re
import sys
from datetime import datetime
from dateutil import tz
from kdoc_parser import KernelDoc
from kdoc_output import OutputFormat
@@ -137,12 +134,6 @@ class KernelFiles():
if out_style is None:
out_style = OutputFormat()
dt = datetime.now()
if os.environ.get("KBUILD_BUILD_TIMESTAMP", None):
# use UTC TZ
to_zone = tz.gettz('UTC')
dt = dt.astimezone(to_zone)
if not werror:
kcflags = os.environ.get("KCFLAGS", None)
if kcflags: