annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/usr/bin/python
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 # Filter out baseconfig entries from output of miniconfig.sh
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 import os,sys
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
6
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
7 if len(sys.argv) != 3:
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
8 sys.stderr.write("usage: filter.py baseconfig mini.config\n")
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
9 sys.exit(1)
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
10
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 baseconfig=file(sys.argv[1]).readlines()
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
12 miniconfig=file(sys.argv[2]).readlines()
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
13
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
14 for i in baseconfig:
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 if i in miniconfig:
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
16 miniconfig.remove(i)
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
17
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.
Rob Landley <rob@landley.net>
parents:
diff changeset
18 print "".join(miniconfig),