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