flatcar-scripts/lib/cros_workon_common.sh
Zdenek Behan 2654f24e1b cros_workon_common: fix a last minute rename :/
* Let's face it: I broke it in the last second when i renamed the function but not
the place where it's being called, and now cros_workon is dead.

	modified:   lib/cros_workon_common.sh

Review URL: http://codereview.chromium.org/3052025
2010-07-29 14:23:36 -07:00

35 lines
1017 B
Bash

#!/bin/bash
# Copyright (c) 2010 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.
# Common library for functions used by workon tools.
find_workon_ebuilds() {
pushd "${BOARD_DIR}"/etc/ 1> /dev/null
source make.conf
popd 1> /dev/null
local CROS_OVERLAYS="${PORTDIR_OVERLAY}"
# NOTE: overlay may be a symlink, and we have to use ${overlay}/
for overlay in ${CROS_OVERLAYS}; do
# only look up ebuilds named 9999 to eliminate duplicates
find ${overlay}/ -name '*9999.ebuild' | xargs fgrep cros-workon | \
sed -e 's/\([.]ebuild\):.*/\1/'|uniq
done
}
# wrapper script that caches the result of find_workon_ebuilds()
show_workon_ebuilds_files() {
if [ -z "${CROS_ALL_EBUILDS}" ]; then
CROS_ALL_EBUILDS=$(find_workon_ebuilds)
fi
echo "${CROS_ALL_EBUILDS}"
}
show_workon_ebuilds() {
show_workon_ebuilds_files | \
sed -e 's/.*\/\([^/]*\)\/\([^/]*\)\/.*\.ebuild/\1\/\2/'| sort
}