[rtems-libbsd commit] Fix dry run bug and change name of filesChanged variable
Joel Sherrill
joel at rtems.org
Mon Mar 12 13:34:53 UTC 2012
Module: rtems-libbsd
Branch: master
Commit: e1da9dc5b5b9aa5fcb72465d1841b07eae5cf303
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=e1da9dc5b5b9aa5fcb72465d1841b07eae5cf303
Author: Joel Sherrill <joel.sherrill at oarcorp.com>
Date: Mon Mar 12 08:34:29 2012 -0500
Fix dry run bug and change name of filesChanged variable
---
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 c0180d5..c7a2ffe 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."
More information about the vc
mailing list