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 # Lists all package dependencies of a particular package. Useful to find out | 7 # Lists all package dependencies of a particular package. Useful to find out |
8 # all packages depended on by chromeos and chromeos-dev. | 8 # all packages depended on by chromeos and chromeos-dev. |
9 | 9 |
10 . "$(dirname "$0")/common.sh" | 10 . "$(dirname "$0")/common.sh" |
11 | 11 |
12 # Script must be run inside the chroot. | 12 # Script must be run inside the chroot. |
13 assert_inside_chroot | 13 assert_inside_chroot |
14 | 14 |
15 get_default_board | 15 get_default_board |
16 | 16 |
17 # Flags. | 17 # Flags. |
18 DEFINE_string board "$DEFAULT_BOARD" \ | 18 DEFINE_string board "$DEFAULT_BOARD" \ |
19 "The board for which the image was built." b | 19 "The board for which the image was built." b |
20 | 20 |
21 # Parse flags. | 21 # Parse flags. |
22 FLAGS "$@" || exit 1 | 22 FLAGS "$@" || exit 1 |
| 23 eval set -- "${FLAGS_ARGV}" |
| 24 |
| 25 [[ -z "${FLAGS_board}" ]] && die "A board must be specified." |
23 | 26 |
24 if [[ -z "${FLAGS_ARGV}" ]]; then | 27 if [[ -z "${FLAGS_ARGV}" ]]; then |
25 echo "Please specify package." | 28 warn "Please specify package." |
26 echo "Usage: ./get_package_list.sh chromeos-base/chromeos > package.list" | 29 die "Usage: ./get_package_list.sh chromeos-base/chromeos > package.list" |
27 exit 1 | |
28 fi | 30 fi |
29 | 31 |
30 emerge-$FLAGS_board --emptytree --usepkgonly -p -v --columns \ | 32 emerge-$FLAGS_board --emptytree --usepkgonly -p -v --columns \ |
31 $1 2> /dev/null | cut -d ' ' -f 8 | grep '/' | 33 $1 2> /dev/null | cut -d ' ' -f 8 | grep '/' |
OLD | NEW |