From 2676b09af2af7d8fe9da2a3ef476feaffee58e68 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Tue, 18 Apr 2023 11:20:43 +0800 Subject: [PATCH 1/2] Init --- Dockerfile | 2 +- scripts/release/debian/build.sh | 1 + scripts/release/rpm/azure-cli.spec | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 108d55b8bdb..37374bba5aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ COPY . /azure-cli # 1. Build packages and store in tmp dir # 2. Install the cli and the other command modules that weren't included -RUN ./scripts/install_full.sh \ +RUN ./scripts/install_full.sh && python ./scripts/trim_sdk.py \ && cat /azure-cli/az.completion > ~/.bashrc \ && runDeps="$( \ scanelf --needed --nobanner --recursive /usr/local \ diff --git a/scripts/release/debian/build.sh b/scripts/release/debian/build.sh index 0141ee89e07..f6471251312 100755 --- a/scripts/release/debian/build.sh +++ b/scripts/release/debian/build.sh @@ -52,6 +52,7 @@ export PATH=$PATH:$WORKDIR/python_env/bin find ${WORKDIR}/src/ -name setup.py -type f | xargs -I {} dirname {} | grep -v azure-cli-testsdk | xargs pip3 install --no-deps pip3 install -r ${WORKDIR}/src/azure-cli/requirements.py3.$(uname).txt +$WORKDIR/python_env/bin/python3 ${WORKDIR}/scripts/trim_sdk.py # Create create directory for debian build mkdir -p $WORKDIR/debian diff --git a/scripts/release/rpm/azure-cli.spec b/scripts/release/rpm/azure-cli.spec index b97be2b0a8a..12b6856ce83 100644 --- a/scripts/release/rpm/azure-cli.spec +++ b/scripts/release/rpm/azure-cli.spec @@ -52,6 +52,9 @@ source %{repo_path}/scripts/install_full.sh # cffi 1.15.0 doesn't work with RPM: https://foss.heptapod.net/pypy/cffi/-/issues/513 %{python_cmd} -m pip install cffi==1.14.6 +# Remove unused SDK version +%{python_cmd} %{repo_path}/scripts/trim_sdk.py + deactivate # Fix up %{buildroot} appearing in some files... From 80506cff72382bde40bbb0c19cf07dc7175cc1ee Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Tue, 18 Apr 2023 14:41:47 +0800 Subject: [PATCH 2/2] Minor fix --- scripts/release/rpm/azure-cli.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/release/rpm/azure-cli.spec b/scripts/release/rpm/azure-cli.spec index 12b6856ce83..e63f58f7be6 100644 --- a/scripts/release/rpm/azure-cli.spec +++ b/scripts/release/rpm/azure-cli.spec @@ -48,13 +48,12 @@ A great cloud needs great tools; we're excited to introduce Azure CLI, source %{buildroot}%{cli_lib_dir}/bin/activate %{python_cmd} -m pip install --upgrade pip setuptools source %{repo_path}/scripts/install_full.sh +# Remove unused SDK version +%{python_cmd} %{repo_path}/scripts/trim_sdk.py # cffi 1.15.0 doesn't work with RPM: https://foss.heptapod.net/pypy/cffi/-/issues/513 %{python_cmd} -m pip install cffi==1.14.6 -# Remove unused SDK version -%{python_cmd} %{repo_path}/scripts/trim_sdk.py - deactivate # Fix up %{buildroot} appearing in some files...