Skip to content

Commit 5074f29

Browse files
committed
toolchain: update submodules fixes and copytree except of symlinking
* now updates the submodules better * uses shutil.copytree to copy the git repo to the build dir * always looks for updates on git
1 parent 306aad4 commit 5074f29

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pythonforandroid/toolchain.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,8 +1390,10 @@ def report_hook(index, blksize, size):
13901390
return target
13911391
elif parsed_url.scheme in ('git',):
13921392
if os.path.isdir(target):
1393-
with current_directory(self.get_build_dir(arch.arch)):
1394-
shprint(sh.git, 'pull', '--all')
1393+
with current_directory(target):
1394+
shprint(sh.git, 'pull')
1395+
shprint(sh.git, 'pull', '--recurse-submodules')
1396+
shprint(sh.git, 'submodule', 'update', '--recursive')
13951397
else:
13961398
shprint(sh.git, 'clone', '--recursive', url, target)
13971399
return target
@@ -1588,7 +1590,7 @@ def download(self):
15881590
do_download = True
15891591

15901592
marker_filename = '.mark-{}'.format(filename)
1591-
if exists(filename):
1593+
if exists(filename) and os.path.isfile(filename):
15921594
if not exists(marker_filename):
15931595
shprint(sh.rm, filename)
15941596
elif self.md5sum:
@@ -1680,7 +1682,7 @@ def unpack(self, arch):
16801682
raise Exception('Could not extract {} download, it must be .zip, '
16811683
'.tar.gz or .tar.bz2')
16821684
elif os.path.isdir(extraction_filename):
1683-
os.symlink(extraction_filename, directory_name)
1685+
shutil.copytree(extraction_filename, directory_name)
16841686
else:
16851687
raise Exception('Given path is neither a file nor a directory: {}'.format(extraction_filename))
16861688

0 commit comments

Comments
 (0)