* tools/update_tasks: Significant streamlining to make a huge difference in
runtime. Now feasible to run this automatically per-build rather than cronning it.
This commit is contained in:
parent
50059071ef
commit
d21aa49a4f
|
@ -43,6 +43,11 @@ debian-cd (3.0.5) UNRELEASED; urgency=low
|
|||
[ Frans Pop ]
|
||||
* Update tasksel tasks for Lenny Beta2.
|
||||
|
||||
[ Steve McIntyre ]
|
||||
* tools/update_tasks: Significant streamlining to make a huge difference in
|
||||
runtime. Now feasible to run this automatically per-build rather than
|
||||
cronning it.
|
||||
|
||||
-- Frans Pop <fjp@debian.org> Fri, 06 Jun 2008 22:32:06 +0200
|
||||
|
||||
debian-cd (3.0.4) unstable; urgency=low
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
# set -e
|
||||
|
||||
CODENAME="$1"
|
||||
if [ -z "$CODENAME" ]; then
|
||||
|
@ -7,19 +7,46 @@ if [ -z "$CODENAME" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e /usr/share/tasksel/debian-tasks.desc ]; then
|
||||
echo "tasksel must be installed to update task lists" >&2
|
||||
exit 1
|
||||
if [ "$MIRROR"x == ""x ] ; then
|
||||
echo "update_tasks needs to know where the mirror is" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
update_full_list () {
|
||||
file=$1
|
||||
tasklist=$2
|
||||
pkgfile=$3
|
||||
|
||||
grep '\*' $file > $file.new
|
||||
for i in $(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist); do
|
||||
grep-aptavail -e -F Task "(^| )$i(,|$)" -s Package -n;
|
||||
done >> $file.new
|
||||
grep '\*' $file > $file.new
|
||||
(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ; echo DONE ; cat $pkgfile) | awk '
|
||||
/DONE/ {
|
||||
in_packages = 1
|
||||
next
|
||||
}
|
||||
/.*/ {
|
||||
if (!in_packages) {
|
||||
name=sprintf("(^| )%s(,|$)", $1)
|
||||
tasklist[name] = 1
|
||||
num_tasks++
|
||||
}
|
||||
}
|
||||
/^Package: / {
|
||||
if (in_packages) {
|
||||
pkgname = $2
|
||||
next
|
||||
}
|
||||
}
|
||||
/^Task: / {
|
||||
if (in_packages) {
|
||||
for (taskname in tasklist) {
|
||||
if (match($0, taskname)) {
|
||||
print pkgname
|
||||
next
|
||||
}
|
||||
}
|
||||
}
|
||||
next
|
||||
}' | sort -u >> $file.new
|
||||
mv $file.new $file
|
||||
}
|
||||
|
||||
|
@ -27,6 +54,7 @@ update_essential_list () {
|
|||
file=$1
|
||||
tasklist=$2
|
||||
desktoptask=$3
|
||||
tasksel=$4
|
||||
|
||||
grep '\*' $file > $file.new
|
||||
for i in $(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist); do
|
||||
|
@ -34,17 +62,42 @@ update_essential_list () {
|
|||
[ "$i" != kde-desktop ] &&
|
||||
[ "$i" != xfce-desktop ] ) ||
|
||||
[ "$i" = "$desktoptask" ]; then
|
||||
grep-dctrl -F Task -e "^$i$" /usr/share/tasksel/debian-tasks.desc |
|
||||
grep-dctrl -F Task -e "^$i$" $tasksel/usr/share/tasksel/debian-tasks.desc |
|
||||
grep-dctrl -s Key -n -e '.*';
|
||||
fi
|
||||
done | sed -e 's? *??' | grep -v ^$ >> $file.new
|
||||
mv $file.new $file
|
||||
}
|
||||
|
||||
update_essential_list tasks/task-essential-$CODENAME tasks/task.list gnome-desktop
|
||||
update_essential_list tasks/task-essential-$CODENAME-kde tasks/task.list.kde kde-desktop
|
||||
update_essential_list tasks/task-essential-$CODENAME-xfce tasks/task.list.xfce xfce-desktop
|
||||
# We need to gunzip a copy of the appropriate Packages.gz file
|
||||
# Assume i386, use the $CODENAME main Packages file
|
||||
TMP_PKG=$BDIR/Packages
|
||||
zcat $MIRROR/dists/$CODENAME/main/binary-i386/Packages.gz > $TMP_PKG
|
||||
|
||||
update_full_list tasks/task-full-$CODENAME tasks/task.list
|
||||
update_full_list tasks/task-full-$CODENAME-kde tasks/task.list.kde
|
||||
update_full_list tasks/task-full-$CODENAME-xfce tasks/task.list.xfce
|
||||
# Now grab the appropriate tasksel package
|
||||
TASKSEL_DEB=$MIRROR/`awk '
|
||||
/^Package: tasksel-data$/ { found=1 }
|
||||
/^Filename:/ { if (found==1) { print $2; exit } }' $TMP_PKG`
|
||||
|
||||
dpkg -x $TASKSEL_DEB $BDIR/tasksel
|
||||
|
||||
update_essential_list tasks/task-essential-$CODENAME \
|
||||
tasks/task.list gnome-desktop \
|
||||
$BDIR/tasksel
|
||||
|
||||
update_essential_list tasks/task-essential-$CODENAME-kde \
|
||||
tasks/task.list.kde kde-desktop \
|
||||
$BDIR/tasksel
|
||||
|
||||
update_essential_list tasks/task-essential-$CODENAME-xfce \
|
||||
tasks/task.list.xfce xfce-desktop \
|
||||
$BDIR/tasksel
|
||||
|
||||
update_full_list tasks/task-full-$CODENAME \
|
||||
tasks/task.list $TMP_PKG
|
||||
|
||||
update_full_list tasks/task-full-$CODENAME-kde \
|
||||
tasks/task.list.kde $TMP_PKG
|
||||
|
||||
update_full_list tasks/task-full-$CODENAME-xfce \
|
||||
tasks/task.list.xfce $TMP_PKG
|
||||
|
|
Loading…
Reference in New Issue