Exemple #1
0
    def __load_target_hash(self):
        try:
            key_list = bldreg.section_key_list('targets')
        except KeyError:
            return

        ## figure out the base absolute path
        base_path = ushell.posix_path(bldreg.get_value('build', 'path'))

        self.__target_hash = {}

        for key in key_list:
            target_path = ushell.join(
                base_path, ushell.posix_path(bldreg.get_value('targets', key)))
            
            self.__target_hash[key] = target_path
Exemple #2
0
    def get_module_path_hash(self, target):
        ## retrieve the branch ID from the registry
        branch = bldreg.get_value('build', 'branch')

        ## find the BIF file for this branch
        branch_list = branchlist.BranchList()
        bif_file = branch_list.file(branch)
        if not bif_file:
            e = err.Error()
            e.Set("Cannot find bif file=\"%s\"." % (bif_file))
            raise err.error, e

        ## parse the BIF/XML file and get information for this build
        bif_data = bif.load_bif_data(bif_file, branch_list)

        ## feed the BIF information to a dependancy list, and set
        ## the dependancy list's targets
        depend = dependlist.DependList(bif_data, target)

        ## this takes it's best shot at returning a list of all the
        ## subdirectory names checked out by this target
        module_list = depend.distribution_list() + depend.checkout_list()
        
        base_path = ushell.posix_path(bldreg.get_value('build', 'path'))

        module_path_hash = {}
        for module in module_list:
            module_path_hash[module.id] = ushell.join(base_path, module.name)

        return module_path_hash
Exemple #3
0
    def __load_target_hash(self):
        try:
            key_list = bldreg.section_key_list('targets')
        except KeyError:
            return

        ## figure out the base absolute path
        base_path = ushell.posix_path(bldreg.get_value('build', 'path'))

        self.__target_hash = {}

        for key in key_list:
            target_path = ushell.join(
                base_path, ushell.posix_path(bldreg.get_value('targets', key)))

            self.__target_hash[key] = target_path
Exemple #4
0
    def get_module_path_hash(self, target):
        ## retrieve the branch ID from the registry
        branch = bldreg.get_value('build', 'branch')

        ## find the BIF file for this branch
        branch_list = branchlist.BranchList()
        bif_file = branch_list.file(branch)
        if not bif_file:
            e = err.Error()
            e.Set("Cannot find bif file=\"%s\"." % (bif_file))
            raise err.error, e

        ## parse the BIF/XML file and get information for this build
        bif_data = bif.load_bif_data(bif_file, branch_list)

        ## feed the BIF information to a dependancy list, and set
        ## the dependancy list's targets
        depend = dependlist.DependList(bif_data, target)

        ## this takes it's best shot at returning a list of all the
        ## subdirectory names checked out by this target
        module_list = depend.distribution_list() + depend.checkout_list()

        base_path = ushell.posix_path(bldreg.get_value('build', 'path'))

        module_path_hash = {}
        for module in module_list:
            module_path_hash[module.id] = ushell.join(base_path, module.name)

        return module_path_hash
Exemple #5
0
    def copy_to_copydir(self, path):
        ## build the copy directory path
        if self.settings.get('copy_path'):
            base_path = bldreg.get_value('build', 'path')
            copy_path = os.path.join(base_path, self.settings['copy_path'])
            print copy_path
            copy_path = ushell.posix_path(copy_path)
            print copy_path
        else:
            self.error('no copy_path set')
            return

        ## make the copy_path directory
        if not ushell.isdir(copy_path):
            ushell.mkdir(copy_path)
        
        ushell.cp(path, copy_path)
Exemple #6
0
    def copy_to_copydir(self, path):
        ## build the copy directory path
        if self.settings.get('copy_path'):
            base_path = bldreg.get_value('build', 'path')
            copy_path = os.path.join(base_path, self.settings['copy_path'])
            print copy_path
            copy_path = ushell.posix_path(copy_path)
            print copy_path
        else:
            self.error('no copy_path set')
            return

        ## make the copy_path directory
        if not ushell.isdir(copy_path):
            ushell.mkdir(copy_path)

        ushell.cp(path, copy_path)