Changeset dfdc129 in rtems-source-builder for source-builder/sb/options.py


Ignore:
Timestamp:
Apr 30, 2013, 1:19:09 AM (7 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
97a685f
Parents:
1c44f1c
Message:

Add user private macro loading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/options.py

    r1c44f1c rdfdc129  
    278278            for m in um:
    279279                self.defaults.load(m)
     280        # Check if the user has a private set of macros to load
     281        if 'RSB_MACROS' in os.environ:
     282            if path.exists(os.environ['RSB_MACROS']):
     283                self.defaults.load(os.environ['RSB_MACROS'])
     284        if 'HOME' in os.environ:
     285            rsb_macros = path.join(os.environ['HOME'], '.rsb_macros')
     286            if path.exists(rsb_macros):
     287                self.defaults.load(rsb_macros)
    280288
    281289    def sb_git(self):
     
    288296            if not repo_clean:
    289297                repo_id += '-modified'
     298            repo_mail = repo.email()
    290299        else:
    291300            repo_valid = '0'
     
    293302            repo_clean = '%{nil}'
    294303            repo_id = 'no-repo'
     304            repo_mail = None
    295305        self.defaults['_sbgit_valid'] = repo_valid
    296306        self.defaults['_sbgit_head']  = repo_head
    297307        self.defaults['_sbgit_clean'] = str(repo_clean)
    298308        self.defaults['_sbgit_id']    = repo_id
     309        if repo_mail is not None:
     310            self.defaults['_sbgit_mail'] = repo_mail
    299311
    300312    def command(self):
     
    386398
    387399    def get_arg(self, arg):
    388         if not arg in self.optargs:
     400        if self.optargs is None or arg not in self.optargs:
    389401            raise error.internal('bad arg: %s' % (arg))
    390402        for a in self.args:
Note: See TracChangeset for help on using the changeset viewer.