Skip to content

Commit

Permalink
Fix empty purge_list.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Jan 1, 2020
1 parent 9993a51 commit 6542a91
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 24 deletions.
5 changes: 3 additions & 2 deletions docker/android-ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ main() {
--arch $arch \
--api $api

# clean up
apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

popd
popd
Expand Down
5 changes: 3 additions & 2 deletions docker/android-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ EOF

echo "127.0.0.1 localhost" > /system/etc/hosts

# clean up
apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

popd

Expand Down
4 changes: 3 additions & 1 deletion docker/cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ main() {
# clean up
popd

apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

rm -rf $td
rm $0
Expand Down
4 changes: 3 additions & 1 deletion docker/dragonfly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ EOF
# clean up
popd

apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

rm -rf $td
rm $0
Expand Down
5 changes: 3 additions & 2 deletions docker/dropbear.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ main() {
make -j$(nproc) PROGRAMS=dbclient
cp dbclient /usr/local/bin/

# Clean up
apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

popd

Expand Down
5 changes: 3 additions & 2 deletions docker/emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ main() {
chmod a+rw -R /emsdk-portable/
find /emsdk-portable/ -executable -print0 | xargs -0 chmod a+x

# Clean up
apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

rm $0
}
Expand Down
4 changes: 3 additions & 1 deletion docker/freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ main() {
# clean up
popd

apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

rm -rf $td
rm $0
Expand Down
6 changes: 5 additions & 1 deletion docker/linux-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ EOF
# can fail if arch is used (amd64 and/or i386)
dpkg --remove-architecture $arch || true
apt-get update
apt-get purge --auto-remove -y ${purge_list[@]}

if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

ls -lh /qemu
}

Expand Down
10 changes: 5 additions & 5 deletions docker/mingw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ main() {
$(apt-cache showsrc gcc-mingw-w64-i686 | grep Build | cut -d: -f2 | tr , '\n' | cut -d' ' -f2 | sort | uniq)
)

apt-get update
local purge_list=()
for dep in ${dependencies[@]}; do
if ! dpkg -L $dep > /dev/null; then
apt-get install -y --no-install-recommends $dep
purge_list+=( $dep )
fi
done

apt-get update
apt-get install -y --no-install-recommends ${purge_list[@]}

pushd $td

apt-get source gcc-mingw-w64-i686
Expand Down Expand Up @@ -118,8 +117,9 @@ EOF
# Replace installed mingw packages with the new ones
dpkg -i ../g*-mingw-w64-i686*.deb ../gcc-mingw-w64-base*.deb

# Clean up
apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

popd

Expand Down
5 changes: 3 additions & 2 deletions docker/musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ main() {
OUTPUT=/usr/local/ \
"$@"

# clean up
apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

popd

Expand Down
4 changes: 3 additions & 1 deletion docker/netbsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ main() {
# clean up
popd

apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

rm -rf $td
rm $0
Expand Down
5 changes: 3 additions & 2 deletions docker/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ main() {
# in /usr/bin. Create an appropriate symlink
ln -s /usr/local/bin/qemu-$arch /usr/bin/qemu-$arch-static

# Clean up
apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

popd

Expand Down
4 changes: 3 additions & 1 deletion docker/solaris.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ EOF
# clean up
popd

apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

rm -rf $td
rm $0
Expand Down
5 changes: 4 additions & 1 deletion docker/xargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ main() {

rm -r "${RUSTUP_HOME}" "${CARGO_HOME}"

apt-get purge --auto-remove -y ${purge_list[@]}
if (( ${#purge_list[@]} )); then
apt-get purge --auto-remove -y ${purge_list[@]}
fi

rm $0
}

Expand Down

0 comments on commit 6542a91

Please sign in to comment.