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