]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
build_utils.sh: do not try to check non-existent file's size 1041/head
authorKefu Chai <kchai@redhat.com>
Wed, 6 Jun 2018 04:37:11 +0000 (12:37 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 6 Jun 2018 04:37:12 +0000 (12:37 +0800)
it's distracting to read the red alert in jenkins' log like

du: cannot access '/srv/debian-base/xenial.tgz': No such file or
directory

Signed-off-by: Kefu Chai <kchai@redhat.com>
scripts/build_utils.sh

index 88202424a03e1ab4c50278ce4c08a645657fe3d5..80a15e7c16626be919ef064e7058367c2c760d18 100644 (file)
@@ -404,7 +404,7 @@ setup_pbuilder() {
     # 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`
+    file_size_kb=`test -f $pbuild_tar && du -k "$pbuild_tar" | cut -f1 || echo 0`
 
     if [ "$is_not_tar" = "1" ]; then
         sudo rm -f "$pbuild_tar"