|
@@ -522,9 +522,17 @@ class Git(FetchMethod):
|
|
|
def clean(self, ud, d):
|
|
|
""" clean the git directory """
|
|
|
|
|
|
- bb.utils.remove(ud.localpath, True)
|
|
|
- bb.utils.remove(ud.fullmirror)
|
|
|
- bb.utils.remove(ud.fullmirror + ".done")
|
|
|
+ to_remove = [ud.localpath, ud.fullmirror, ud.fullmirror + ".done"]
|
|
|
+ # The localpath is a symlink to clonedir when it is cloned from a
|
|
|
+ # mirror, so remove both of them.
|
|
|
+ if os.path.islink(ud.localpath):
|
|
|
+ clonedir = os.path.realpath(ud.localpath)
|
|
|
+ to_remove.append(clonedir)
|
|
|
+
|
|
|
+ for r in to_remove:
|
|
|
+ if os.path.exists(r):
|
|
|
+ bb.note('Removing %s' % r)
|
|
|
+ bb.utils.remove(r, True)
|
|
|
|
|
|
def supports_srcrev(self):
|
|
|
return True
|