From 5b68e4eef321b22f6274760d1d0941d41fa4fa17 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Fri, 1 Dec 2006 16:20:38 +0000 Subject: [PATCH] renamed to kread --- configs/kread.py | 90 ------------------------------------------------ 1 file changed, 90 deletions(-) delete mode 100755 configs/kread.py diff --git a/configs/kread.py b/configs/kread.py deleted file mode 100755 index c5366691c..000000000 --- a/configs/kread.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/env python -# -# compare: a tool to compare kernel config files -# -# Marc E. Fiuczynski -# Copyright (C) 2006 The Trustees of Princeton University -# -# $Id: kread.py,v 1.2 2006/12/01 02:40:40 mef Exp $ -# - -import sys, re, os - -currentconfig = "" -configs = {} - -def _config(parts,fb): - global currentconfig - currentconfig = parts[1] - -def _help(parts,fb): - global currentconfig - helptxt = "" - lineno = 0 - while True: - line = fb.readline() - lineno = lineno + 1 - if len(line)==0 or not line[0].isspace():break - if len(line)>1: line = line.lstrip() - helptxt = helptxt+line - - configs[currentconfig]=helptxt - -def _source(parts,fb): - filename = "".join(parts[1:]) - if filename[0]=='"' or filename[0]=='\'': - filename=filename[1:] - if filename[-1]=='"' or filename[-1]=='\'': - filename=filename[:-1] - process(filename) - -def _noop(parts,fb): - pass - -keywords = {"config":_config, - "help":_help, - "---help---":_help, - "source":_source, - "#":_noop} - -def process(filename): - fb = open(filename) - lineno = 0 - while True: - line = fb.readline() - lineno = lineno + 1 - if len(line)==0:break - - line = line.strip() - parts = line.split() - if len(parts)==0:continue - - func = keywords.get(parts[0],_noop) - func(parts,fb) - - fb.close() - -initialized = False -def init(): - if not initialized: - initialized = True - ARCH=os.getenv("ARCH","i386") - process("arch/%s/Kconfig" % ARCH) - -def gethelp(option): - if option[:len("CONFIG_")] == "CONFIG_": - option=option[len("CONFIG_"):] - init() - helptxt = configs.get(option,"") - return helptxt - - -if __name__ == '__main__': - if len(sys.argv) == 1: - print """USAGE\n%s configoptionname""" % os.path.basename(sys.argv[0]) - else: - option = sys.argv[1] - init() - helptxt = gethelp(option) - print "CONFIG_%s:\n%s" % (option,helptxt) - -- 2.43.0