diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:13 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:13 -0800 |
| commit | 1767f908af327fa388b1c66883760ad851267013 (patch) | |
| tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /libc/kernel/tools/update_all.py | |
| parent | a799b53f10e5a6fd51fef4436cfb7ec99836a516 (diff) | |
| download | bionic-1767f908af327fa388b1c66883760ad851267013.zip bionic-1767f908af327fa388b1c66883760ad851267013.tar.gz bionic-1767f908af327fa388b1c66883760ad851267013.tar.bz2 | |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'libc/kernel/tools/update_all.py')
| -rwxr-xr-x | libc/kernel/tools/update_all.py | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/libc/kernel/tools/update_all.py b/libc/kernel/tools/update_all.py deleted file mode 100755 index 6272fcf..0000000 --- a/libc/kernel/tools/update_all.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python -# -import sys, cpp, kernel, glob, os, re, getopt, clean_header -from defaults import * -from utils import * - -def usage(): - print """\ - usage: %(progname)s - - this program is used to update all the auto-generated clean headers - used by the Bionic C library. it assumes the following: - - - a set of source kernel headers is located in '../original', - relative to the program's directory - - - the clean headers will be placed in '../arch-<arch>/asm', - '../common/linux', '../common/asm-generic', etc.. - - - if ANDROID_PRODUCT_OUT is defined in your environment, you're - using the Android build system, and the program will issue - p4 add / edit / delete commands to update the depot for you. - (you'll need to p4 submit manually though) -""" % { "progname" : os.path.basename(sys.argv[0]) } - sys.exit(0) - -try: - optlist, args = getopt.getopt( sys.argv[1:], '' ) -except: - # unrecognized option - sys.stderr.write( "error: unrecognized option\n" ) - usage() - -if len(optlist) > 0 or len(args) > 0: - usage() - -progdir = find_program_dir() -original_dir = os.path.normpath( progdir + "/../original" ) -if not os.path.isdir( original_dir ): - panic( "required directory does not exists: %s\n" % original_dir ) - -# find all source files in 'original' -# -sources = [] -for root, dirs, files in os.walk( original_dir ): - for file in files: - base, ext = os.path.splitext(file) - if ext == ".h": - sources.append( "%s/%s" % (root,file) ) - -b = BatchFileUpdater() - -for arch in kernel_archs: - b.readDir( os.path.normpath( progdir + "/../arch-%s" % arch ) ) - -b.readDir( os.path.normpath( progdir + "/../common" ) ) - -#print "OLD " + repr(b.old_files) - -for path in sources: - dst_path, newdata = clean_header.cleanupFile(path) - if not dst_path: - continue - - b.readFile( dst_path ) - r = b.editFile( dst_path, newdata ) - if r == 0: - r = "unchanged" - elif r == 1: - r = "edited" - else: - r = "added" - - print "cleaning: %-*s -> %-*s (%s)" % ( 35, path, 35, dst_path, r ) - -usePerforce = os.environ.has_key("ANDROID_PRODUCT_OUT") - -if usePerforce: - b.updateP4Files() -else: - b.updateFiles() - -sys.exit(0) |
