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 # Common library for functions used by workon tools. | 7 # Common library for functions used by workon tools. |
8 | 8 |
9 show_workon_ebuilds() { | 9 find_workon_ebuilds() { |
10 pushd "${BOARD_DIR}"/etc/ 1> /dev/null | 10 pushd "${BOARD_DIR}"/etc/ 1> /dev/null |
11 source make.conf | 11 source make.conf |
12 popd 1> /dev/null | 12 popd 1> /dev/null |
13 local CROS_OVERLAYS="${PORTDIR_OVERLAY}" | 13 local CROS_OVERLAYS="${PORTDIR_OVERLAY}" |
14 | 14 |
| 15 # NOTE: overlay may be a symlink, and we have to use ${overlay}/ |
15 for overlay in ${CROS_OVERLAYS}; do | 16 for overlay in ${CROS_OVERLAYS}; do |
16 pushd ${overlay} 1> /dev/null | 17 # only look up ebuilds named 9999 to eliminate duplicates |
17 find . -name '*.ebuild' | xargs fgrep cros-workon | \ | 18 find ${overlay}/ -name '*9999.ebuild' | xargs fgrep cros-workon | \ |
18 awk -F / '{ print $2 "/" $3 }' | uniq | sort | 19 sed -e 's/\([.]ebuild\):.*/\1/'|uniq |
19 popd 1> /dev/null | |
20 done | 20 done |
21 } | 21 } |
| 22 |
| 23 # wrapper script that caches the result of find_workon_ebuilds() |
| 24 show_workon_ebuilds_files() { |
| 25 if [ -z "${CROS_ALL_EBUILDS}" ]; then |
| 26 CROS_ALL_EBUILDS=$(find_workon_ebuilds) |
| 27 fi |
| 28 echo "${CROS_ALL_EBUILDS}" |
| 29 } |
| 30 |
| 31 show_workon_ebuilds() { |
| 32 show_workon_ebuilds_sources | \ |
| 33 sed -e 's/.*\/\([^/]*\)\/\([^/]*\)\/.*\.ebuild/\1\/\2/'| sort |
| 34 } |
OLD | NEW |