summaryrefslogtreecommitdiff
authorMichael Krelin <hacker@klever.net>2014-06-30 19:23:23 (UTC)
committer Michael Krelin <hacker@klever.net>2014-06-30 19:23:23 (UTC)
commitb9ee39b810aae10da83534776028585309b53a24 (patch) (unidiff)
tree02de66579bbc322cc10bcb5727ef69d03775783e
parent7a1f88f679d1574b93fba3415aa11fc4471eacbf (diff)
downloadclipperz-b9ee39b810aae10da83534776028585309b53a24.zip
clipperz-b9ee39b810aae10da83534776028585309b53a24.tar.gz
clipperz-b9ee39b810aae10da83534776028585309b53a24.tar.bz2
builder: add --force-dirty flag
Besides being good for development, it seems to be a necessity in case we are checked out as a submodule
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/builder/main.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/builder/main.py b/scripts/builder/main.py
index ecdbf6a..47e10a0 100755
--- a/scripts/builder/main.py
+++ b/scripts/builder/main.py
@@ -79,25 +79,25 @@ def assembleBackend (backend, frontends, versions):
79 builderModule = __import__(builderModuleName) 79 builderModule = __import__(builderModuleName)
80 builderClass = getattr(builderModule, builderClassName) 80 builderClass = getattr(builderModule, builderClassName)
81 81
82 backendBuilder = builderClass(projectTargetDir(), frontends, versions, settings) 82 backendBuilder = builderClass(projectTargetDir(), frontends, versions, settings)
83 backendBuilder.run() 83 backendBuilder.run()
84 84
85#==================================================================== 85#====================================================================
86 86
87def build (settings, repository): 87def build (settings, repository):
88 frontends = [] 88 frontends = []
89 89
90 if repository.areTherePendingChanges(): 90 if repository.areTherePendingChanges():
91 if 'install' in settings['versions']: 91 if 'install' in settings['versions'] and not settings['forcedirty']:
92 raise Exception("repository has pending changes, can't 'install'") 92 raise Exception("repository has pending changes, can't 'install'")
93 else: 93 else:
94 print "\nWARNING: repository has pending changes\n" 94 print "\nWARNING: repository has pending changes\n"
95 95
96 for frontend in settings['frontends']: 96 for frontend in settings['frontends']:
97 normalizedFrontendName = frontend.replace(".", "_") 97 normalizedFrontendName = frontend.replace(".", "_")
98 builderModuleName = normalizedFrontendName + 'Builder' 98 builderModuleName = normalizedFrontendName + 'Builder'
99 builderClassName = normalizedFrontendName.title() + 'Builder' 99 builderClassName = normalizedFrontendName.title() + 'Builder'
100 100
101 #print ("BUILD FRONTEND - module: " + builderModuleName + " , class: " + builderClassName) 101 #print ("BUILD FRONTEND - module: " + builderModuleName + " , class: " + builderClassName)
102 builderModule = __import__(builderModuleName) 102 builderModule = __import__(builderModuleName)
103 builderClass = getattr(builderModule, builderClassName) 103 builderClass = getattr(builderModule, builderClassName)
@@ -141,24 +141,27 @@ def allBackends ():
141 return ['php', 'python'] 141 return ['php', 'python']
142 142
143#-------------------------------------------------------------------- 143#--------------------------------------------------------------------
144 144
145def main (): 145def main ():
146 settings = {} 146 settings = {}
147 parameters = list(itertools.islice(sys.argv, 1, None)) 147 parameters = list(itertools.islice(sys.argv, 1, None))
148 148
149 sys.path.append(os.path.join(scriptDir(), 'backends')) 149 sys.path.append(os.path.join(scriptDir(), 'backends'))
150 sys.path.append(os.path.join(scriptDir(), 'frontends')) 150 sys.path.append(os.path.join(scriptDir(), 'frontends'))
151 currentRepository = repository.repositoryWithPath(projectBaseDir()) 151 currentRepository = repository.repositoryWithPath(projectBaseDir())
152 152
153 settings['forcedirty'] = len(parameters)
154 parameters = list(itertools.ifilter(lambda x: not x=='--force-dirty', parameters))
155 settings['forcedirty'] = len(parameters)==settings['forcedirty']
153 clean() 156 clean()
154 versions = list(itertools.takewhile(lambda x: not x.startswith('--'), parameters)) 157 versions = list(itertools.takewhile(lambda x: not x.startswith('--'), parameters))
155 settings['versions'] = versions; #['debug', 'install', 'development', 'checksum'] 158 settings['versions'] = versions; #['debug', 'install', 'development', 'checksum']
156 parameters = deque(itertools.dropwhile(lambda x: not x.startswith('--'), parameters)) 159 parameters = deque(itertools.dropwhile(lambda x: not x.startswith('--'), parameters))
157 160
158 if len(parameters) > 0: 161 if len(parameters) > 0:
159 parameter = parameters.popleft() 162 parameter = parameters.popleft()
160 if parameter == "--ALL": 163 if parameter == "--ALL":
161 settings['frontends'] = allFrontends() 164 settings['frontends'] = allFrontends()
162 settings['backends'] = allBackends() 165 settings['backends'] = allBackends()
163 else: 166 else:
164 while parameter != None: 167 while parameter != None: