]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
fix invalid boolean return value for is_tarfile
authorAlfredo Deza <adeza@redhat.com>
Wed, 9 Sep 2015 13:20:41 +0000 (09:20 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 9 Sep 2015 13:20:41 +0000 (09:20 -0400)
Because `not 1` in Python will return False, not 0. By cohercing to
int again, we do get the 1 or 0 value the script is looking for

Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-build/build/setup_pbuilder

index a232c250e29b09c8263981c8a538018b12dffd89..138d7b7124317c8943c1870d57e0f5005e8e8c1c 100755 (executable)
@@ -41,7 +41,7 @@ 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'"`
+is_not_tar=`python -c "exec 'try: import tarfile;print int(not int(tarfile.is_tarfile(\"$pbuild_tar\")))\nexcept IOError: print 1'"`
 
 if $is_not_tar; then
     rm -f "$pbuild_tar/$DIST.tgz"