]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Mix of changes.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 31 Oct 2009 13:15:40 +0000 (14:15 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 31 Oct 2009 13:18:22 +0000 (14:18 +0100)
(Wasn't able to break this down to several commits.)

 * Added QA.
 * Fixed downloading.
 * Fixed logging.

pkgs/Config
pkgs/Rules
tools/downloader [changed mode: 0644->0755]
tools/naoki-functions
tools/quality-agent [new file with mode: 0755]
tools/quality-agent.d/001-remove-static-libs [new file with mode: 0755]
tools/quality-agent.d/qa-include [new file with mode: 0644]

index 77055cf7cd142841e6815a21ca88194d21f791c9..12d2e1416905452f158bc5f596db874afd32b6ed 100644 (file)
@@ -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
index 752ccb6a8630b5eb9fb0df2806ef543b20147851..03ebeb89f09a17e756ed1686c2bb557db5306407 100644 (file)
@@ -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
 
old mode 100644 (file)
new mode 100755 (executable)
index 7e8b674273b6dfd1fb2ce8318adc4d5cdff813a9..fd552b72a16c9acc6d0d36a5a6545d4b95cbd98c 100644 (file)
@@ -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 (executable)
index 0000000..10517bd
--- /dev/null
@@ -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 (executable)
index 0000000..4c04af6
--- /dev/null
@@ -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 (file)
index 0000000..36f2491
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+if [ -z "${BUILDROOT}" ]; then
+       echo "${0##*/}: ERROR: BUILDROOT is not set." >&2
+       exit 1
+fi