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 Package: debian-cd
Architecture: all 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 Recommends: hfsutils, netpbm, syslinux
Description: Tools for building (Official) Debian CD set Description: Tools for building (Official) Debian CD set
Debian-cd is the official tool for building Debian CD set since the potato 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 pkgfile=$3
grep '\*' $file > $file.new grep '\*' $file > $file.new
(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ; echo DONE ; cat $pkgfile) | awk ' (grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ; echo DONE ; cat $pkgfile) | mawk '
/DONE/ { /DONE/ {
in_packages = 1 in_packages = 1
next next
} }
/.*/ { /.*/ {
if (!in_packages) { if (!in_packages) {
name=sprintf("(^| )%s(,|$)", $1) tasklist[$1] = num_tasks
tasklist[name] = num_tasks
num_tasks++ num_tasks++
} }
} }
@ -38,10 +37,15 @@ update_full_list () {
} }
/^Task: / { /^Task: / {
if (in_packages) { if (in_packages) {
gsub("Task: ", "", $0)
gsub(",", "", $0)
split($0, these)
for (taskname in tasklist) { for (taskname in tasklist) {
if (match($0, taskname)) { for (task in these) {
printf("%d:%s\n", tasklist[taskname], pkgname) if (these[task] == taskname) {
next printf("%d:%s\n", tasklist[taskname], pkgname)
next
}
} }
} }
} }
@ -59,7 +63,7 @@ update_essential_list () {
grep '\*' $file > $file.new grep '\*' $file > $file.new
(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ; (grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ;
echo DONE ; 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/ { /DONE/ {
in_tasks = 1 in_tasks = 1
@ -112,7 +116,7 @@ TMP_PKG=$BDIR/Packages
zcat $MIRROR/dists/$CODENAME/main/binary-i386/Packages.gz > $TMP_PKG zcat $MIRROR/dists/$CODENAME/main/binary-i386/Packages.gz > $TMP_PKG
# Now grab the appropriate tasksel package # Now grab the appropriate tasksel package
TASKSEL_DEB=$MIRROR/`awk ' TASKSEL_DEB=$MIRROR/`mawk '
/^Package: tasksel-data$/ { found=1 } /^Package: tasksel-data$/ { found=1 }
/^Filename:/ { if (found==1) { print $2; exit } }' $TMP_PKG` /^Filename:/ { if (found==1) { print $2; exit } }' $TMP_PKG`