diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-03-12 08:34:29 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2012-03-12 08:34:29 -0500 |
commit | e1da9dc5b5b9aa5fcb72465d1841b07eae5cf303 (patch) | |
tree | d75db40fbc63c37a216a611a7857570955235d92 | |
parent | Add diff mode to freebsd-to-rtems.py (diff) | |
download | rtems-libbsd-e1da9dc5b5b9aa5fcb72465d1841b07eae5cf303.tar.bz2 |
Fix dry run bug and change name of filesChanged variable
-rwxr-xr-x | freebsd-to-rtems.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py index c0180d5e..c7a2ffed 100755 --- a/freebsd-to-rtems.py +++ b/freebsd-to-rtems.py @@ -50,7 +50,7 @@ isDiffMode = False isEarlyExit = False isOnlyMakefile = False tempFile = "/tmp/tmp_FBRT" -filesChanged = 0 +filesProcessed = 0 def usage(): print "freebsd-to-rtems.py [args]" @@ -67,7 +67,8 @@ def usage(): # Parse the arguments def parseArguments(): global RTEMS_DIR, FreeBSD_DIR - global isVerbose, isForward, isEarlyExit, isOnlyMakefile, isDiffMode + global isVerbose, isForward, isDryRun, isEarlyExit + global isOnlyMakefile, isDiffMode try: opts, args = getopt.getopt(sys.argv[1:], "?hdDemRr:f:v", ["help", @@ -94,7 +95,7 @@ def parseArguments(): usage() sys.exit() elif o in ("-d", "--dry-run"): - isForward = False + isDryRun = True elif o in ("-D", "--diff"): isDiffMode = True elif o in ("-e", "--early-exit"): @@ -165,11 +166,11 @@ def mapCPUDependentPath(path): # compare and process file only if different # + copy or diff depending on execution mode def processIfDifferent(new, old, desc, src): - global filesChanged + global filesProcessed # print new + " " + old + " X" + desc + "X " + src if not os.path.exists(old) or \ filecmp.cmp(new, old, shallow=False) == False: - filesChanged += 1 + filesProcessed += 1 if isDiffMode == False: # print "Move " + new + " to " + old if isDryRun == False: @@ -1878,7 +1879,7 @@ else: # Print a summary if changing files if isDiffMode == False: - if filesChanged == 1: - print str(filesChanged) + " file was changed." + if filesProcessed == 1: + print str(filesProcessed) + " file was changed." else: - print str(filesChanged) + " files were changed." + print str(filesProcessed) + " files were changed." |