summaryrefslogtreecommitdiff
path: root/Mk/Scripts/qa.sh
diff options
context:
space:
mode:
authorMatthias Andree <mandree@FreeBSD.org>2013-10-31 19:07:38 +0000
committerMatthias Andree <mandree@FreeBSD.org>2013-10-31 19:07:38 +0000
commit13b212c743fd162444910729fc035ea1ed4df276 (patch)
treec17d6b9d2abf5fa7ceb6a5b58e1de85e4e6daac8 /Mk/Scripts/qa.sh
parentSimplify delta port by not using a for loop (diff)
bsd.stage.mk: Fewer false positives, much faster, easier maintenance.
Bugfixes: * @cmd in pkg-plist is now properly handled. - It was previously treated the same as though there was a directory following it, missing the prefix. (ordering matters in case...esac) - Due to the cwd=${PREFIX} inside the while read line loop, state tracking was broken and every new line assumed that cwd were the prefix. * stage-qa no longer complains about unstripped binaries if debugging is active (WITH_DEBUG set && WITHOUT_DEBUG unset). * The compress-man target uses ECHO_MSG, not ECHO_CMD, to print its build step. Additions: * The plist parser now understands @unexec rmdir ... || ... lines, including those with redirections, so that there are no false positives for directories stripped with @unexec rmdir (usually happens on stuff installed outside $PREFIX, as in /var). * The system's root and var mtrees are now also expanded to avoid false @dirrm positives if a port installs directories under /var and has to create parents in the stagedir that are present in a fully installed system (i. e. in the real $PREFIX). * Given that pkg_create is deemed beyond repair with respect to deleting files outside prefix, generate @unexec rmdir statements for such directories, rather than @dirrmtry, to sidestep the problem. Speedups: * the orphan check now generates sorted lists of staged files, and plisted/mtree files, and compares them with comm(1). This saves us the overhead of running one grep process per file and up to two per directory, and defers the actual list processing to a shell utility. Complexity has not changed, but overhead per item has. * the orphan check now uses one file for directories and one file for files mentioned in pkg-plist, so we need not decorate them with "dir " and parse them out any longer. * qa.sh's shebang scanner only looks at the first line of a file, sed is told to exit from the 2nd line. Other Changes: * Split the makeplist/check-orphans logic out of bsd.stage.mk, it is too unwieldy to maintain in make-escaped shell syntax, and permits shell tracing with "SH=sh -x" (including quotes!) * Unify the functions "makeplist" and "check-orphans" in one script. The only difference is that makeplist assumes an empty pkg-plist, whereas check-orphans parses it. * overhaul the mtree extractor, avoiding awk. Reviewed by: bapt Approved by: portmgr (bapt)
Notes
Notes: svn path=/head/; revision=332275
Diffstat (limited to 'Mk/Scripts/qa.sh')
-rw-r--r--Mk/Scripts/qa.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index b3e022fdc654..e2f49a40d73f 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -18,7 +18,7 @@ err() {
shebang() {
rc=0
for f in `find ${STAGEDIR} -type f`; do
- interp=$(sed -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p' $f)
+ interp=$(sed -n -e '1s/^#![[:space:]]*\([^[:space:]]*\).*/\1/p;2q' $f)
case "$interp" in
"") ;;
/usr/bin/env) ;;
@@ -62,7 +62,8 @@ paths() {
# For now do not raise an error, just warnings
stripped() {
- [ -x /usr/bin/file ] || return
+ [ -x /usr/bin/file ] || return # this is fatal
+ [ -n "${STRIP}" ] || return 0
for f in `find ${STAGEDIR} -type f`; do
output=`/usr/bin/file ${f}`
case "${output}" in