[Bugs] #171 MAJO: Uninstall activities that use symlinks
SugarLabs Bugs
bugtracker-noreply at sugarlabs.org
Sun Jan 4 07:43:12 EST 2009
#171: Uninstall activities that use symlinks
--------------------+-------------------------------------------------------
Reporter: erikos | Owner: marcopg
Type: defect | Status: new
Priority: major | Milestone:
Component: sugar | Version: Git as of bugdate
Keywords: r? |
--------------------+-------------------------------------------------------
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)
}}}
--
Ticket URL: <http://dev.sugarlabs.org/ticket/171>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list