def _parse_overlay_meta(self, filename): parser = OverlayParser() file = open(filename, 'r') parser.parse(file.read()) file.close() return parser.get()
from tools.syncfile import SyncFile from tools.overlayparser import OverlayParser import ConfigParser import os import sys layman_config = ConfigParser.ConfigParser() layman_config.read('/etc/layman/layman.cfg') layman_storage_path = layman_config.get('MAIN', 'storage') if not layman_storage_path.endswith('/'): layman_storage_path = layman_storage_path + '/' sync_file = SyncFile( 'http://www.gentoo.org/proj/en/overlays/layman-global.txt', 'layman-global.txt') parser = OverlayParser() file = open(sync_file.path(), 'r') parser.parse(file.read()) file.close() legend_printed = False for i in parser.get().keys(): layman_global_name = i overlay_folder = os.path.join(layman_storage_path, layman_global_name) if not os.path.exists(overlay_folder): sys.stderr.write('ERROR: Overlay "%s" not found\n' % layman_global_name) continue filename = os.path.join(overlay_folder, 'profiles', 'repo_name') if not os.path.exists(filename): sys.stderr.write('ERROR: Overlay "%s" lacks repo_name entry\n' % \
from tools.syncfile import SyncFile from tools.overlayparser import OverlayParser import ConfigParser import os import sys layman_config = ConfigParser.ConfigParser() layman_config.read('/etc/layman/layman.cfg') layman_storage_path = layman_config.get('MAIN', 'storage') if not layman_storage_path.endswith('/'): layman_storage_path = layman_storage_path + '/' sync_file = SyncFile( 'http://www.gentoo.org/proj/en/overlays/layman-global.txt', 'layman-global.txt') parser = OverlayParser() file = open(sync_file.path(), 'r') parser.parse(file.read()) file.close() legend_printed = False for i in parser.get().keys(): layman_global_name = i overlay_folder = os.path.join(layman_storage_path, layman_global_name) if not os.path.exists(overlay_folder): sys.stderr.write('ERROR: Overlay "%s" not found\n' % layman_global_name) continue filename = os.path.join(overlay_folder, 'profiles', 'repo_name') if not os.path.exists(filename): sys.stderr.write('ERROR: Overlay "%s" lacks repo_name entry\n' % \ layman_global_name)