diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-11-01 17:20:25 +0000 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-11-02 19:50:28 +0000 |
commit | c4050b03011a732c494443a87c2d14c23e5c08ea (patch) | |
tree | f5addc099699605ae861ecba92a211c30ce0b9a1 /libc/kernel/tools | |
parent | 3fcf18a70f7efd0ee1b91f11327114553a9f2565 (diff) | |
parent | 8e39d2f9f403639195e430f81a47ad3940bd6975 (diff) | |
download | bionic-c4050b03011a732c494443a87c2d14c23e5c08ea.zip bionic-c4050b03011a732c494443a87c2d14c23e5c08ea.tar.gz bionic-c4050b03011a732c494443a87c2d14c23e5c08ea.tar.bz2 |
Merge tag 'android-4.4_r1' into cm-11.0
Android 4.4 Release 1.0
Conflicts:
libc/arch-arm/arm.mk
libc/upstream-freebsd/lib/libc/stdlib/getopt_long.c
linker/linker_phdr.cpp
Diffstat (limited to 'libc/kernel/tools')
-rw-r--r-- | libc/kernel/tools/utils.py | 55 |
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""" |