if $centos; then
for dist in ${CENTOS_DIST}; do
- sudo rm -fr build/centos/$dist
+ test -d build/centos/$dist && sudo rm -fr build/centos/$dist
mkdir -p build/centos/$dist/rpmbuild
mkdir -p build/centos/$dist/rpmbuild/BUILD
mkdir -p build/centos/$dist/rpmbuild/BUILDROOT
if test "${DEBIAN_DIST}"; then
for dist in ${DEBIAN_DIST}; do
- sudo rm -fr build/debian/$dist
+ test -f build/debian/$dist && sudo rm -fr build/debian/$dist
mkdir -p build/debian
cp -a deb-src build/debian/$dist
cp ${ID_DEB_BUILD}/in-docker.sh build/debian/$dist