From 83dcd2b34cefd5b324b5a4f54be141a858dc5238 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Feb 2013 22:19:53 +0100 Subject: Generalization: - Rework install_dependencies: make it a global function, not per tools.build - Determine packet manager of local system (currently supports apt/dpkg and zypper/rpm) - Look for packet manager specific tools.conf.$MANAGER first, use tools.conf otherwise - Added list_package_files which should be used instead of "for $(dpkg -L | grep ...) ... >> ... done" --- remote/setup_tools | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'remote/setup_tools') diff --git a/remote/setup_tools b/remote/setup_tools index e96d8e2c..2af8abe5 100755 --- a/remote/setup_tools +++ b/remote/setup_tools @@ -27,12 +27,19 @@ read_config () unset REQUIRED_FILES unset REQUIRED_MODULES unset REQUIRED_PACKAGES + unset REQUIRED_DEPENDENCIES local TOOL_CONFIG="${TOOL_DIR}/${TOOL}/${TOOL}.conf" - [ ! -e "${TOOL_CONFIG}" ] && perror "Config for '$TOOL' not found." - - . "${TOOL_CONFIG}" || perror "Sourcing '${TOOL_CONFIG}' failed." + if [ -e "${TOOL_CONFIG}.${PACKET_MANAGER}" ]; then + # a specific tool.conf seems to exist, try to use that one + # TODO: Maybe move this down right after loading the generic one, to allow "overloading".... but might be a bit confusing + . "${TOOL_CONFIG}.${PACKET_MANAGER}" || perror "Sourcing '${TOOL_CONFIG}.${PACKET_MANAGER}' failed." + else + # otherwise, use the generic one + [ ! -e "${TOOL_CONFIG}" ] && perror "Config for '$TOOL' not found." + . "${TOOL_CONFIG}" || perror "Sourcing '${TOOL_CONFIG}' failed." + fi } read_build () -- cgit v1.2.3-55-g7522