diff options
author | joerg <joerg@pkgsrc.org> | 2008-06-20 11:51:50 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2008-06-20 11:51:50 +0000 |
commit | 5aae7fc973373c93d3e1d7123d602effb8fcd5be (patch) | |
tree | cf352482822379fdfa5736dbf82734b0ef8ec162 /pkgtools | |
parent | ec8d90bc755c19c39529a1fa9b48d62ccbb0247c (diff) | |
download | pkgsrc-5aae7fc973373c93d3e1d7123d602effb8fcd5be.tar.gz |
pbulk-0.32:
Make bulkbuild-rebuild over 200 times faster when running against a full
tree scan by using awk to filter out the data instead of the while read
shell builtin.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pbulk/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild | 30 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/scan | 4 |
3 files changed, 13 insertions, 25 deletions
diff --git a/pkgtools/pbulk/Makefile b/pkgtools/pbulk/Makefile index b3ab437d532..4ac9f36d01a 100644 --- a/pkgtools/pbulk/Makefile +++ b/pkgtools/pbulk/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.41 2008/06/12 13:29:27 joerg Exp $ +# $NetBSD: Makefile,v 1.42 2008/06/20 11:51:50 joerg Exp $ -DISTNAME= pbulk-0.31 +DISTNAME= pbulk-0.32 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild index 29ebf33d00d..27f6e71a106 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild +++ b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild @@ -1,19 +1,15 @@ #!@SH@ -# $NetBSD: bulkbuild-rebuild,v 1.1 2008/01/26 01:57:00 joerg Exp $ +# $NetBSD: bulkbuild-rebuild,v 1.2 2008/06/20 11:51:50 joerg Exp $ . @PBULK_CONFIG@ set -e check_pkg() { - found=0 - while read line; do - if [ "$line" = "PKGNAME=$1" ]; then - return 0 - fi - done < ${loc}/presolve - echo "Package $1 not found, aborting." - exit 1 + if @AWK@ '{ if ($0 == "PKGNAME='$1'") exit 1 }' < ${loc}/presolve; then + echo "Package $1 not found, aborting." + exit 1 + fi } pkg_failed() { @@ -23,18 +19,10 @@ pkg_failed() { build_pkg() { printf "Building package %s... " "$1" - do_print=0 - while read line; do - case "$line" in - "PKGNAME=$1") - do_print=1 - ;; - "PKGNAME="*) - do_print=0 - ;; - esac - [ "$do_print" = 1 ] && echo "$line" - done < ${loc}/presolve | ${pbuild_script} || pkg_failed "$1" + @AWK@ '{ if ($0 == "PKGNAME='$1'") p=1; \ + else if ($0 ~ "^PKGNAME=") p=0; \ + if (p) print $0 }' < ${loc}/presolve | \ + ${pbuild_script} || pkg_failed "$1" echo "done" } diff --git a/pkgtools/pbulk/files/pbulk/scripts/scan b/pkgtools/pbulk/files/pbulk/scripts/scan index fe7e91bd46d..589750d1df5 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/scan +++ b/pkgtools/pbulk/files/pbulk/scripts/scan @@ -1,5 +1,5 @@ #!@SH@ -# $NetBSD: scan,v 1.2 2007/07/16 19:25:25 joerg Exp $ +# $NetBSD: scan,v 1.3 2008/06/20 11:51:50 joerg Exp $ # # Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. # All rights reserved. @@ -76,7 +76,7 @@ else initial=0 else ${presolve} -i ${loc}/missing -v ${loc}/presolve ${loc}/pscan > ${loc}/presolve.new - cmp -s ${loc}/presolve.new ${loc}/presolve && break + cmp -s ${loc}/presolve.new ${loc}/presolve && break mv ${loc}/presolve.new ${loc}/presolve fi done |