]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
when the tgz is less than 1, remove it. It needs to get rebuilt
authorAlfredo Deza <adeza@redhat.com>
Wed, 9 Sep 2015 13:24:04 +0000 (09:24 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 9 Sep 2015 13:24:04 +0000 (09:24 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-build/build/setup_pbuilder

index 138d7b7124317c8943c1870d57e0f5005e8e8c1c..77a8a63092abb903f5c87f3baa6aca2138445c06 100755 (executable)
@@ -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