| #!/bin/bash |
| |
| # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| set -e |
| |
| DEVKIT_URL=$(grep ^CHROMEOS_DEVSERVER /etc/lsb-release | cut -d = -f 2-) |
| if [ "x" = "x$DEVKIT_URL" ] |
| then |
| echo "No devkit server specified in /etc/lsb-release" |
| exit 1 |
| fi |
| |
| LOCAL_REPO_DIR="/var/cache/local_repo" |
| mkdir -p $LOCAL_REPO_DIR |
| |
| echo "Building and downloading $1" |
| wget $DEVKIT_URL/build?pkg\=$1 -O $LOCAL_REPO_DIR/$1 |
| |
| DEB_NAME=$(cat $LOCAL_REPO_DIR/$1) || true |
| if [ "x" = "x$DEB_NAME" ] |
| then |
| echo "Packages built but nothing to download. You may have to autoupdate" |
| exit 0 |
| fi |
| |
| echo "Downloading $DEB_NAME" |
| |
| wget $DEVKIT_URL/static/$DEB_NAME -O $LOCAL_REPO_DIR/$DEB_NAME |
| echo "Installing $LOCAL_REPO_DIR/$DEB_NAME" |
| |
| dpkg --install $LOCAL_REPO_DIR/$DEB_NAME |