This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 3.x development tree".
The branch, master has been updated
via 9493ba5445fac3640c2d9858064c1c127403fbf5 (commit)
via 9f359e81999bf939bfb1f31aa1a17e00580b3670 (commit)
from 31e8c1b406a91139663464d86b8af860b67fb070 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9493ba5445fac3640c2d9858064c1c127403fbf5
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Thu Oct 7 19:59:09 2010 +0200
naoki: Cleanup QA scripts.
commit 9f359e81999bf939bfb1f31aa1a17e00580b3670
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Thu Oct 7 19:58:28 2010 +0200
naoki: Speed up dependency resolution.
-----------------------------------------------------------------------
Summary of changes:
naoki/packages.py | 9 +++++
tools/quality-agent.d/001-remove-info-files | 23 +++++++-----
tools/quality-agent.d/001-remove-static-libs | 31 +++++++++-------
tools/quality-agent.d/001-unsafe-files | 51 +++++++++++++++-----------
tools/quality-agent.d/002-bad-symlinks | 42 ++++++++++++---------
tools/quality-agent.d/003-libs-location | 27 ++++++++------
tools/quality-agent.d/050-root-links-to-usr | 48 ++++++++++++++-----------
tools/quality-agent.d/090-python-hardlinks | 23 +++++++-----
tools/quality-agent.d/090-remove-empty-dirs | 22 ++++++-----
tools/quality-agent.d/099-strip | 32 +++++++++-------
10 files changed, 177 insertions(+), 131 deletions(-)
Difference in files:
diff --git a/naoki/packages.py b/naoki/packages.py
index 5c8e137..f38afec 100644
--- a/naoki/packages.py
+++ b/naoki/packages.py
@@ -236,6 +236,9 @@ class BinaryPackage(Package):
key, val = m.groups()
self._info[key] = val.strip("\"")
+ self.__dependencies = self.get_dependencies()
+ self.__provides = self.get_provides()
+
def extract(self, path):
logging.debug("Extracting %s to %s" % (self, path))
@@ -261,6 +264,9 @@ class BinaryPackage(Package):
return self._info["PKG_NAME"]
def get_dependencies(self):
+ if hasattr(self, "__dependencies"):
+ return self.__dependencies
+
objects = self._info.get("PKG_DEPS", "").split()
# Compatibility to older package format
@@ -269,6 +275,9 @@ class BinaryPackage(Package):
return [dependencies.Dependency(o, origin=self) for o in objects]
def get_provides(self):
+ if hasattr(self, "__provides"):
+ return self.__provides
+
return [dependencies.Provides(p, origin=self) \
for p in self._info.get("PKG_PROVIDES", "").split()]
diff --git a/tools/quality-agent.d/001-remove-info-files b/tools/quality-agent.d/001-remove-info-files
index 131e55b..e742dc9 100755
--- a/tools/quality-agent.d/001-remove-info-files
+++ b/tools/quality-agent.d/001-remove-info-files
@@ -2,13 +2,16 @@
. $(dirname ${0})/qa-include
-# Remove documentation files
-log_debug "Removing documentation files..."
-for dir in ${BUILDROOT}/usr/{,share}/{doc,gtk-doc,info}; do
- if [ -d "${dir}" ]; then
- log_debug " Removing: ${dir}"
- rm -rf ${dir} || exit $?
- fi
-done
-
-exit 0
+DESC="Remove documentation files."
+
+function check() {
+ for dir in ${BUILDROOT}/usr/{,share}/{doc,gtk-doc,info}; do
+ if [ -d "${dir}" ]; then
+ log DEBUG " Removing: ${dir}"
+ rm -rf ${dir} || exit $?
+ fi
+ done
+}
+
+run
+
diff --git a/tools/quality-agent.d/001-remove-static-libs b/tools/quality-agent.d/001-remove-static-libs
index cbeabf2..e5c6e54 100755
--- a/tools/quality-agent.d/001-remove-static-libs
+++ b/tools/quality-agent.d/001-remove-static-libs
@@ -2,20 +2,23 @@
. $(dirname ${0})/qa-include
-# Remove unwanted files
-log_debug "Removing unwanted files: *.a *.la"
-for file in $(find ${BUILDROOT} -name "*.a" -or -name "*.la"); do
+DESC="Removing unwanted files: *.a *.la"
+
+function check() {
+ 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
- [ "${file##*/}" = "libpthread_nonshared.a" ] && continue
- [ "${file##*/}" = "libgcc.a" ] && continue
- [ "${file##*/}" = "libgcc_eh.a" ] && continue
- [ "${file##*/}" = "libfl_pic.a" ] && continue
- [ "${file##*/}" = "libpython2.6.a" ] && continue
+ # Don't remove libc_nonshared.a. It is used by gcc/ld.
+ [ "${file##*/}" = "libc_nonshared.a" ] && continue
+ [ "${file##*/}" = "libpthread_nonshared.a" ] && continue
+ [ "${file##*/}" = "libgcc.a" ] && continue
+ [ "${file##*/}" = "libgcc_eh.a" ] && continue
+ [ "${file##*/}" = "libfl_pic.a" ] && continue
+ [ "${file##*/}" = "libpython2.6.a" ] && continue
- log_debug " Removing: ${file}"
- rm -f ${file} || exit $?
-done
+ log DEBUG " Removing: ${file}"
+ rm -f ${file} || exit $?
+ done
+}
+
+run
-exit 0
diff --git a/tools/quality-agent.d/001-unsafe-files b/tools/quality-agent.d/001-unsafe-files
index 547a1b1..93a5dc8 100755
--- a/tools/quality-agent.d/001-unsafe-files
+++ b/tools/quality-agent.d/001-unsafe-files
@@ -2,25 +2,32 @@
. $(dirname ${0})/qa-include
-log_debug "Searching for world-writeable files..."
-
-files=$(find ${BUILDROOT} -type f -perm -2 2>/dev/null)
-if [ -n "${files}" ]; then
- log_error " QA Security Notice:"
- log_error " - The folloing files will be world writable."
- log_error " - This may or may not be a security problem, most of the time it is one."
- log_error " - Please double check that these files really need a world writeable bit and file bugs accordingly."
- log_error
- log_error "${files}"
- exit 1
-fi
-
-files=$(find ${BUILDROOT} -type f '(' -perm -2002 -o -perm -4002 ')')
-if [ -n "${files}" ]; then
- log_error " QA Notice: Unsafe files detected (set*id and world writable)"
- log_error
- log_error "${files}"
- exit 1
-fi
-
-exit 0
+DESC="Searching for world-writeable files..."
+
+function check() {
+ local ret=0
+
+ local files=$(find ${BUILDROOT} -type f -perm -2 2>/dev/null)
+ if [ -n "${files}" ]; then
+ log ERROR " QA Security Notice:"
+ log ERROR " - The folloing files will be world writable."
+ log ERROR " - This may or may not be a security problem, most of the time it is one."
+ log ERROR " - Please double check that these files really need a world writeable bit and file bugs accordingly."
+ log ERROR
+ log ERROR "${files}"
+ ret=1
+ fi
+
+ files=$(find ${BUILDROOT} -type f '(' -perm -2002 -o -perm -4002 ')')
+ if [ -n "${files}" ]; then
+ log ERROR " QA Notice: Unsafe files detected (set*id and world writable)"
+ log ERROR
+ log ERROR "${files}"
+ ret=1
+ fi
+
+ return ${ret}
+}
+
+run
+
diff --git a/tools/quality-agent.d/002-bad-symlinks b/tools/quality-agent.d/002-bad-symlinks
index 7c8678f..595a7c5 100755
--- a/tools/quality-agent.d/002-bad-symlinks
+++ b/tools/quality-agent.d/002-bad-symlinks
@@ -7,21 +7,27 @@
log_debug "Search for absolute symlinks"
-failed=0
-for link in $(find ${BUILDROOT} -type l); do
- if fgrep -q "/lib/udev/devices" <<<${link}; then
- continue
- fi
-
- destination=$(readlink ${link})
- if [ "${destination:0:1}" = "/" ]; then
- log_error " absolute symlink: ${link}"
- failed=1
- fi
- if [ ! -e "${link%/*}/${destination}" ]; then
- log_error " not existant destination: ${link} -> ${destination}"
- failed=1
- fi
-done
-
-exit ${failed}
+function check() {
+ local failed=0
+
+ for link in $(find ${BUILDROOT} -type l); do
+ if fgrep -q "/lib/udev/devices" <<<${link}; then
+ continue
+ fi
+
+ destination=$(readlink ${link})
+ if [ "${destination:0:1}" = "/" ]; then
+ log ERROR " Absolute symlink: ${link}"
+ failed=1
+ fi
+ if [ ! -e "${link%/*}/${destination}" ]; then
+ log ERROR " Not existant destination: ${link} -> ${destination}"
+ failed=1
+ fi
+ done
+
+ return ${failed}
+}
+
+run
+
diff --git a/tools/quality-agent.d/003-libs-location b/tools/quality-agent.d/003-libs-location
index 3d29bea..185f44f 100755
--- a/tools/quality-agent.d/003-libs-location
+++ b/tools/quality-agent.d/003-libs-location
@@ -2,19 +2,22 @@
. $(dirname ${0})/qa-include
-# Check for libs that are missing in /usr/lib.
+DESC="Checking correct installation of libraries"
-log_debug "Checking correct installation of libraries"
+function check() {
+ local failed=0
+ for lib in $(find ${BUILDROOT}/lib -type f -name "lib*.so.*" 2>/dev/null); do
+ lib=${lib##*/}
+ lib=${lib%%.so*}
-failed=0
-for lib in $(find ${BUILDROOT}/lib -type f -name "lib*.so.*" 2>/dev/null); do
- lib=${lib##*/}
- lib=${lib%%.so*}
+ if [ ! -e "${BUILDROOT}/usr/lib/${lib}.so" ]; then
+ log ERROR " /usr/lib/${lib}.so is missing"
+ failed=1
+ fi
+ done
- if [ ! -e "${BUILDROOT}/usr/lib/${lib}.so" ]; then
- failed=1
- log_error " /usr/lib/${lib}.so is missing"
- fi
-done
+ return ${failed}
+}
+
+run
-exit ${failed}
diff --git a/tools/quality-agent.d/050-root-links-to-usr b/tools/quality-agent.d/050-root-links-to-usr
index 18b4d29..98385c5 100755
--- a/tools/quality-agent.d/050-root-links-to-usr
+++ b/tools/quality-agent.d/050-root-links-to-usr
@@ -2,24 +2,30 @@
. $(dirname ${0})/qa-include
-log "Check for binaries in /bin or /sbin that link to /usr/..."
-
-for file in $(find ${BUILDROOT}/{bin,lib,sbin}/* 2>/dev/null); do
- [ -f "${file}" ] || continue
- log " ${file}"
-
- interpreter=$(file_get_interpreter ${file})
- if [ ! -e "${interpreter}" ]; then
- log " SKIPPED because interpreter is not available"
- continue
- fi
-
- libs=$(ldd ${file})
- if grep -q /usr/lib <<<${libs}; then
- log "ERROR: ${file} links to libs in /usr/lib..."
- log " ${libs}"
- exit 1
- fi
-done
-
-exit 0
+DESC="Check for binaries in /bin or /sbin that link to /usr/..."
+
+function check() {
+ local ret=0
+
+ for file in $(find ${BUILDROOT}/{bin,lib,sbin}/* 2>/dev/null); do
+ [ -f "${file}" ] || continue
+ log DEBUG " ${file}"
+
+ interpreter=$(file_get_interpreter ${file})
+ if [ ! -e "${interpreter}" ]; then
+ log WARN " SKIPPED because interpreter is not available"
+ continue
+ fi
+
+ libs=$(ldd ${file})
+ if grep -q /usr/lib <<<${libs}; then
+ log ERROR "${file} links to libs in /usr/lib..."
+ log ERROR " ${libs}"
+ ret=1
+ fi
+ done
+
+ return ${ret}
+}
+
+run
diff --git a/tools/quality-agent.d/090-python-hardlinks b/tools/quality-agent.d/090-python-hardlinks
index 8bcf6ea..e2abf76 100755
--- a/tools/quality-agent.d/090-python-hardlinks
+++ b/tools/quality-agent.d/090-python-hardlinks
@@ -2,16 +2,19 @@
. $(dirname ${0})/qa-include
-# If the pyc and pyo files are the same, we can hardlink them
-log "Hard-linking python bytecode files"
+DESC="Python byte-code files could be hardlinked if the optimized one is equal"
+DESC="${DESC} to the other one."
-for py in $(find ${BUILDROOT} -type f -name "*.py"); do
- if [ -e "${py}c" ] && [ -e "${py}o" ]; then
- if cmp -s "${py}c" "${py}o"; then
- log " ${py}c -> ${py}o"
- ln -f "${py}c" "${py}o"
+function check() {
+ for py in $(find ${BUILDROOT} -type f -name "*.py"); do
+ if [ -e "${py}c" ] && [ -e "${py}o" ]; then
+ if cmp -s "${py}c" "${py}o"; then
+ log DEBUG " ${py}c -> ${py}o"
+ ln -f "${py}c" "${py}o"
+ fi
fi
- fi
-done
+ done
+}
+
+run
-exit 0
diff --git a/tools/quality-agent.d/090-remove-empty-dirs b/tools/quality-agent.d/090-remove-empty-dirs
index de859ba..f8a39fd 100755
--- a/tools/quality-agent.d/090-remove-empty-dirs
+++ b/tools/quality-agent.d/090-remove-empty-dirs
@@ -2,15 +2,17 @@
. $(dirname ${0})/qa-include
-# Remove unwanted files
-log "Remove empty directories"
+DESC="Remove unwanted files."
-for dir in {,/usr}/{{,s}bin,lib{,exec}} /usr/share/man{,/man{0,1,2,3,4,5,6,7,8,9}}; do
- dir="${BUILDROOT}/${dir}"
- if [ -d "${dir}" ] && [ "$(ls -1A ${dir} | wc -l)" = "0" ]; then
- log " Removing ${dir}"
- rm -rf ${dir}
- fi
-done
+function check() {
+ for dir in {,/usr}/{{,s}bin,lib{,exec}} /usr/share/man{,/man{0,1,2,3,4,5,6,7,8,9}}; do
+ dir="${BUILDROOT}/${dir}"
+ if [ -d "${dir}" ] && [ "$(ls -1A ${dir} | wc -l)" = "0" ]; then
+ log DEBUG " Removing ${dir}"
+ rm -rf ${dir}
+ fi
+ done
+}
+
+run
-exit 0
diff --git a/tools/quality-agent.d/099-strip b/tools/quality-agent.d/099-strip
index 6afc8ad..f79b9a3 100755
--- a/tools/quality-agent.d/099-strip
+++ b/tools/quality-agent.d/099-strip
@@ -2,19 +2,23 @@
. $(dirname ${0})/qa-include
-# Strip debugging symbols
-log "Strip debugging symbols"
-for f in $(find ${BUILDROOT} -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \)); do
- if (file $f | grep -q ' shared object,'); then
- strip --strip-debug "$f" || :
- fi
-done
+DESC="Stripping reduces size of binary files."
-log "Strip unneeded symbols"
-for f in $(find ${BUILDROOT} -type f); do
- if (file $f | grep -q ' shared object,'); then
- strip --strip-unneeded "$f" || :
- fi
-done
+function check() {
+ # Strip debugging symbols
+ for f in $(find ${BUILDROOT} -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \)); do
+ if (file $f | grep -q ' shared object,'); then
+ strip --strip-debug "$f" || :
+ fi
+ done
+
+ log "Strip unneeded symbols"
+ for f in $(find ${BUILDROOT} -type f); do
+ if (file $f | grep -q ' shared object,'); then
+ strip --strip-unneeded "$f" || :
+ fi
+ done
+}
+
+run
-exit 0
hooks/post-receive
--
IPFire 3.x development tree