2006-12-29 05:05:30 -01:00
|
|
|
#!/bin/sh
|
2008-06-07 00:27:20 +00:00
|
|
|
set -e
|
2006-12-29 05:05:30 -01:00
|
|
|
|
|
|
|
CODENAME="$1"
|
|
|
|
if [ -z "$CODENAME" ]; then
|
2008-06-07 00:31:58 +00:00
|
|
|
echo "usage: update_tasks CODENAME" >&2
|
|
|
|
exit 1
|
2006-12-29 05:05:30 -01:00
|
|
|
fi
|
|
|
|
|
2008-06-07 00:02:36 +00:00
|
|
|
if [ "$MIRROR"x == ""x ] ; then
|
|
|
|
echo "update_tasks needs to know where the mirror is" >&2
|
|
|
|
exit 1
|
2006-12-29 05:05:30 -01:00
|
|
|
fi
|
|
|
|
|
|
|
|
update_full_list () {
|
2008-06-07 00:31:58 +00:00
|
|
|
file=$1
|
|
|
|
tasklist=$2
|
2008-06-07 00:02:36 +00:00
|
|
|
pkgfile=$3
|
2006-12-29 05:05:30 -01:00
|
|
|
|
2008-06-07 00:02:36 +00:00
|
|
|
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)
|
2008-06-07 12:05:08 +00:00
|
|
|
tasklist[name] = num_tasks
|
2008-06-07 00:02:36 +00:00
|
|
|
num_tasks++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/^Package: / {
|
|
|
|
if (in_packages) {
|
|
|
|
pkgname = $2
|
|
|
|
next
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/^Task: / {
|
|
|
|
if (in_packages) {
|
|
|
|
for (taskname in tasklist) {
|
|
|
|
if (match($0, taskname)) {
|
2008-06-07 12:05:08 +00:00
|
|
|
printf("%d:%s\n", tasklist[taskname], pkgname)
|
2008-06-07 00:02:36 +00:00
|
|
|
next
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
next
|
2008-06-07 12:05:08 +00:00
|
|
|
}' | sort -n | cut -d: -f2 >> $file.new
|
2008-06-07 00:31:58 +00:00
|
|
|
mv $file.new $file
|
2006-12-29 05:05:30 -01:00
|
|
|
}
|
|
|
|
|
|
|
|
update_essential_list () {
|
2008-06-07 00:31:58 +00:00
|
|
|
file=$1
|
|
|
|
tasklist=$2
|
|
|
|
desktoptask=$3
|
2008-06-07 00:02:36 +00:00
|
|
|
tasksel=$4
|
2006-12-29 05:05:30 -01:00
|
|
|
|
2008-06-07 00:31:58 +00:00
|
|
|
grep '\*' $file > $file.new
|
|
|
|
for i in $(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist); do
|
|
|
|
if ( [ "$i" != gnome-dekstop ] &&
|
|
|
|
[ "$i" != kde-desktop ] &&
|
|
|
|
[ "$i" != xfce-desktop ] ) ||
|
|
|
|
[ "$i" = "$desktoptask" ]; then
|
|
|
|
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
|
2006-12-29 05:05:30 -01:00
|
|
|
}
|
|
|
|
|
2008-06-07 00:02:36 +00:00
|
|
|
# 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
|
|
|
|
|
|
|
|
# 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
|
2006-12-29 05:05:30 -01:00
|
|
|
|
2008-06-07 00:02:36 +00:00
|
|
|
update_full_list tasks/task-full-$CODENAME-xfce \
|
|
|
|
tasks/task.list.xfce $TMP_PKG
|