I am running the diff command on MAC as follows and it works fine but when I run through python the --exclude option doesn't work meaning the command output still lists files under /Users/username/FWIntegration/branch_4355c1/.git, can anyone suggest how to debug this or how to fix this
/usr/bin/diff -x '.*' -x 'tech' -rq /Users/username/FWIntegration/repo2mirror /Users/username/FWIntegration/branch_4355c1 --exclude=/Users/username/FWIntegration/branch_4355c1/.git/
Running from python
cmd = "/usr/bin/diff -x '.*' -x 'tech' -rq /Users/username/FWIntegration/repo2mirror /Users/username/FWIntegration/branch_4355c1 --exclude=/Users/username/FWIntegration/branch_4355c1/.git/"
output,error = runCmd(cmd)
def runCmd(cmd):
out = ""
err = ""
logger.info("Running command %s"%cmd)
proc = Popen(cmd.split(' '), stdout=PIPE, stderr=PIPE)
try:
with proc.stdout as stdout:
for line in stdout:
print line,
out = out + line
#android_loader_output+=line
#if 'ERROR:' in line:
#print line
except:
print "%s failed"%cmd
print traceback.format_exc()
try:
with proc.stderr as stderr:
for line in stderr:
print line,
err = err + line
#android_loader_output+=line
#if 'ERROR:' in line:
#print line
except:
print "%s failed"%cmd
print traceback.format_exc()
#print out
#print err
return out,err
it lists like
Only in /Users/username/FWIntegration/branch_4355c1/.git/refs/tags: DIN2944T146R6_REL_9_74_5
Only in /Users/username/FWIntegration/branch_4355c1/.git/refs/tags: DIN2944T18R2_REL_9_48_1
Only in /Users/username/FWIntegration/branch_4355c1/.git/refs/tags: DIN2944T51R2_REL_9_55_2