From a0fae4d6f6cb780245eaa4e4e14d2f970fdd911d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 16 2011 16:18:51 +0000 Subject: Use return at the end of the program rather than exit and be a bit more precise in the prints --- diff --git a/r2spec/r2spec_obj.py b/r2spec/r2spec_obj.py index 2b3aa50..d2af7d3 100644 --- a/r2spec/r2spec_obj.py +++ b/r2spec/r2spec_obj.py @@ -337,7 +337,7 @@ class R2rpm(R2spec): self.spec.clean_files_section() self.spec.write_spec() - print "Building..." + print 'Building... %s' % self.pack.name self.build.build(specfile) if self.__check_build_output(): try: @@ -349,13 +349,15 @@ class R2rpm(R2spec): # Rebuild the package when build has failed the first time if self.build.outcode: # == 1 when build failed and 0 when build passed - print "Re-building..." + print 'Re-building... %s' % self.pack.name self.build.build(specfile) self.__check_build_output() except BuildDepencenciesError, err: + print 'Missing dependencies to build %s' % self.pack.name self.log.info(err) - sys.exit(1) + return 1 except BuildError, err: - self.log.info('An error occured during the build') + print 'An error occured during the build of %s' % self.pack.name self.log.debug('ERROR: %s' % err) - sys.exit(1) + return 1 + return 0