. $(dirname ${0})/qa-include
# Fix include files
-echo "${0##*/}: Fix include files"
+log "Fix include files"
if [ ! -d "${BUILDROOT}/usr/include" ]; then
exit 0
. $(dirname ${0})/qa-include
# Remove unwanted files
-echo "${0##*/}: Removing unwanted files: *.a *.la"
+log "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##*/}" = "libgcc_eh.a" ] && continue
[ "${file##*/}" = "libfl_pic.a" ] && continue
- echo " Removing: ${file}"
+ log " Removing: ${file}"
rm -f ${file} || exit $?
done
. $(dirname ${0})/qa-include
-echo "${0##*/}: Searching for world-writeable files..."
+log "Searching for world-writeable files..."
files=$(find ${BUILDROOT} -type f -perm -2 2>/dev/null)
if [ -n "${files}" ]; then
- echo " QA Security Notice:"
- echo " - The folloing files will be world writable."
- echo " - This may or may not be a security problem, most of the time it is one."
- echo " - Please double check that these files really need a world writeable bit and file bugs accordingly."
- echo
- echo "${files}"
+ log " QA Security Notice:"
+ log " - The folloing files will be world writable."
+ log " - This may or may not be a security problem, most of the time it is one."
+ log " - Please double check that these files really need a world writeable bit and file bugs accordingly."
+ log
+ log "${files}"
exit 1
fi
files=$(find ${BUILDROOT} -type f '(' -perm -2002 -o -perm -4002 ')')
if [ -n "${files}" ]; then
- echo " QA Notice: Unsafe files detected (set*id and world writable)"
- echo
- echo "${files}"
+ log " QA Notice: Unsafe files detected (set*id and world writable)"
+ log
+ log "${files}"
exit 1
fi
. $(dirname ${0})/qa-include
# TEXTREL's are baaaaaaaad
-echo "${0##*/}: Searching for bad TEXTRELs"
+log "Searching for bad TEXTRELs"
files=$(scanelf -qyRF '%t %p' ${BUILDROOT} 2>/dev/null | awk '{ print $NF }')
if [ -n "${files}" ]; then
- echo " QA Notice: The following files contain runtime text relocations"
- echo " Text relocations force the dynamic linker to perform extra"
- echo " work at startup, waste system resources, and may pose a security"
- echo " risk. On some architectures, the code may not even function"
- echo " properly, if at all."
- echo "${files}"
+ log " QA Notice: The following files contain runtime text relocations"
+ log " Text relocations force the dynamic linker to perform extra"
+ log " work at startup, waste system resources, and may pose a security"
+ log " risk. On some architectures, the code may not even function"
+ log " properly, if at all."
+ log "${files}"
exit 1
fi
. $(dirname ${0})/qa-include
# If the pyc and pyo files are the same, we can hardlink them
-echo "${0##*/}: Hard-linking python bytecode files"
+log "Hard-linking python bytecode files"
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"
fi
fi
. $(dirname ${0})/qa-include
# Remove unwanted files
-echo "${0##*/}: Remove empty directories"
+log "Remove empty directories"
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
- echo " Removing ${dir}"
+ log " Removing ${dir}"
rm -rf ${dir}
fi
done
. $(dirname ${0})/qa-include
# Strip debugging symbols
-echo "${0##*/}: 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
-echo "${0##*/}: Strip unneeded symbols"
+log "Strip unneeded symbols"
for f in $(find ${BUILDROOT} -type f); do
if (file $f | grep -q ' shared object,'); then
strip --strip-unneeded "$f" || :