diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2013-03-14 14:41:59 +0000 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2013-03-14 14:41:59 +0000 |
commit | ac1517feff21cdd27851a9f649bfb670f89115c5 (patch) | |
tree | c16cd6d4e9e6b8b91ba52f76acdd51572e88fe2c /scripts/find-artifacts | |
parent | 6e8f9eae1b8f57b8f97afd4b65b7571f490670d6 (diff) | |
download | morph-ac1517feff21cdd27851a9f649bfb670f89115c5.tar.gz |
Remove obsolete script
Diffstat (limited to 'scripts/find-artifacts')
-rwxr-xr-x | scripts/find-artifacts | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/scripts/find-artifacts b/scripts/find-artifacts deleted file mode 100755 index 462126fc..00000000 --- a/scripts/find-artifacts +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (C) 2011-2013 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -# This is a program to read the metadata of a baserock image to produce a list -# of all the chunks needed to build said image. - -import json -import os -import tempfile -import gzip -import sys -import glob - -import cliapp - -path = os.path.dirname(os.path.dirname(__file__)) -sys.path.append(path) -import morphlib - -class FindArtifacts(morphlib.app.Morph): - - def process_args(self, args): - artifacts_dir = os.path.join(self.settings['cachedir'], 'artifacts') - - # args[0] is the path to the built image. - artifact = args[0] - - def find_artifacts(dirname): - metadirs = [ - os.path.join(dirname, 'factory', 'baserock'), - os.path.join(dirname, 'baserock') - ] - existing_metadirs = [x for x in metadirs if os.path.isdir(x)] - if not existing_metadirs: - raise NotASystemArtifactError(artifact) - metadir = existing_metadirs[0] - for basename in glob.glob(os.path.join(metadir, '*.meta')): - metafile = os.path.join(metadir, basename) - metadata = json.load(open(metafile)) - cache_key = metadata['cache-key'] - artifact_glob = os.path.join(artifacts_dir, cache_key) + '*' - found_artifacts = glob.glob(artifact_glob) - if not found_artifacts: - raise cliapp.AppException('Could not find cache-key ' - + cache_key + ' for artifact ' - + metajson['artifact-name']) - for cached_file in found_artifacts: - self.output.write(cached_file + "\n") - - morphlib.bins.call_in_artifact_directory( - self, artifact, find_artifacts) - -FindArtifacts().run() |