Merge branch 'master' into 'develop'

Master

See merge request sulinos/devel/inary!15
......@@ -57,7 +57,7 @@ def handle_exception(exception, value, tb):
elif isinstance(value, inary.errors.Exception):
show_traceback = True
ui.error(_("\nUnhandled internal exception.\n"
"Please file a bug report to <http://bugs.sulin.org>."))
"Please file a bug report to <https://github.com/SulinOS/inary/issues>."))
elif isinstance(value, IOError) and value.errno == errno.EPIPE:
# Ignore broken pipe errors
sys.exit(0)
......
......@@ -668,7 +668,7 @@ class Remove(AtomicOperation):
def run_postremove(self):
if ('postOps' in self.metadata.package.isA):
ctx.ui.info(_('Post-remove configuration have been run for \"{}\"'.format(self.package_name)),color='brightyellow')
self.trigger.postremove(self.ops_script)
self.trigger.postremove(self.package.pkg_dir())
def update_databases(self):
self.remove_db()
......
......@@ -44,7 +44,7 @@ def configure_pending(packages=None):
ops_Dir=os.path.join(ctx.config.packages_dir(), "postoperations")
ctx.ui.notify(inary.ui.configuring, package=pkginfo, files=None)
inary.trigger.Trigger().postinstall(ops_Dir, x)
inary.trigger.Trigger().postinstall(ops_Dir)
ctx.ui.notify(inary.ui.configured, package=pkginfo, files=None)
installdb.clear_pending(x)
......
......@@ -26,6 +26,7 @@ import inary.data
import inary.errors
import inary.context as ctx
import inary.trigger
import os
def reconfigure(packages=None):
......@@ -38,7 +39,7 @@ def reconfigure(packages=None):
pkginfo = installdb.get_package(x)
ops_Dir=os.path.join(ctx.config.packages_dir(), "postoperations")
ctx.ui.notify(inary.ui.configuring, package=pkginfo, files=None)
inary.trigger.Trigger().postinstall(ops_Dir, x)
inary.trigger.Trigger().postinstall(ops_Dir)
ctx.ui.notify(inary.ui.configured, package=pkginfo, files=None)
installdb.clear_pending(x)
......
......@@ -87,14 +87,12 @@ class InstallDB(lazydb.LazyDB):
@staticmethod
def __generate_installed_pkgs():
installed_list=[]
def split_name(dirname):
name, version, release = dirname.rsplit("-", 2)
installed_list.append((name, version + "-" + release))
name, version, release = dirname.rsplit("-", 2)
installed_list.append((name, version + "-" + release))
for i in os.listdir(ctx.config.packages_dir()):
split_name(i)
return dict(installed_list)
@staticmethod
......
......@@ -99,7 +99,7 @@ def install_pkg_names(A, reinstall=False, extra=False):
_("Downloading") + str(" [ {:>" + str(lndig) + "} / {} ] => [{}]").format(order.index(x) + 1, len(order),
x), color="yellow")
install_op = atomicoperations.Install.from_name(x)
install_op.store_inary_files()
install_op.store_postops()
paths.append(install_op.package_fname)
if x in extra_packages or (extra and x in A):
......@@ -128,6 +128,7 @@ def install_pkg_names(A, reinstall=False, extra=False):
for path in paths:
install_op = atomicoperations.Install(path)
ctx.ui.info(_("Installing") + str(" [ {:>"+str(lndig)+ "} / {} ]").format(paths.index(path) + 1, len(paths)), color="yellow")
install_op.store_inary_files()
install_op.install(False)
try:
with open(os.path.join(ctx.config.info_dir(), ctx.const.installed_extra), "a") as ie_file:
......@@ -136,6 +137,7 @@ def install_pkg_names(A, reinstall=False, extra=False):
except KeyError:
pass
for path in paths:
install_op = atomicoperations.Install(path)
install_op.postinstall()
......
......@@ -53,13 +53,19 @@ def t(name, path, command):
status = 0
if os.path.isdir(path) == True:
if getltime(name) != getmtime(path):
sys.stdout.write(_("\n\x1b[33m [-] Process triggering for \x1b[;0m{}".format(name)))
sys.stdout.write("\n\x1b[33m " + \
_("[-] Process triggering for ") + \
"\x1b[;0m{}".format(name))
status = os.system(command + " &>/dev/null")
setltime(name, getmtime(path))
if status != 0:
sys.stdout.write("\r\x1b[K\x1b[31;1m [!] Triggering end with \x1b[;0m{}".format(status))
sys.stdout.write("\r\x1b[K\x1b[31;1m " + \
_("[!] Triggering end with ") + \
"\x1b[;0m{}".format(status))
else:
sys.stdout.write(_("\r\x1b[K\x1b[32;1m [+] Process triggered for \x1b[;0m{}".format(name)))
sys.stdout.write("\r\x1b[K\x1b[32;1m " + \
_("[+] Process triggered for " + \
"\x1b[;0m{}".format(name)))
def t_r(name, path, command):
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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