summaryrefslogtreecommitdiffstats
path: root/libc/kernel/tools
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-06-17 10:26:10 -0700
committerElliott Hughes <enh@google.com>2013-06-17 10:39:33 -0700
commit18bc975bfe41a0ef8d2df1a188078b0741dc6c25 (patch)
tree1013658abaeb0fa056a4c6403fd5f154a7e60aa0 /libc/kernel/tools
parent560e9f7e7a39e02aca96709043ca06f562f75d58 (diff)
downloadbionic-18bc975bfe41a0ef8d2df1a188078b0741dc6c25.zip
bionic-18bc975bfe41a0ef8d2df1a188078b0741dc6c25.tar.gz
bionic-18bc975bfe41a0ef8d2df1a188078b0741dc6c25.tar.bz2
Slight script cleanup; make gensyscalls work from any directory.
Also remove a ton of dead code. Change-Id: I1315623695a004f643b155f121cbafe24b715b8a
Diffstat (limited to 'libc/kernel/tools')
-rw-r--r--libc/kernel/tools/utils.py55
1 files changed, 0 insertions, 55 deletions
diff --git a/libc/kernel/tools/utils.py b/libc/kernel/tools/utils.py
index 8ec7353..0478e93 100644
--- a/libc/kernel/tools/utils.py
+++ b/libc/kernel/tools/utils.py
@@ -47,32 +47,6 @@ def find_program_name():
def find_program_dir():
return os.path.dirname(sys.argv[0])
-def find_file_from_upwards(from_path,target_file):
- """find a file in the current directory or its parents. if 'from_path' is None,
- seach from the current program's directory"""
- path = from_path
- if path == None:
- path = os.path.realpath(sys.argv[0])
- path = os.path.dirname(path)
- D("this script seems to be located in: %s" % path)
-
- while 1:
- D("probing "+path)
- if path == "":
- file = target_file
- else:
- file = path + "/" + target_file
-
- if os.path.isfile(file):
- D("found %s in %s" % (target_file, path))
- return file
-
- if path == "":
- return None
-
- path = os.path.dirname(path)
-
-
class StringOutput:
def __init__(self):
self.line = ""
@@ -143,35 +117,6 @@ def cleanup_dir(path):
for name in dirs:
os.rmdir(os.path.join(root, name))
-def update_file( path, newdata ):
- """update a file on disk, only if its content has changed"""
- if os.path.exists( path ):
- try:
- f = open( path, "r" )
- olddata = f.read()
- f.close()
- except:
- D("update_file: cannot read existing file '%s'" % path)
- return 0
-
- if oldata == newdata:
- D2("update_file: no change to file '%s'" % path )
- return 0
-
- update = 1
- else:
- try:
- create_file_path(path)
- except:
- D("update_file: cannot create path to '%s'" % path)
- return 0
-
- f = open( path, "w" )
- f.write( newdata )
- f.close()
-
- return 1
-
class BatchFileUpdater:
"""a class used to edit several files at once"""