From: Alfredo Deza Date: Tue, 28 Jul 2015 17:58:22 +0000 (-0400) Subject: check if we have valid tars for pbuilder X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c4096079f1a116b9130f1c98e331a59e73ebe110;p=ceph-build.git check if we have valid tars for pbuilder Signed-off-by: Alfredo Deza --- diff --git a/ceph-build/build/setup_pbuilder b/ceph-build/build/setup_pbuilder index bb3bc30a..c58d8a3f 100755 --- a/ceph-build/build/setup_pbuilder +++ b/ceph-build/build/setup_pbuilder @@ -43,6 +43,15 @@ else othermirror="deb http://apt-mirror.sepia.ceph.com/archive.ubuntu.com/ubuntu $DIST main restricted universe multiverse" fi +# ensure that the tgz is valid, otherwise remove it so that it can be recreated +# again +pbuild_tar="$basedir/$DIST.tgz" +is_not_tar=`python -c "exec 'try: import tarfile;print not int(tarfile.is_tarfile(\"$pbuild_tar\"))\nexcept IOError: print 1'"` + +if $is_not_tar; then + rm -f "$pbuild_tar/$DIST.tgz" +fi + sudo pbuilder --clean if [ -e $basedir/$DIST.tgz ]; then