diff --git a/pisi/archive.py b/pisi/archive.py index e9651655..5e428a38 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -146,10 +146,9 @@ class ArchiveZip(ArchiveBase): ofile = os.path.join(target_dir, outpath) if is_dir: # this is a directory - try: # To get rid of Error:[Errno 17] File exists: errors - os.makedirs(os.path.join(target_dir, outpath)) - except OSError: - pass + d = os.path.join(target_dir, outpath) + if not os.path.isdir(d): + os.makedirs(d) continue # check that output dir is present diff --git a/pisi/operations.py b/pisi/operations.py index 002a8b3d..cde7ddda 100644 --- a/pisi/operations.py +++ b/pisi/operations.py @@ -44,12 +44,12 @@ def remove_single(package_name): if os.path.isfile(fpath): os.rename(fpath, fpath + ".pisi") else: - try: + # check if file is removed manually. + # And we don't remove directories! + # FIXME: should give a warning if it is... + if os.path.isfile(fpath): os.unlink(fpath) - except OSError: - # file is removed (maybe manually) - # FIXME: should give a warning - pass + ctx.installdb.remove(package_name) packagedb.remove_package(package_name)