Maroloccio has uploaded a new change for review. https://gerrit.wikimedia.org/r/277078
Change subject: Add ability to specify device to pullfiles.bash ...................................................................... Add ability to specify device to pullfiles.bash Change-Id: I9e25d7ff6a65c07b280a88ecdfb0a4bb823b3614 --- M scripts/pullfiles.bash 1 file changed, 28 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/78/277078/1 diff --git a/scripts/pullfiles.bash b/scripts/pullfiles.bash index bdd0f27..b9f9c92 100755 --- a/scripts/pullfiles.bash +++ b/scripts/pullfiles.bash @@ -1,3 +1,29 @@ -#!/usr/bin/env bash +#! /usr/bin/env bash + # Pulls all files from the device and extracts them under app/ -adb backup -noapk org.wikipedia && dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf - +# +# Allows specifying a device serial number or qualifier + +# Python-based decompression, to avoid binary dependencies +read -r -d '' python_commands <<- 'EOF' +import zlib +import sys + +sys.stdout.write(zlib.decompress(sys.stdin.read())) +EOF + +device_id=$1 + +if [[ $device_id ]]; then + device_specifier="-s $device_id" +else + device_specifier= +fi + +adb $device_specifier backup -noapk org.wikipedia \ + && \ +dd if=backup.ab bs=1 skip=24 \ +\ +| python -c "$python_commands" \ +\ +| tar -xvf - -- To view, visit https://gerrit.wikimedia.org/r/277078 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e25d7ff6a65c07b280a88ecdfb0a4bb823b3614 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Maroloccio <maroloc...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits