build-all: use datetime instead of date executable

This commit is contained in:
Andrej730
2026-09-01 16:00:02 +05:00
parent 7c685942b2
commit 1477fd2bc0
+5 -8
View File
@@ -126,7 +126,7 @@ import textwrap
import threading import threading
import time import time
from collections.abc import Generator, Sequence from collections.abc import Generator, Sequence
from datetime import datetime from datetime import date, datetime
from pathlib import Path from pathlib import Path
from typing import Literal, NamedTuple, TypeAlias from typing import Literal, NamedTuple, TypeAlias
from urllib.request import urlretrieve from urllib.request import urlretrieve
@@ -188,7 +188,6 @@ cplusplus = "c++"
autoconf = "autoconf" autoconf = "autoconf"
automake = "automake" automake = "automake"
make = "make" make = "make"
date = "date"
strip = "strip" strip = "strip"
xz = "xz" # Used implicitly for `tar -xf *.tar.xz`. xz = "xz" # Used implicitly for `tar -xf *.tar.xz`.
brew = "brew" brew = "brew"
@@ -606,12 +605,10 @@ download_tool_git = "git"
# Create log directory and file # Create log directory and file
log_dir = os.path.join(DEPS_DIR, "logs") log_dir = Path(DEPS_DIR) / "logs"
if not os.path.exists(log_dir): log_dir.mkdir(parents=True, exist_ok=True)
os.makedirs(log_dir) LOG_FILE = log_dir / f"{date.today().strftime('%Y%m%d')}.log"
LOG_FILE = os.path.join(log_dir, sp.check_output([date, "+%Y%m%d"], encoding="utf-8").strip()) + ".log" LOG_FILE.touch(exist_ok=True)
if not os.path.exists(LOG_FILE):
open(LOG_FILE, "w").close()
logger.info(f"using command log file '{LOG_FILE}'") logger.info(f"using command log file '{LOG_FILE}'")
# Causing havoc in python 3.11 build # Causing havoc in python 3.11 build