From 481bd7db1d9c3937373c643d6d6aa3164b179839 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Fri, 9 Oct 2020 22:35:45 +0200 Subject: [pkg] some extra branding refactor --- branding/scripts/generate-vendor-make.py | 58 -------------------------------- 1 file changed, 58 deletions(-) delete mode 100755 branding/scripts/generate-vendor-make.py (limited to 'branding/scripts/generate-vendor-make.py') diff --git a/branding/scripts/generate-vendor-make.py b/branding/scripts/generate-vendor-make.py deleted file mode 100755 index e7794c3..0000000 --- a/branding/scripts/generate-vendor-make.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python3 - -# Generates a simplified file with variables that -# can be imported from the main vendorized Makefile. - -import os -import sys - -import configparser - -from provider import getDefaultProvider -from provider import getProviderData - - -VERSION = os.environ.get('VERSION', 'unknown') - -TEMPLATE = """ -# Variables for the build of {applicationName}. -# Generated automatically. Do not edit. -APPNAME := {applicationName} -BINNAME := {binaryName} -VERSION := {version} -""" - - -def writeOutput(data, outfile): - - configString = TEMPLATE.format( - binaryName=data['binaryName'], - applicationName=data['applicationName'], - version=data['version'], - ) - - with open(outfile, 'w') as outf: - outf.write(configString) - - -if __name__ == "__main__": - env_provider_conf = os.environ.get('PROVIDER_CONFIG') - if env_provider_conf: - if os.path.isfile(env_provider_conf): - print("[+] Overriding provider config per " - "PROVIDER_CONFIG variable") - configfile = env_provider_conf - - config = configparser.ConfigParser() - config.read(configfile) - provider = getDefaultProvider(config) - data = getProviderData(provider, config) - - if len(sys.argv) != 2: - print('Usage: generate-vendor-make.py ') - sys.exit(1) - - outputf = sys.argv[1] - data['version'] = VERSION - - writeOutput(data, outputf) -- cgit v1.2.3