author | Michael Krelin <hacker@klever.net> | 2014-06-30 19:23:23 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2014-06-30 19:23:23 (UTC) |
commit | b9ee39b810aae10da83534776028585309b53a24 (patch) (side-by-side diff) | |
tree | 02de66579bbc322cc10bcb5727ef69d03775783e | |
parent | 7a1f88f679d1574b93fba3415aa11fc4471eacbf (diff) | |
download | clipperz-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
-rwxr-xr-x | scripts/builder/main.py | 5 |
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 @@ -75,33 +75,33 @@ def assembleBackend (backend, frontends, versions): builderModuleName = backend + 'Builder' builderClassName = backend.capitalize() + 'Builder' #print ("BUILD BACKENDS - module: " + builderModuleName + " , class: " + builderClassName) builderModule = __import__(builderModuleName) builderClass = getattr(builderModule, builderClassName) backendBuilder = builderClass(projectTargetDir(), frontends, versions, settings) backendBuilder.run() #==================================================================== def build (settings, repository): frontends = [] if repository.areTherePendingChanges(): - if 'install' in settings['versions']: + if 'install' in settings['versions'] and not settings['forcedirty']: raise Exception("repository has pending changes, can't 'install'") else: print "\nWARNING: repository has pending changes\n" for frontend in settings['frontends']: normalizedFrontendName = frontend.replace(".", "_") builderModuleName = normalizedFrontendName + 'Builder' builderClassName = normalizedFrontendName.title() + 'Builder' #print ("BUILD FRONTEND - module: " + builderModuleName + " , class: " + builderClassName) builderModule = __import__(builderModuleName) builderClass = getattr(builderModule, builderClassName) builder = builderClass(frontend, loadSettings('frontend', frontend), repository.version()) #builder = frontendBuilder.FrontendBuilder(frontend, loadSettings('frontend', frontend), repository.version()) frontends.append(builder) @@ -137,32 +137,35 @@ def usage (message): def allFrontends (): return ['beta', 'gamma', 'gamma.mobile'] def allBackends (): return ['php', 'python'] #-------------------------------------------------------------------- def main (): settings = {} parameters = list(itertools.islice(sys.argv, 1, None)) sys.path.append(os.path.join(scriptDir(), 'backends')) sys.path.append(os.path.join(scriptDir(), 'frontends')) currentRepository = repository.repositoryWithPath(projectBaseDir()) + settings['forcedirty'] = len(parameters) + parameters = list(itertools.ifilter(lambda x: not x=='--force-dirty', parameters)) + settings['forcedirty'] = len(parameters)==settings['forcedirty'] clean() versions = list(itertools.takewhile(lambda x: not x.startswith('--'), parameters)) settings['versions'] = versions; #['debug', 'install', 'development', 'checksum'] parameters = deque(itertools.dropwhile(lambda x: not x.startswith('--'), parameters)) if len(parameters) > 0: parameter = parameters.popleft() if parameter == "--ALL": settings['frontends'] = allFrontends() settings['backends'] = allBackends() else: while parameter != None: values = list(itertools.takewhile(lambda x: not x.startswith('--'), parameters)) if parameter == "--backends": settings['backends'] = values |