<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _update_srcmap_file(self, sources, overwrite=True):
 """Check the contents of the source map file and generate source maps for any components that are not present."""


        if not os.path.isfile(self.files['srcmap']):
            return

        hdulist = fits.open(self.files['srcmap'])
        hdunames = [hdu.name.upper() for hdu in hdulist]

        srcmaps = {}

        for src in sources:

            if src.name.upper() in hdunames and not overwrite:
                continue
            self.logger.debug('Creating source map for %s', src.name)
            srcmaps[src.name] = self._create_srcmap(src.name, src)

        if srcmaps:
            self.logger.debug(
                'Updating source map file for component %s.', self.name)
            srcmap_utils.update_source_maps(self.files['srcmap'], srcmaps,
                                            logger=self.logger)
        hdulist.close()