diff --git a/helpers/create-abi-bump.py b/helpers/create-abi-bump.py --- a/helpers/create-abi-bump.py +++ b/helpers/create-abi-bump.py @@ -234,6 +234,10 @@ lib.createABIDump() fileName = "abi_dumps/{name}/{name}_{version}.abi.tar.gz".format(name=lib.name,version=lib.version) # can replaced with f-String in python 3.6 - scmRevision = max([t['SONAME'] for t in lib.targets.values()]) # a more hackish way, to save the SONAME in the metadata + ourArchive.extraMetadata["SONAME"] = max([t['SONAME'] for t in lib.targets.values()]) # use max because there may be more than one lib inside + ourArchive.extraMetadata["version"] = lib.version + ourArchive.extraMetadata["libname"] = lib.name + ourArchive.extraMetadata["targets"] = lib.targets.keys() + ourArchive.storePackage(lib.name, fileName, srcRevision) packageName = "{name}_{scmRevision}".format(name=lib.name, scmRevision=scmRevision) ourArchive.storePackage(packageName, fileName, scmRevision) diff --git a/helpers/helperslib/Packages.py b/helpers/helperslib/Packages.py --- a/helpers/helperslib/Packages.py +++ b/helpers/helperslib/Packages.py @@ -1,3 +1,4 @@ +import copy import os import re import stat @@ -22,6 +23,9 @@ # Set an empty manifest up for safety later on self.serverManifest = {} + # Extra metadata saved to metadata file, and will be written to yaml file + self.extraMetadata = {} + # Load our configuration configFileLocation = os.path.join( CommonUtils.scriptsBaseDirectory(), 'archive-configs', name + '.yaml' ) with open(configFileLocation, 'r') as configFile: @@ -139,12 +143,19 @@ packageTimestamp = os.path.getmtime( contentsNeedingMetadata ) # Now the checksum packageChecksum = CommonUtils.generateFileChecksum( contentsNeedingMetadata ) - # Build the metadata which we'll be writing out - metadataForPackage = { + + metadataForPackage = {} + + # If we have extraMetadata for this Package pressed the metadata dictionary + if self.extraMetadata: + metadataForPackage = copy.copy(self.extraMetadata) + + # Update/adds the nessary keys, that we want to exist. + metadataForPackage.update({ 'timestamp': packageTimestamp, 'checksum': packageChecksum, 'scmRevision': scmRevision - } + }) # Write the YAML out to a temporary file latestMetadata = tempfile.NamedTemporaryFile(delete=False, mode='w', dir=self.temporaryFileLocation())