From 396865b5968bb37efe60744053f7d172090f72b2 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Wed, 17 Jun 2009 11:12:56 +0000 Subject: [PATCH] - Give an error when an abandoned file exists - Add abandoned files exception --- pisi/operations/build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pisi/operations/build.py b/pisi/operations/build.py index 8b9c6f87..0425355e 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -48,6 +48,9 @@ class Error(pisi.Error): class ActionScriptException(Error): pass +class AbandonedFilesException(Error): + pass + # Helper Functions def get_file_type(path, pinfo_list, install_dir): """Return the file type of a path according to the given PathInfo @@ -998,9 +1001,10 @@ class Builder: if ctx.get_option('debug'): abandoned_files = self.get_abandoned_files() if abandoned_files: - ctx.ui.warning(_('There are abandoned files under the install dir (%s):') % (install_dir)) + ctx.ui.error(_('There are abandoned files under the install dir (%s):') % (install_dir)) for f in abandoned_files: ctx.ui.info(' - %s' % (f)) + raise AbandonedFilesException else: ctx.ui.info(_('All of the files under the install dir (%s) has been collected by package(s)') % (install_dir))