def clean(self, deep=False): log.info('Cleaning sourcedir %s', self.path) sh_line = ('source "%s";' % BASE_SH_SCRIPT + 'cd "%s";' % self._sourcedir + 'rm -f .bpt_status;' + 'source bpt-rules;' + 'bpt_clean;') if deep: sh_line += 'bpt_deepclean;' exitstatus, outtext = getstatusoutput("bash -e -c '%s'" % sh_line) assert exitstatus == 0, (exitstatus, outtext)
def get_var(self, var, can_be_empty=False): # XXX(ot) find a better way to do this sh_line = "cd %s;" % self._sourcedir + "source bpt-rules;" + "echo ${%s};" % var exitstatus, outtext = getstatusoutput("bash -e -c '%s'" % sh_line) assert exitstatus == 0, (exitstatus, outtext) outtext = outtext.strip() if outtext == "" and not can_be_empty: raise Exception("No variable %s" % var) return outtext
def get_var(self, var, can_be_empty=False): # XXX(ot) find a better way to do this sh_line = ('cd %s;' % self._sourcedir + 'source bpt-rules;' + 'echo ${%s};' % var) exitstatus, outtext = getstatusoutput("bash -e -c '%s'" % sh_line) assert exitstatus == 0, (exitstatus, outtext) outtext = outtext.strip() if outtext == '' and not can_be_empty: raise Exception('No variable %s' % var) return outtext
def clean(self, deep=False): log.info('Cleaning sourcedir %s', self.path) sh_line = ('source "%s";' % BASE_SH_SCRIPT + 'cd "%s";' % self._sourcedir + 'rm -f .bpt_status;' + 'source bpt-rules;' + 'bpt_clean;' ) if deep: sh_line += 'bpt_deepclean;' exitstatus, outtext = getstatusoutput("bash -e -c '%s'" % sh_line) assert exitstatus == 0, (exitstatus, outtext)