Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused extract_source() method #1143

Merged
merged 1 commit into from
Nov 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions pythonforandroid/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,43 +168,6 @@ def report_hook(index, blksize, size):
shprint(sh.git, 'submodule', 'update', '--recursive')
return target

def extract_source(self, source, cwd):
"""
(internal) Extract the `source` into the directory `cwd`.
"""
if not source:
return
if isfile(source):
info("Extract {} into {}".format(source, cwd))

if source.endswith(".tgz") or source.endswith(".tar.gz"):
shprint(sh.tar, "-C", cwd, "-xvzf", source)

elif source.endswith(".tbz2") or source.endswith(".tar.bz2"):
shprint(sh.tar, "-C", cwd, "-xvjf", source)

elif source.endswith(".zip"):
zf = zipfile.ZipFile(source)
zf.extractall(path=cwd)
zf.close()

else:
warning(
"Error: cannot extract, unrecognized extension for {}"
.format(source))
raise Exception()

elif isdir(source):
info("Copying {} into {}".format(source, cwd))

shprint(sh.cp, '-a', source, cwd)

else:
warning(
"Error: cannot extract or copy, unrecognized path {}"
.format(source))
raise Exception()

# def get_archive_rootdir(self, filename):
# if filename.endswith(".tgz") or filename.endswith(".tar.gz") or \
# filename.endswith(".tbz2") or filename.endswith(".tar.bz2"):
Expand Down