Show versions to be installed

This commit is contained in:
mpeterv 2015-12-02 12:14:19 +03:00
parent 9dfa3e15e0
commit 1599b207ff

View File

@ -134,6 +134,7 @@ class Program(object):
self.source_kind = "fixed" self.source_kind = "fixed"
self.fetched = False self.fetched = False
self.version = version self.version = version
self.version_suffix = " " + version
elif "@" in version: elif "@" in version:
# Version from a git repo. # Version from a git repo.
self.source_kind = "git" self.source_kind = "git"
@ -157,6 +158,7 @@ class Program(object):
self.fetched = True self.fetched = True
self.commit = exec_command(True, "git rev-parse HEAD").strip() self.commit = exec_command(True, "git rev-parse HEAD").strip()
self.version_suffix = " @" + self.commit[:7]
else: else:
# Local directory. # Local directory.
self.source_kind = "local" self.source_kind = "local"
@ -169,6 +171,7 @@ class Program(object):
copy_dir(version, result_dir) copy_dir(version, result_dir)
os.chdir(result_dir) os.chdir(result_dir)
self.fetched = True self.fetched = True
self.version_suffix = ""
def fetch(self): def fetch(self):
if self.fetched: if self.fetched:
@ -212,7 +215,7 @@ class Program(object):
if not opts.ignore_installed: if not opts.ignore_installed:
if self.identifiers is not None and self.identifiers == installed_identifiers: if self.identifiers is not None and self.identifiers == installed_identifiers:
print("Requested {} version already installed".format(self.title)) print(self.title + self.version_suffix + " already installed")
return False return False
self.build() self.build()
@ -229,7 +232,14 @@ class Lua(Program):
else: else:
self.major_version = self.major_version_from_version() self.major_version = self.major_version_from_version()
if not self.version_suffix:
self.version_suffix = " " + self.major_version
self.set_compat() self.set_compat()
if self.compat != "default":
self.version_suffix += " (compat: {})".format(self.compat)
self.set_package_paths() self.set_package_paths()
@staticmethod @staticmethod
@ -308,14 +318,14 @@ class Lua(Program):
identifiers_to_string(self.identifiers)) identifiers_to_string(self.identifiers))
if os.path.exists(self.cached_build_path): if os.path.exists(self.cached_build_path):
print("Building " + self.title + " (cached)") print("Building " + self.title + self.version_suffix + " (cached)")
os.chdir(self.cached_build_path) os.chdir(self.cached_build_path)
return return
else: else:
self.cached_build_path = None self.cached_build_path = None
self.fetch() self.fetch()
print("Building " + self.title) print("Building " + self.title + self.version_suffix)
self.patch_default_paths() self.patch_default_paths()
self.apply_compat() self.apply_compat()
self.make() self.make()
@ -324,7 +334,7 @@ class Lua(Program):
copy_dir(".", self.cached_build_path) copy_dir(".", self.cached_build_path)
def install(self): def install(self):
print("Installing " + self.title) print("Installing " + self.title + self.version_suffix)
self.make_install() self.make_install()
class RioLua(Lua): class RioLua(Lua):
@ -438,14 +448,13 @@ class LuaRocks(Program):
def build(self): def build(self):
self.fetch() self.fetch()
print("Building LuaRocks") print("Building LuaRocks" + self.version_suffix)
run_command("./configure", "--prefix=" + quote(opts.location), run_command("./configure", "--prefix=" + quote(opts.location),
"--with-lua=" + quote(opts.location), "--force-config") "--with-lua=" + quote(opts.location), "--force-config")
run_command("make build") run_command("make build")
@staticmethod def install(self):
def install(): print("Installing LuaRocks" + self.version_suffix)
print("Installing LuaRocks")
run_command("make install") run_command("make install")
def get_manifest_name(): def get_manifest_name():