diff options
Diffstat (limited to 'bitbake/lib/bb/fetch/git.py')
-rw-r--r-- | bitbake/lib/bb/fetch/git.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py index f4ae724f87..aa26a500c7 100644 --- a/bitbake/lib/bb/fetch/git.py +++ b/bitbake/lib/bb/fetch/git.py | |||
@@ -27,15 +27,6 @@ from bb.fetch import Fetch | |||
27 | from bb.fetch import FetchError | 27 | from bb.fetch import FetchError |
28 | from bb.fetch import runfetchcmd | 28 | from bb.fetch import runfetchcmd |
29 | 29 | ||
30 | def prunedir(topdir): | ||
31 | # Delete everything reachable from the directory named in 'topdir'. | ||
32 | # CAUTION: This is dangerous! | ||
33 | for root, dirs, files in os.walk(topdir, topdown=False): | ||
34 | for name in files: | ||
35 | os.remove(os.path.join(root, name)) | ||
36 | for name in dirs: | ||
37 | os.rmdir(os.path.join(root, name)) | ||
38 | |||
39 | class Git(Fetch): | 30 | class Git(Fetch): |
40 | """Class to fetch a module or modules from git repositories""" | 31 | """Class to fetch a module or modules from git repositories""" |
41 | def supports(self, url, ud, d): | 32 | def supports(self, url, ud, d): |
@@ -107,7 +98,7 @@ class Git(Fetch): | |||
107 | runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) | 98 | runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d) |
108 | 99 | ||
109 | if os.path.exists(codir): | 100 | if os.path.exists(codir): |
110 | prunedir(codir) | 101 | bb.utils.prunedir(codir) |
111 | 102 | ||
112 | bb.mkdirhier(codir) | 103 | bb.mkdirhier(codir) |
113 | os.chdir(repodir) | 104 | os.chdir(repodir) |
@@ -119,7 +110,7 @@ class Git(Fetch): | |||
119 | runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d) | 110 | runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d) |
120 | 111 | ||
121 | os.chdir(repodir) | 112 | os.chdir(repodir) |
122 | prunedir(codir) | 113 | bb.utils.prunedir(codir) |
123 | 114 | ||
124 | def suppports_srcrev(self): | 115 | def suppports_srcrev(self): |
125 | return True | 116 | return True |