From 56bc8be04b384cfdc847194ea964a330aaa33cc4 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 9 Sep 2015 09:24:04 -0400 Subject: [PATCH] when the tgz is less than 1, remove it. It needs to get rebuilt Signed-off-by: Alfredo Deza --- ceph-build/build/setup_pbuilder | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ceph-build/build/setup_pbuilder b/ceph-build/build/setup_pbuilder index 138d7b71..77a8a630 100755 --- a/ceph-build/build/setup_pbuilder +++ b/ceph-build/build/setup_pbuilder @@ -42,11 +42,16 @@ fi # again pbuild_tar="$basedir/$DIST.tgz" is_not_tar=`python -c "exec 'try: import tarfile;print int(not int(tarfile.is_tarfile(\"$pbuild_tar\")))\nexcept IOError: print 1'"` +file_size_kb=`du -k "$pbuild_tar" | cut -f1` if $is_not_tar; then rm -f "$pbuild_tar/$DIST.tgz" fi +if [ $file_size_kb -lt 1 ]; then + sudo rm -f "$pbuild_tar" +fi + sudo pbuilder --clean if [ -e $basedir/$DIST.tgz ]; then -- 2.39.5