| OLD | NEW |
| (Empty) |
| 1 #!/bin/bash | |
| 2 | |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 # Load common constants. This should be the first executable line. | |
| 8 # The path to common.sh should be relative to your script's location. | |
| 9 . "$(dirname "$0")/common.sh" | |
| 10 | |
| 11 assert_inside_chroot | |
| 12 assert_not_root_user | |
| 13 | |
| 14 # Flags | |
| 15 DEFINE_string architecture armel "The architecture to fetch." a | |
| 16 | |
| 17 # Parse command line | |
| 18 FLAGS "$@" || exit 1 | |
| 19 eval set -- "${FLAGS_ARGV}" | |
| 20 | |
| 21 # Die on error | |
| 22 set -e | |
| 23 | |
| 24 LOCAL_PKG_DIR="${DEFAULT_BUILD_ROOT}/${FLAGS_architecture}/local_packages" | |
| 25 | |
| 26 mkdir -p "${LOCAL_PKG_DIR}" | |
| 27 cd "${LOCAL_PKG_DIR}" | |
| 28 | |
| 29 DEB_BUILD_ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH)" | |
| 30 | |
| 31 DEBS= | |
| 32 for SRC; do | |
| 33 SRCCACHE="$(apt-cache showsrc "$SRC")" | |
| 34 BINS="$(echo "$SRCCACHE" | grep -m1 ^Binary: | cut -d' ' -f2- | sed 's/,//g')" | |
| 35 VER="$(echo "$SRCCACHE" | grep -m1 ^Version: | cut -d' ' -f2)" | |
| 36 for BIN in $BINS; do | |
| 37 BINCACHE="$(apt-cache show "$BIN")" || continue # might be a udeb | |
| 38 DEB="$(echo "$BINCACHE" | grep -m1 ^Filename: | cut -d' ' -f2 | sed "s/_${DE
B_BUILD_ARCH}\.deb/_${FLAGS_architecture}.deb/")" | |
| 39 wget -N "http://ports.ubuntu.com/ubuntu-ports/${DEB}" | |
| 40 DEBS="$DEBS ${DEB##*/}" | |
| 41 done | |
| 42 cat >"${SRC}_${VER#*:}_${FLAGS_architecture}.changes" <<EOF | |
| 43 Version: $VER | |
| 44 Fake: yes | |
| 45 EOF | |
| 46 done | |
| 47 | |
| 48 if [ "$DEBS" ]; then | |
| 49 chromiumos-build --convert -a "${FLAGS_architecture}" $DEBS | |
| 50 fi | |
| OLD | NEW |