mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-11 15:06:58 +02:00
cros_workon: collapse cros_workon_common.sh
cros_workon is the only user of cros_workon_common.sh This is pre-requisite to moving cros_workon into devutils.git BUG=11507 TEST=Ran ./cros_workon --board x86-generic --all list Change-Id: I1eab551ab33646360e507328932c151a0d36f50a Review URL: http://codereview.chromium.org/6347052
This commit is contained in:
parent
893fb5789f
commit
0295fffe88
29
cros_workon
29
cros_workon
@ -14,9 +14,6 @@
|
|||||||
# The path to common.sh should be relative to your script's location.
|
# The path to common.sh should be relative to your script's location.
|
||||||
. "$(dirname "$0")/common.sh"
|
. "$(dirname "$0")/common.sh"
|
||||||
|
|
||||||
# Load common functions for workon scripts.
|
|
||||||
. "$(dirname "$0")/lib/cros_workon_common.sh"
|
|
||||||
|
|
||||||
# Script must be run inside the chroot
|
# Script must be run inside the chroot
|
||||||
restart_in_chroot_if_needed $*
|
restart_in_chroot_if_needed $*
|
||||||
get_default_board
|
get_default_board
|
||||||
@ -98,6 +95,32 @@ if [ ! -L "${UNMASK_FILE}" ]; then
|
|||||||
die "ln -s ${WORKON_FILE} ${UNMASK_FILE}"
|
die "ln -s ${WORKON_FILE} ${UNMASK_FILE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
find_keyword_workon_ebuilds() {
|
||||||
|
keyword="${1}"
|
||||||
|
|
||||||
|
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 grep -l "inherit.*cros-workon" | \
|
||||||
|
xargs grep -l "KEYWORDS=.*${keyword}.*"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
show_workon_ebuilds() {
|
||||||
|
keyword=$1
|
||||||
|
|
||||||
|
find_keyword_workon_ebuilds ${keyword} | \
|
||||||
|
sed -e 's/.*\/\([^/]*\)\/\([^/]*\)\/.*\.ebuild/\1\/\2/' | \
|
||||||
|
sort -u
|
||||||
|
# This changes the absolute path to ebuilds into category/package.
|
||||||
|
}
|
||||||
|
|
||||||
# Canonicalize package name to category/package.
|
# Canonicalize package name to category/package.
|
||||||
canonicalize_name () {
|
canonicalize_name () {
|
||||||
local pkgfile
|
local pkgfile
|
||||||
|
Loading…
Reference in New Issue
Block a user