mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 06:26:57 +02:00
cros_workon: introduce a very simple listall command
TBR: sosa, msb - I already got the LGTM, then made a silly whitespace change! Review URL: http://codereview.chromium.org/2909009
This commit is contained in:
parent
07bfc7aa9d
commit
8683b8082f
30
cros_workon
30
cros_workon
@ -29,11 +29,18 @@ FLAGS_HELP="usage: $0 <command> [flags]
|
|||||||
commands:
|
commands:
|
||||||
start: Moves an ebuild to live (intended to support development)
|
start: Moves an ebuild to live (intended to support development)
|
||||||
stop: Moves an ebuild to stable (use last known good)
|
stop: Moves an ebuild to stable (use last known good)
|
||||||
list: List of all live ebuilds
|
list: List of current live ebuilds
|
||||||
|
listall: List all possible cros-workon ebuilds
|
||||||
forall: For each ebuild, cd to the source dir and run a commond"
|
forall: For each ebuild, cd to the source dir and run a commond"
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
eval set -- "${FLAGS_ARGV}"
|
eval set -- "${FLAGS_ARGV}"
|
||||||
|
|
||||||
|
|
||||||
|
# eat the workon command keywords: start, stop or list.
|
||||||
|
WORKON_CMD=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
|
||||||
# board dir config
|
# board dir config
|
||||||
[ -n "${FLAGS_board}" ] && [ "${FLAGS_host}" = ${FLAGS_TRUE} ] && \
|
[ -n "${FLAGS_board}" ] && [ "${FLAGS_host}" = ${FLAGS_TRUE} ] && \
|
||||||
die "Flags --host and --board are mutually exclusive."
|
die "Flags --host and --board are mutually exclusive."
|
||||||
@ -48,12 +55,6 @@ else
|
|||||||
EQUERY=equery
|
EQUERY=equery
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# eat the workon command keywords: start, stop or list.
|
|
||||||
WORKON_CMD=$1
|
|
||||||
shift
|
|
||||||
|
|
||||||
|
|
||||||
KEYWORDS_DIR=${BOARD_DIR}/etc/portage/package.keywords
|
KEYWORDS_DIR=${BOARD_DIR}/etc/portage/package.keywords
|
||||||
UNMASK_DIR=${BOARD_DIR}/etc/portage/package.unmask
|
UNMASK_DIR=${BOARD_DIR}/etc/portage/package.unmask
|
||||||
KEYWORDS_FILE=${KEYWORDS_DIR}/cros-workon
|
KEYWORDS_FILE=${KEYWORDS_DIR}/cros-workon
|
||||||
@ -159,10 +160,25 @@ ebuild_forall() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_workon_ebuilds() {
|
||||||
|
pushd "${BOARD_DIR}"/etc/ 1> /dev/null
|
||||||
|
source make.conf
|
||||||
|
popd 1> /dev/null
|
||||||
|
local CROS_OVERLAYS="${PORTDIR_OVERLAY}"
|
||||||
|
|
||||||
|
for overlay in ${CROS_OVERLAYS}; do
|
||||||
|
pushd ${overlay} 1> /dev/null
|
||||||
|
find . -name '*.ebuild' | xargs fgrep cros-workon | \
|
||||||
|
awk -F / '{ print $2 "/" $3 }' | uniq | sort
|
||||||
|
popd 1> /dev/null
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
case ${WORKON_CMD} in
|
case ${WORKON_CMD} in
|
||||||
start) ebuild_to_live "${ATOM_LIST}" ;;
|
start) ebuild_to_live "${ATOM_LIST}" ;;
|
||||||
stop) ebuild_to_stable "${ATOM_LIST}" ;;
|
stop) ebuild_to_stable "${ATOM_LIST}" ;;
|
||||||
list) show_live_ebuilds ;;
|
list) show_live_ebuilds ;;
|
||||||
forall) ebuild_forall "${ATOM_LIST}" ;;
|
forall) ebuild_forall "${ATOM_LIST}" ;;
|
||||||
|
listall)show_workon_ebuilds ;;
|
||||||
*) die "invalid cros_workon command" ;;
|
*) die "invalid cros_workon command" ;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user