From 08c66eaf0797b7e1bcca56a000dfa310770c17d4 Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Tue, 5 Nov 2013 01:29:40 +0000 Subject: [PATCH] * tools/update_tasks: don't hard-code the default desktop to use, instead work it out directly from the dependencies of the task-desktop package. --- debian/changelog | 3 +++ tools/update_tasks | 31 +++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index c4bebc65..e0937531 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,9 @@ debian-cd (3.1.14) UNRELEASED; urgency=low created any more, and this is causing build failures. * Remove s390 from the arch lists in various scripts, as it's going away. Support remains if specifically configured yet. + * tools/update_tasks: don't hard-code the default desktop to use, + instead work it out directly from the dependencies of the task-desktop + package. [ Robert Spencer ] * Build without isolinux/desktop. Closes: #706150 diff --git a/tools/update_tasks b/tools/update_tasks index 13155b61..96e70499 100755 --- a/tools/update_tasks +++ b/tools/update_tasks @@ -40,6 +40,21 @@ if ($coreutils_deb =~ m/_([[:alnum:]]+)\.deb/) { die "update_tasks: Can't determine arch!\n"; } +# used in a few places to decide what happens when doing "generic" +# discs. +my $default_desktop; + +# Find the dependency information of the task-desktop deb to see what +# the default desktop should be +my $task_desktop_deb = `$basedir/tools/which_deb $mirror $codename task-desktop binary`; +open (TASKS, "dpkg --info $mirror/$task_desktop_deb |") or + die "update_tasks: Can't run dpkg --info $mirror/$task_desktop_deb; $!\n"; +while () { + chomp; + /Recommends: task-(\S+)*-desktop/ and $default_desktop = $1; +} +print "update_tasks: Using \"$default_desktop\" as the default desktop, as specified by $task_desktop_deb\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`; @@ -130,7 +145,7 @@ foreach my $desktop (@desktop_tasks) { print DESKOUT "task-$taskname\n"; } } elsif ($desktop_name eq "generic") { - print DESKOUT "task-gnome-desktop\n"; + print DESKOUT "task-$default_desktop-desktop\n"; } elsif ($desktop_name eq "light") { print DESKOUT "task-lxde-desktop\n"; print DESKOUT "task-xfce-desktop\n"; @@ -160,7 +175,7 @@ foreach my $desktop (@desktop_tasks) { print DESKOUT "task-$taskname\n"; } } elsif ($desktop_name eq "generic") { - print DESKOUT "task-gnome-desktop\n"; + print DESKOUT "task-$default_desktop-desktop\n"; } elsif ($desktop_name eq "light") { print DESKOUT "task-lxde-desktop\n"; print DESKOUT "task-xfce-desktop\n"; @@ -215,27 +230,27 @@ foreach my $desktop (@desktop_tasks) { } elsif ($desktop_name eq "generic") { # in generic-desktop, add the desktop l10n tasks as though for - # Gnome *first*. Others will come later + # $default_desktop *first*. Others will come later # task-$LANGUAGE-$DESKTOP-desktop foreach my $taskname (@l10n_tasks) { - if ($taskname =~ m/gnome/) { + if ($taskname =~ m/$default_desktop/) { print DESKOUT "task-$taskname\n"; } } - # task-!gnome-desktop + # task-!$default_desktop-desktop foreach my $taskname (@desktop_tasks) { - if ($taskname !~ m/gnome/) { + if ($taskname !~ m/$default_desktop/) { print DESKOUT "task-$taskname\n"; } } - # task-$LANGUAGE-!gnome-desktop + # task-$LANGUAGE-!$default_desktop-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/) { + if ($dsk !~ m/$default_desktop/ and $taskname =~ m/$dsk/) { $include = 1; last; }