/usr/share/debian-cd/tools/update_tasks is in debian-cd 3.1.13.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | #!/usr/bin/perl -w
use strict;
my $arch;
my $old_split = $/;
my (@desktop_tasks, @user_tasks, @l10n_tasks, @server_tasks, @special_tasks);
my ($section, $taskname);
my $codename = $ENV{'CODENAME'};
if (! defined($codename)) {
die "update_tasks: codename not specified\n";
}
my $mirror = $ENV{'MIRROR'};
if (! defined($mirror)) {
die "update_tasks: mirror not specified\n";
}
my $bdir = $ENV{'BDIR'};
if (! defined($bdir)) {
die "update_tasks: temp dir not specified\n";
}
my $basedir = $ENV{'BASEDIR'};
if (! defined($basedir)) {
die "update_tasks: basedir not specified\n";
}
my $tdir = "$bdir/update_tasks";
system("mkdir -p $tdir");
# Look for the coreutils package (which should exist in all archs, and
# is a non -all package) to determine a valid arch for the rest of
# this script
my $coreutils_deb = `$basedir/tools/which_deb $mirror $codename coreutils binary`;
if ($coreutils_deb =~ m/_([[:alnum:]]+)\.deb/) {
$arch = $1;
} else {
die "update_tasks: Can't determine arch!\n";
}
# Extract the tasksel-data deb for our suite; we need to parse the
# data in it
my $tasksel_deb = `$basedir/tools/which_deb $mirror $codename tasksel-data binary`;
# For testing purposes - set up FORCE_SID_TASKSEL to force us to use
# sid's tasksel data even if we're using stable/testing.
if (defined($ENV{'FORCE_SID_TASKSEL'}) and $ENV{'FORCE_SID_TASKSEL'} eq '1') {
print "update_tasks: forcing use of the sid tasksel-data tasks\n";
$tasksel_deb = `$basedir/tools/which_deb $mirror sid tasksel-data binary`;
}
$tasksel_deb = "$mirror/$tasksel_deb";
chomp $tasksel_deb;
# Several types of task package we care about:
#
# task-$DESKTOP-desktop - core package set for desktop $DESKTOP
# task-$LANGUAGE - core package set for language $LANGUAGE
# task-$LANGUAGE-desktop - general desktop i18n packages for $LANGUAGE
# task-$LANGUAGE-$DESKTOP-desktop - i18n packages for $DESKTOP, $LANGUAGE
# task-$FOO - package set for $FOO (mail-server, laptop, etc.)
#
# VERY much complicated by the freeform style of the names here:
# * languages can be 1, 2 or 3 words (eg. english, brazilian-portuguese, south-african-english)
# * non-desktop tasks can be 1 or 2 words (e.g. laptop, file-server)
#
# Need to parse debian-tasks.desc to work out what each type is
system("dpkg -x $tasksel_deb $tdir/tasksel");
my $descfile = "usr/share/tasksel/descs/debian-tasks.desc";
open (TASKS, "$tdir/tasksel/$descfile")
or die "can't open $tdir/tasksel/$descfile: $!\n";
while (defined (my $task = <TASKS>)) {
chomp $task;
if ($task =~ m/^Task: (\S+)/) {
$taskname = $1;
}
if ($task =~ m/^Section: (\S+)/) {
$section = $1;
if ($section eq "l10n") {
push (@l10n_tasks, $taskname);
} elsif ($section eq "server") {
push (@server_tasks, $taskname);
} elsif ($section eq "user") {
if ($taskname =~ m/^[[:alnum:]]+-desktop/) {
push (@desktop_tasks, $taskname);
} else {
push (@user_tasks, $taskname);
}
} elsif ($section eq "special") {
push (@special_tasks, $taskname);
} else {
die "update_tasks: task $taskname has unknown section $section!\n";
}
}
}
close TASKS;
#print "l10n: @l10n_tasks\n";
#print "desktop: @desktop_tasks\n";
#print "user: @user_tasks\n";
#print "server: @server_tasks\n";
#print "special: @special_tasks\n";
# Reduce special-casing and duplicate code. Add "light-desktop",
# "generic-desktop" and "all-desktop" tasks that we can use here.
push (@desktop_tasks, "light-desktop");
push (@desktop_tasks, "generic-desktop");
push (@desktop_tasks, "all-desktop");
# Write out all the groupings
foreach my $desktop (@desktop_tasks) {
my $filename;
my $desktop_name = $desktop;
$desktop_name =~ s/-desktop//g;
# Essential; $DESKTOP
$filename = "task-essential-$desktop_name";
open (DESKOUT, "> $filename") or die "can't open file $filename for writing, $!\n";
# in all-desktop, add all the desktop tasks
if ($desktop_name eq "all") {
foreach my $taskname (@desktop_tasks) {
print DESKOUT "task-$taskname\n";
}
} elsif ($desktop_name eq "generic") {
print DESKOUT "task-gnome-desktop\n";
} elsif ($desktop_name eq "light") {
print DESKOUT "task-lxde-desktop\n";
print DESKOUT "task-xfce-desktop\n";
} else {
print DESKOUT "task-$desktop\n";
}
# generic-desktop and all-desktop want all the server and user
# tasks included too
if ($desktop_name eq "all" or $desktop_name eq "generic") {
foreach my $taskname (@user_tasks) {
print DESKOUT "task-$taskname\n";
}
foreach my $taskname (@server_tasks) {
print DESKOUT "task-$taskname\n";
}
}
close DESKOUT;
# Full; $DESKTOP
$filename = "task-full-$desktop_name";
open (DESKOUT, "> $filename") or die "can't open file $filename for writing, $!\n";
# in all-desktop, add all the desktop tasks now
if ($desktop_name eq "all") {
foreach my $taskname (@desktop_tasks) {
print DESKOUT "task-$taskname\n";
}
} elsif ($desktop_name eq "generic") {
print DESKOUT "task-gnome-desktop\n";
} elsif ($desktop_name eq "light") {
print DESKOUT "task-lxde-desktop\n";
print DESKOUT "task-xfce-desktop\n";
} else {
print DESKOUT "task-$desktop\n";
}
# generic-desktop and all-desktop want all the server and user
# tasks included too
if ($desktop_name eq "all" or $desktop_name eq "generic") {
foreach my $taskname (@user_tasks) {
print DESKOUT "task-$taskname\n";
}
foreach my $taskname (@server_tasks) {
print DESKOUT "task-$taskname\n";
}
}
# task-$LANGUAGE, same for all flavours
foreach my $taskname (@l10n_tasks) {
if ($taskname !~ m/desktop/) {
print DESKOUT "task-$taskname\n";
}
}
# task-$LANGUAGE-desktop, same for all flavours
foreach my $taskname (@l10n_tasks) {
if ($taskname =~ m/desktop/) {
my $include = 1;
foreach my $dsk (@desktop_tasks) {
if ($taskname =~ m/$dsk/) {
$include = 0;
last;
}
}
if ($include) {
print DESKOUT "task-$taskname\n";
}
}
}
# in all-desktop, add all the desktop l10n tasks
if ($desktop_name eq "all") {
# task-$LANGUAGE-$DESKTOP-desktop
foreach my $taskname (@l10n_tasks) {
foreach my $dsk (@desktop_tasks) {
if ($taskname =~ m/$dsk/) {
print DESKOUT "task-$taskname\n";
}
}
}
} elsif ($desktop_name eq "generic") {
# in generic-desktop, add the desktop l10n tasks as though for
# Gnome *first*. Others will come later
# task-$LANGUAGE-$DESKTOP-desktop
foreach my $taskname (@l10n_tasks) {
if ($taskname =~ m/gnome/) {
print DESKOUT "task-$taskname\n";
}
}
# task-!gnome-desktop
foreach my $taskname (@desktop_tasks) {
if ($taskname !~ m/gnome/) {
print DESKOUT "task-$taskname\n";
}
}
# task-$LANGUAGE-!gnome-desktop
foreach my $taskname (@l10n_tasks) {
if ($taskname =~ m/desktop$/) {
my $include = 0;
foreach my $dsk (@desktop_tasks) {
if ($dsk !~ m/gnome/ and $taskname =~ m/$dsk/) {
$include = 1;
last;
}
}
if ($include) {
print DESKOUT "task-$taskname\n";
}
}
}
} elsif ($desktop_name eq "light") {
# task-$LANGUAGE-$DESKTOP-desktop
foreach my $taskname (@l10n_tasks) {
if ($taskname =~ m/lxde/ or $taskname =~ m/xfce/) {
print DESKOUT "task-$taskname\n";
}
}
} else {
# a specific desktop, just add the desktop l10n tasks for this
# desktop
# task-$LANGUAGE-$DESKTOP-desktop
foreach my $taskname (@l10n_tasks) {
if ($taskname =~ m/$desktop_name/) {
print DESKOUT "task-$taskname\n";
}
}
}
close DESKOUT;
}
|