view sources/toys/filter.py @ 1404:f24c0deeed24

Add quick and dirty toy to filter out baseconfig entries from miniconfig.sh output to give LINUX_CONFIG entry for a target settings file.
author Rob Landley <rob@landley.net>
date Mon, 27 Jun 2011 07:44:19 -0500
parents
children
line wrap: on
line source

#!/usr/bin/python

# Filter out baseconfig entries from output of miniconfig.sh

import os,sys

if len(sys.argv) != 3:
  sys.stderr.write("usage: filter.py baseconfig mini.config\n")
  sys.exit(1)

baseconfig=file(sys.argv[1]).readlines()
miniconfig=file(sys.argv[2]).readlines()

for i in baseconfig:
  if i in miniconfig:
    miniconfig.remove(i)

print "".join(miniconfig),