Move away from grep-dctrl. New code in awk is slightly faster, and
more robust in cases where tasks are not defined.
This commit is contained in:
parent
2b8dfe453a
commit
e97909abee
|
@ -57,15 +57,52 @@ update_essential_list () {
|
||||||
tasksel=$4
|
tasksel=$4
|
||||||
|
|
||||||
grep '\*' $file > $file.new
|
grep '\*' $file > $file.new
|
||||||
for i in $(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist); do
|
(grep -Ev "^(#.*)?[[:space:]]*$" $tasklist ;
|
||||||
if ( [ "$i" != gnome-dekstop ] &&
|
echo DONE ;
|
||||||
[ "$i" != kde-desktop ] &&
|
cat $tasksel/usr/share/tasksel/debian-tasks.desc) | awk -v DT=$3 '
|
||||||
[ "$i" != xfce-desktop ] ) ||
|
|
||||||
[ "$i" = "$desktoptask" ]; then
|
/DONE/ {
|
||||||
grep-dctrl -F Task -e "^$i$" $tasksel/usr/share/tasksel/debian-tasks.desc |
|
in_tasks = 1
|
||||||
grep-dctrl -s Key -n -e '.*';
|
next
|
||||||
fi
|
}
|
||||||
done | sed -e 's? *??' | grep -v ^$ >> $file.new
|
/^ / {
|
||||||
|
if (in_key) {
|
||||||
|
printf("%d:%s\n", tasklist[cur_task], $1)
|
||||||
|
next
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/.*/ {
|
||||||
|
if (!in_tasks) {
|
||||||
|
tasklist[$1] = num_tasks
|
||||||
|
num_tasks++
|
||||||
|
}
|
||||||
|
if (in_key) {
|
||||||
|
in_key = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/^Task: / {
|
||||||
|
if (in_tasks) {
|
||||||
|
cur_task = $2
|
||||||
|
next
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/^Key: / {
|
||||||
|
if (in_tasks) {
|
||||||
|
for (taskname in tasklist) {
|
||||||
|
if (taskname == cur_task) {
|
||||||
|
if ((cur_task != "gnome-desktop") &&
|
||||||
|
(cur_task != "kde-desktop") &&
|
||||||
|
(cur_task != "xfce-desktop")) {
|
||||||
|
in_key = 1
|
||||||
|
}
|
||||||
|
if (cur_task == DT) {
|
||||||
|
in_key = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
next
|
||||||
|
}' | sort -s -n -k1 | cut -d: -f2 >> $file.new
|
||||||
mv $file.new $file
|
mv $file.new $file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue