pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pbulk pbulk-0.32:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b7aa6e8953ac
branches:  trunk
changeset: 543559:b7aa6e8953ac
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Jun 20 11:51:50 2008 +0000

description:
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:

 pkgtools/pbulk/Makefile                              |   4 +-
 pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild |  30 ++++++--------------
 pkgtools/pbulk/files/pbulk/scripts/scan              |   4 +-
 3 files changed, 13 insertions(+), 25 deletions(-)

diffs (82 lines):

diff -r 452a7e301389 -r b7aa6e8953ac pkgtools/pbulk/Makefile
--- a/pkgtools/pbulk/Makefile   Fri Jun 20 11:48:03 2008 +0000
+++ b/pkgtools/pbulk/Makefile   Fri Jun 20 11:51:50 2008 +0000
@@ -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 -r 452a7e301389 -r b7aa6e8953ac pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild
--- a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild      Fri Jun 20 11:48:03 2008 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-rebuild      Fri Jun 20 11:51:50 2008 +0000
@@ -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 @@
 
 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 -r 452a7e301389 -r b7aa6e8953ac pkgtools/pbulk/files/pbulk/scripts/scan
--- a/pkgtools/pbulk/files/pbulk/scripts/scan   Fri Jun 20 11:48:03 2008 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/scan   Fri Jun 20 11:51:50 2008 +0000
@@ -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@localhost>.
 # All rights reserved.
@@ -76,7 +76,7 @@
                        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



Home | Main Index | Thread Index | Old Index