* 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: 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
View File
@@ -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)