From: Michael Tremer Date: Sat, 31 Oct 2009 13:15:40 +0000 (+0100) Subject: naoki: Mix of changes. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6edb7ef6bef9e0c0fb7c6399a1ac303e809e3d8c;p=ipfire-3.x.git naoki: Mix of changes. (Wasn't able to break this down to several commits.) * Added QA. * Fixed downloading. * Fixed logging. --- diff --git a/pkgs/Config b/pkgs/Config index 77055cf7c..12d2e1416 100644 --- a/pkgs/Config +++ b/pkgs/Config @@ -25,7 +25,7 @@ endif THISAPP = $(PKG_NAME)-$(PKG_VER) DIR_APP = $(DIR_SRC)/$(THISAPP) -DIR_DL = $(DIR_SRC)/cache/tarballs +DIR_DL = $(BASEDIR)/cache/tarballs DIR_PATCHES = $(DIR_DL)/../patches DIR_SRC = $(ROOT)/usr/src DIR_TMP = /tmp @@ -54,6 +54,7 @@ PKG_BUILD_DEPS ?= $(TC_PACKAGES) DO_EXTRACT = $(DIR_TOOLS)/extractor DO_LOAD = $(DIR_TOOLS)/downloader http://source.ipfire.org/source-3.x/$@ DO_PATCHES = cd $(DIR_APP) && $(DIR_TOOLS)/patch $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch)) +DO_QUALITY_AGENT = $(DIR_TOOLS)/quality-agent define PKG_FILES_devel /usr/include diff --git a/pkgs/Rules b/pkgs/Rules index 752ccb6a8..03ebeb89f 100644 --- a/pkgs/Rules +++ b/pkgs/Rules @@ -45,6 +45,12 @@ define POST_INSTALL echo "#####################################################################" echo "# $(PKG_NAME) - Install finished" echo "#####################################################################" + + $(DO_QUALITY_AGENT) + + # Dump filelist + cd $(BUILDROOT) && find -ls + touch $(STAGE_INSTALL) endef diff --git a/tools/downloader b/tools/downloader old mode 100644 new mode 100755 diff --git a/tools/naoki-functions b/tools/naoki-functions index 7e8b67427..fd552b72a 100644 --- a/tools/naoki-functions +++ b/tools/naoki-functions @@ -82,7 +82,7 @@ function naoki_prepare() { ${BUILD_DIR}/${TOOLS_DIR} local i - for i in cache ccache pkgs src tools ${PACKAGES_DIR##*/}; do + for i in cache ccache pkgs src tools ${DIR_PACKAGES##*/}; do mkdir -p ${BASEDIR}/${i} ${BUILD_DIR}/usr/src/${i} 2>/dev/null mount --bind ${BASEDIR}/${i} ${BUILD_DIR}/usr/src/${i} done @@ -219,9 +219,11 @@ function naoki_make() { function __erase_log() { local line - while read -a line; do - grep -q "commands for target" <<<"${line[*]}" && continue - echo -e "${line[*]}" + + local IFS='\n' + while read line; do + grep -q "commands for target" <<<"${line}" && continue + echo -e "${line}" done } @@ -231,6 +233,14 @@ function naoki_build() { local ret msg "Going on to build package \"${p}\"." + + CHROOT=0 naoki_make ${p} --without-chroot download $@ + ret=$? + + if [ "${ret}" != "0" ]; then + error "Download command failed." + exit ${ret} + fi naoki_prepare ${p} $@ ret=$? diff --git a/tools/quality-agent b/tools/quality-agent new file mode 100755 index 000000000..10517bd1a --- /dev/null +++ b/tools/quality-agent @@ -0,0 +1,11 @@ +#!/bin/bash + +DIR_QA=${0}.d + +for file in ${DIR_QA}/*; do + [ -x "${file}" ] || continue + + ${file} || exit $? +done + +exit 0 diff --git a/tools/quality-agent.d/001-remove-static-libs b/tools/quality-agent.d/001-remove-static-libs new file mode 100755 index 000000000..4c04af6d2 --- /dev/null +++ b/tools/quality-agent.d/001-remove-static-libs @@ -0,0 +1,16 @@ +#!/bin/bash + +. $(dirname ${0})/qa-include + +# Remove unwanted files +echo "${0##*/}: Removing unwanted files: *.a *.la" +for file in $(find ${BUILDROOT} -name "*.a" -or -name "*.la"); do + + # Don't remove libc_nonshared.a. It is used by gcc/ld. + [ "${file##*/}" = "libc_nonshared.a" ] && continue + + echo " Removing: ${file}" + rm -f ${file} || exit $? +done + +exit 0 diff --git a/tools/quality-agent.d/qa-include b/tools/quality-agent.d/qa-include new file mode 100644 index 000000000..36f2491ea --- /dev/null +++ b/tools/quality-agent.d/qa-include @@ -0,0 +1,6 @@ +#!/bin/bash + +if [ -z "${BUILDROOT}" ]; then + echo "${0##*/}: ERROR: BUILDROOT is not set." >&2 + exit 1 +fi