From 6cc58e3701216044890bb2059d2597afc9c5de66 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 16 Apr 2026 12:48:59 +0000 Subject: [PATCH] Use git -C with xargs --- Telegram/build/docker/centos_env/Dockerfile | 7 ++----- Telegram/build/prepare/prepare.py | 11 ++++------- snap/snapcraft.yaml | 7 ++----- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index 83053377f9..69f05ce7a5 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -747,11 +747,8 @@ ENV QT=6.11.0 RUN git clone -b v$QT --depth=1 https://github.com/qt/qt5.git \ && cd qt5 \ && git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qtshadertools \ - && cd qtbase \ - && find ../../patches/qtbase_$QT -type f -print0 | sort -z | xargs -r0 git apply \ - && cd ../qtwayland \ - && find ../../patches/qtwayland_$QT -type f -print0 | sort -z | xargs -r0 git apply \ - && cd .. \ + && find $PWD/../patches/qtbase_$QT -type f -print0 | sort -z | xargs -r0 git -C qtbase apply \ + && find $PWD/../patches/qtwayland_$QT -type f -print0 | sort -z | xargs -r0 git -C qtwayland apply \ && cmake -B build . \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DBUILD_SHARED_LIBS=OFF \ diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py index f1810e80c1..d32ba029bd 100644 --- a/Telegram/build/prepare/prepare.py +++ b/Telegram/build/prepare/prepare.py @@ -1495,8 +1495,8 @@ release: cd qt_$QT git submodule update --init --recursive --progress qtbase qtimageformats qtsvg depends:patches/qtbase_""" + qt + """/*.patch - cd qtbase win: + cd qtbase setlocal enabledelayedexpansion for /r %%i in (..\\..\\patches\\qtbase_%QT%\\*) do ( git apply %%i -v @@ -1505,7 +1505,6 @@ win: exit /b 1 ) ) - cd .. SET CONFIGURATIONS=-debug @@ -1555,8 +1554,7 @@ win: jom -j%NUMBER_OF_PROCESSORS% jom -j%NUMBER_OF_PROCESSORS% install mac: - find ../../patches/qtbase_$QT -type f -print0 | sort -z | xargs -0 git apply - cd .. + find ../../patches/qtbase_$QT -type f -print0 | sort -z | xargs -0 git -C qtbase apply CONFIGURATIONS=-debug release: @@ -1588,10 +1586,8 @@ else: # qt > '6' cd qt_$QT git submodule update --init --recursive --progress qtbase qtimageformats qtsvg depends:patches/qtbase_""" + qt + """/*.patch - cd qtbase mac: - find ../../patches/qtbase_$QT -type f -print0 | sort -z | xargs -0 git apply -v - cd .. + find $PWD/../patches/qtbase_$QT -type f -print0 | sort -z | xargs -0 git -C qtbase apply -v sed -i.bak 's/tqtc-//' {qtimageformats,qtsvg}/dependencies.yaml CONFIGURATIONS=-debug @@ -1618,6 +1614,7 @@ mac: cmake --build . cmake --install . win: + cd qtbase for /r %%i in (..\\..\\patches\\qtbase_%QT%\\*) do git apply %%i -v cd .. diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 90422fd6ef..aae2b552f4 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -411,11 +411,8 @@ parts: override-pull: | craftctl default QT="$(grep 'set(QT_REPO_MODULE_VERSION' qtbase/.cmake.conf | sed -r 's/.*"(.*)".*/\1/')" - cd qtbase - find $CRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply - cd ../qtwayland - find $CRAFT_STAGE/patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply - cd .. + find $CRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git -C qtbase apply + find $CRAFT_STAGE/patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git -C qtwayland apply prime: [-./*] after: - mozjpeg