From fba7620021d32afb03cb10aa9d1ebb194721bb67 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 2 Oct 2014 18:34:47 +0100 Subject: import: omnibus.to_lorry improvements --- import/omnibus.to_lorry | 20 ++++++++++++++++---- morphlib/util.py | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/import/omnibus.to_lorry b/import/omnibus.to_lorry index ed2e552d..0172faad 100755 --- a/import/omnibus.to_lorry +++ b/import/omnibus.to_lorry @@ -49,9 +49,9 @@ class OmnibusLorryGenerator < Importer::Base exit 255 end - definitions_and_project, software_name = parsed_arguments - definitions_dir, _, project_name = definitions_and_project.rpartition('#') - [definitions_dir, project_name, software_name] + project_dir_and_name, software_name = parsed_arguments + project_dir, _, project_name = project_dir_and_name.rpartition('#') + [project_dir, project_name, software_name] end def generate_lorry_for_software(software) @@ -77,7 +77,19 @@ class OmnibusLorryGenerator < Importer::Base end def run - definitions_dir, project_name, software_name = parse_options(ARGV) + STDERR.puts("Current working directory: #{Dir.getwd}") + log.info("Current working directory: #{Dir.getwd}") + project_dir, project_name, software_name = parse_options(ARGV) + + log.info("Creating lorry for #{software_name} from project " + + "#{project_name}, defined in #{project_dir}") + + # Omnibus definitions are spread across multiple repos, and there is + # no stability guarantee for the definition format. The official advice + # is to use Bundler to execute Omnibus, so let's do that. + ensure_running_inside_bundler_exec(project_dir) + + STDERR.puts Omnibus.projects() project = Omnibus::Project.load(project_name) diff --git a/morphlib/util.py b/morphlib/util.py index 36ab4e21..a7424aed 100644 --- a/morphlib/util.py +++ b/morphlib/util.py @@ -172,7 +172,7 @@ def combine_aliases(app): # pragma: no cover m.group('prefix'), _expand(m.group('pull'), m.group('path')), _expand(m.group('push'), m.group('path'))) - elif '=' not in trove_id: + elif '=' not in trove_id and trove_id not in alias_map: alias_map[trove_id] = "%s=%s#%s" % ( trove_id, _expand('ssh', trove_id), -- cgit v1.2.1