88
99from ordered_set import OrderedSet as set
1010from pisi import translate as _
11+ from pisi import Error
1112
1213import pisi
1314import pisi .context as ctx
@@ -174,7 +175,7 @@ def install_pkg_files(package_URIs, reinstall=False):
174175
175176 for x in package_URIs :
176177 if not x .endswith (ctx .const .package_suffix ):
177- raise Exception (_ ("Mixing file names and package names not supported yet." ))
178+ raise Error (_ ("Mixing file names and package names not supported yet." ))
178179
179180 # filter packages that are already installed
180181 tobe_installed , already_installed = [], set ()
@@ -229,7 +230,7 @@ def install_pkg_files(package_URIs, reinstall=False):
229230 pkg .distributionRelease
230231 != ctx .config .values .general .distribution_release
231232 ):
232- raise Exception (
233+ raise Error (
233234 _ (
234235 "Package %s is not compatible with your distribution release %s %s."
235236 )
@@ -240,7 +241,7 @@ def install_pkg_files(package_URIs, reinstall=False):
240241 )
241242 )
242243 if pkg .architecture != ctx .config .values .general .architecture :
243- raise Exception (
244+ raise Error (
244245 _ ("Package %s (%s) is not compatible with your %s architecture." )
245246 % (x , pkg .architecture , ctx .config .values .general .architecture )
246247 )
@@ -267,7 +268,7 @@ def satisfiesDep(dep):
267268 # be satisfied by installing packages from the repo
268269 for dep in dep_unsatis :
269270 if not dep .satisfied_by_repo ():
270- raise Exception (_ ("External dependencies not satisfied: %s" ) % dep )
271+ raise Error (_ ("External dependencies not satisfied: %s" ) % dep )
271272
272273 # if so, then invoke install_pkg_names
273274 extra_packages = [x .package for x in dep_unsatis ]
@@ -280,7 +281,7 @@ def satisfiesDep(dep):
280281 )
281282 ctx .ui .info (util .format_by_columns (sorted (extra_packages )))
282283 if not ctx .ui .confirm (_ ("Do you want to continue?" )):
283- raise Exception (_ ("External dependencies not satisfied" ))
284+ raise Error (_ ("External dependencies not satisfied" ))
284285 install_pkg_names (extra_packages , reinstall = True )
285286
286287 class PackageDB :
@@ -375,7 +376,7 @@ def plan_install_pkg_names(A):
375376 # we don't deal with already *satisfied* dependencies
376377 if not dep .satisfied_by_installed ():
377378 if not dep .satisfied_by_repo ():
378- raise Exception (
379+ raise Error (
379380 _ ("%s dependency of package %s is not satisfied" )
380381 % (dep , pkg .name )
381382 )
0 commit comments