Mercurial > hg > aboriginal
annotate sources/toys/filter.py @ 1541:e4f766efa39f
Sort busybox config entries to group stuff toybox can replace. Also add ps.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 06 Sep 2012 03:44:47 -0500 |
parents | f24c0deeed24 |
children |
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), |