code: def update_mandb_path():
      
      manpath_file = os.path.join(environ.HOME, ".manpath")
      man_dir      = environ.cache_dir
      manindex_dir = environ.manindex_dirl
  
      lines = []
  
      """ read all lines """
      try:
          with open(manpath_file, 'r') as f:
              lines = f.readlines()
      except IOError:
          return
  
      """ remove MANDATORY_MANPATH and MANDB_MAP entry """
      lines = [line for line in lines if man_dir not in line]
  
      with open(manpath_file, 'w') as f:
          if environ.config.UpdateManPath:
              lines.append('MANDATORY_MANPATH\t%s\n' % man_dir)
              lines.append('MANDB_MAP\t\t\t%s\t%s\n' % (man_dir, manindex_dir))
  
          f.writelines(lines)
docs: Add $XDG_CACHE_HOME/cppman/man to $HOME/.manpath