Ticket #171 (closed defect: fixed)
Uninstall activities that use symlinks
| Reported by: | erikos | Owned by: | erikos |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | sugar | Version: | Git as of bugdate |
| Severity: | Keywords: | r+ | |
| Cc: | tomeu | Distribution/OS: | |
| Bug Status: |
Description
This is a follow up on #95. The activity bundle http://dev.laptop.org/~bemasc/ACBLSCOR-1.xo contains symlinks that point to a directory and are therefore returned by os.walk as directories. As the directories are removed in any case we must remove the symlink.
diff --git a/src/sugar/bundle/bundle.py b/src/sugar/bundle/bundle.py
index ed0360d..a1b2686 100644
--- a/src/sugar/bundle/bundle.py
+++ b/src/sugar/bundle/bundle.py
@@ -191,5 +191,9 @@ class Bundle(object):
for name in files:
os.remove(os.path.join(root, name))
for name in dirs:
- os.rmdir(os.path.join(root, name))
+ path = os.path.join(root, name)
+ if os.path.islink(path):
+ os.remove(path)
+ else:
+ os.rmdir(path)
os.rmdir(install_path)
Change History
Note: See
TracTickets for help on using
tickets.
