Move update_tasks to using mawk rather than gawk. It's *much*

faster. Needs some slight changes in regular expression handling, but
nothing major.
This commit is contained in:
Steve McIntyre 2008-06-07 19:03:45 +00:00
parent e97909abee
commit 9c027571ba
2 changed files with 13 additions and 9 deletions

2
debian/control vendored
View File

@ -11,7 +11,7 @@ Vcs-Browser: http://svn.debian.org/wsvn/debian-cd/trunk?op=log
Package: debian-cd
Architecture: all
Depends: perl, cpp, libdigest-md5-perl, tofrodos, apt (>= 0.3.11.1), make, genisoimage, lynx, grep-dctrl, bc, libcompress-zlib-perl
Depends: perl, cpp, libdigest-md5-perl, tofrodos, apt (>= 0.3.11.1), make, genisoimage, lynx, grep-dctrl, bc, libcompress-zlib-perl, mawk
Recommends: hfsutils, netpbm, syslinux
Description: Tools for building (Official) Debian CD set
Debian-cd is the official tool for building Debian CD set since the potato

View File

@ -18,15 +18,14 @@ update_full_list () {
pkgfile=$3
grep '\*' $file > $file.new
(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ; echo DONE ; cat $pkgfile) | awk '
(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ; echo DONE ; cat $pkgfile) | mawk '
/DONE/ {
in_packages = 1
next
}
/.*/ {
if (!in_packages) {
name=sprintf("(^| )%s(,|$)", $1)
tasklist[name] = num_tasks
tasklist[$1] = num_tasks
num_tasks++
}
}
@ -38,10 +37,15 @@ update_full_list () {
}
/^Task: / {
if (in_packages) {
gsub("Task: ", "", $0)
gsub(",", "", $0)
split($0, these)
for (taskname in tasklist) {
if (match($0, taskname)) {
printf("%d:%s\n", tasklist[taskname], pkgname)
next
for (task in these) {
if (these[task] == taskname) {
printf("%d:%s\n", tasklist[taskname], pkgname)
next
}
}
}
}
@ -59,7 +63,7 @@ update_essential_list () {
grep '\*' $file > $file.new
(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ;
echo DONE ;
cat $tasksel/usr/share/tasksel/debian-tasks.desc) | awk -v DT=$3 '
cat $tasksel/usr/share/tasksel/debian-tasks.desc) | mawk -v DT=$3 '
/DONE/ {
in_tasks = 1
@ -112,7 +116,7 @@ TMP_PKG=$BDIR/Packages
zcat $MIRROR/dists/$CODENAME/main/binary-i386/Packages.gz > $TMP_PKG
# Now grab the appropriate tasksel package
TASKSEL_DEB=$MIRROR/`awk '
TASKSEL_DEB=$MIRROR/`mawk '
/^Package: tasksel-data$/ { found=1 }
/^Filename:/ { if (found==1) { print $2; exit } }' $TMP_PKG`