* handle exceptions at pisi-install CLI

This commit is contained in:
Eray Özkural
2005-06-24 13:45:21 +00:00
parent 9178b8bc55
commit 33591dc101
2 changed files with 7 additions and 6 deletions
+5 -5
View File
@@ -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
View File
@@ -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)