Skip to content

Instantly share code, notes, and snippets.

@Roboe

Roboe/README.md

Last active Sep 1, 2016
Embed
What would you like to do?
FP2 blobs downloader

Fairphone FP2 proprietary vendor files downloader

https://code.fairphone.com/projects/fp-osos/dev/fp2-blobs-download-page.html

Procedure

git init
chmod +x update-blobs.sh

Single blobs-package version:

./update-blobs.sh <version>

Multiple blobs-package versions (will take more time):

VERSIONS="2.0.0 2.0.1 16.04.0 16.05.0 16.06.0 16.07.0"
for v in $VERSIONS; do
  ./update-blobs.sh $v
done
read() {
yn="y"
}
#!/bin/bash
[ -z "$1" ] && [ -z "$VERSION" ] && echo "No version supplied" && exit 1
[ -z "$VERSION" ] && VERSION=$1
EXTRACT_RC="$PWD/extract.rc"
function say {
[[ "$#" != 0 ]] && echo -e "\033[1m~ $1 \e[0m"
}
say "Clearing 'vendor' and 'out' folders..."
rm -rf vendor/ out/
say "Downloading blobs..."
wget https://code.fairphone.com/downloads/FP2/blobs/fp2-sibon-$VERSION-blobs.tgz &&
tar xvf fp2-sibon-$VERSION-blobs.tgz &&
BASH_ENV="$EXTRACT_RC" bash ./fp2-sibon-$VERSION-blobs.sh &&
rm -rf fp2-sibon-$VERSION-blobs.tgz fp2-sibon-$VERSION-blobs.sh
say "Executing 'vendorsetup.sh'..."
for f in `find -L vendor -maxdepth 4 -name 'vendorsetup.sh'`; do source $f; done; unset f
say "Committing updates..."
git add vendor/ out/ &&
git commit -m "Update blobs to $VERSION"
say "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment