* handle exceptions at pisi-install CLI
This commit is contained in:
+5
-5
@@ -38,13 +38,13 @@ def main():
|
||||
else:
|
||||
package_fn = args[0]
|
||||
|
||||
# try:
|
||||
try:
|
||||
ui.info('* Installing ' + package_fn)
|
||||
pisi.install.install(package_fn)
|
||||
# except pisi.install.InstallError, (errno, errstr):
|
||||
# print '*** An installation error has occured:'
|
||||
# print ' ', errstr
|
||||
# sys.exit(1)
|
||||
except pisi.install.InstallError, estr:
|
||||
print '*** An installation error has occured:'
|
||||
print ' ', estr
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
+2
-1
@@ -39,7 +39,8 @@ def installable(pkg):
|
||||
"""calculate if pkg is installable currently
|
||||
which means it has to satisfy both install and runtime dependencies"""
|
||||
if not packagedb.has_package(pkg):
|
||||
ui.info("package " + pkg + " not installable");
|
||||
ui.info("package " + pkg +
|
||||
" is not installable due to lacking dependencies\n");
|
||||
return False
|
||||
else:
|
||||
return satisfiesRuntimeDeps(pkg) and satisfiesInstallDeps(pkg)
|
||||
|
||||
Reference in New Issue
Block a user