patch_builder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A patch() 0 12 1
1
from SCons.Script import *
2
import os
3
4
5
def patch(target, source, env):
6
    '''
7
        The first file in the source list is the patch file,
8
        then comes the file to be patched.
9
        The target argument contains the file to be created.
10
    '''
11
    patch_file = str(source[0])
12
    assert(patch_file.endswith('.patch'))
13
    orig_file = str(source[1])
14
    target_file = str(target[0])
15
    print "Patching third party code ..."
16
    os.system("patch -o %s %s %s" % (target_file, orig_file, patch_file))
17
18
19
patchbuilder = Builder(action=patch)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable Builder does not seem to be defined.
Loading history...
20