Commit 5114cf7e authored by Ben Cooksley's avatar Ben Cooksley

Allow for the appropriate file extension to use on files to be specified when managing an archive.

Make it possible to change the suffix so we can change the suffix for
the abibuilder. Otherwise humans and f.ex. vi/vim get confused by the filesuffix.

Differential Revision: https://phabricator.kde.org/D16581
parent 64b0cc9a
......@@ -273,7 +273,7 @@ with open(arguments.buildLog, encoding='utf-8') as log:
foundLibraries.append(foundLibrary)
# Initialize the archive manager
ourArchive = Packages.Archive(arguments.environment, 'ABIReference', usingCache = False)
ourArchive = Packages.Archive(arguments.environment, 'ABIReference', usingCache = False, suffix = ".abidump")
# Determine which SCM revision we are storing
# This will be embedded into the package metadata which might help someone doing some debugging
......
......@@ -15,11 +15,13 @@ def nameForProject( product, project, branchGroup ):
class Archive(object):
# Sets up an archive for use, to allow for retrieving and uploading new resources to the archive
# A local cache of the archive will be managed to improve performance
def __init__( self, name, platform, usingCache = True ):
# contentsSuffix is the filename suffix used for the contents files
def __init__( self, name, platform, usingCache = True, contentsSuffix = ".tar" ):
# Save the name of this archive, the platform we're on and whether a local cache should be used for later use
self.name = name
self.platform = platform
self.usingCache = usingCache
self.name = name
self.platform = platform
self.usingCache = usingCache
self.contentsSuffix = contentsSuffix
# Set an empty manifest up for safety later on
self.serverManifest = {}
......@@ -78,7 +80,7 @@ class Archive(object):
def retrievePackage( self, package ):
# Determine the names the metadata and archive files would have respectively
metadataFilename = package + ".yaml"
contentsFilename = package + ".tar"
contentsFilename = package + self.contentsSuffix
# Begin determining if we need to download or not
# We start from the assumption we will need to download an archive
......@@ -171,7 +173,7 @@ class Archive(object):
def storePackage( self, package, archiveFileToInclude, scmRevision = '', extraMetadata=None ):
# Determine the names the metadata and archive files would have respectively
metadataFilename = package + ".yaml"
contentsFilename = package + ".tar"
contentsFilename = package + self.contentsSuffix
# Generate metadata for the package we are about to store
archiveMetadata = self.generateMetadataForFile( archiveFileToInclude, scmRevision, extraMetadata )
......@@ -219,7 +221,7 @@ class Archive(object):
def publishPackage( self, package ):
# Determine the names the metadata and archive files would have respectively
metadataFilename = package + ".yaml"
contentsFilename = package + ".tar"
contentsFilename = package + self.contentsSuffix
# Move the contents file first
# Assuming we're on the same file system this should be an atomic operation and thus instant
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment