Beispiel #1
0
 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)
Beispiel #2
0
    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
Beispiel #3
0
    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
Beispiel #4
0
Datei: build.py Projekt: ot/bpt
 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)