Browse Source

* Handle task removals in the same aptitude run as task installs

and manual selection, using "package-" to remove packages.
  Closes: #450777
tags/2.70
Joey Hess 13 years ago
parent
commit
885b727855
2 changed files with 16 additions and 21 deletions
  1. +4
    -1
      debian/changelog
  2. +12
    -20
      tasksel.pl

+ 4
- 1
debian/changelog View File

@@ -14,8 +14,11 @@ tasksel (2.70) UNRELEASED; urgency=low
[ Joey Hess ]
* Fix a funky $_ problem that broke calling task prerms on remove.
(See #450777.)
* Handle task removals in the same aptitude run as task installs
and manual selection, using "package-" to remove packages.
Closes: #450777

-- Joey Hess <joeyh@debian.org> Sat, 10 Nov 2007 12:19:26 -0500
-- Joey Hess <joeyh@debian.org> Sat, 10 Nov 2007 12:30:17 -0500

tasksel (2.69) unstable; urgency=low



+ 12
- 20
tasksel.pl View File

@@ -572,32 +572,21 @@ sub main {
else {
@aptitude="aptitude";
}
# Task removal..
if (@tasks_remove) {
my @packages_remove;
# And finally, act on selected tasks.
if (@tasks_install || @tasks_remove || $manual_selection) {
my @args;
foreach my $task (@tasks_remove) {
push @packages_remove, task_packages($task, 0);
push @args, map { "$_-" } task_packages($task, 0);
task_script($task->{task}, "prerm");
}
my $ret=run(@aptitude, "-y", "remove", @packages_remove);
if ($ret != 0) {
error gettext("aptitude failed")." ($ret)";
}
foreach my $task (@tasks_remove) {
task_script($task->{task}, "postrm");
}
}
# And finally, act on selected tasks.
if (@tasks_install || $manual_selection) {
my @packages_install=map {task_packages($_, 1) } @tasks_install;
foreach my $task (@tasks_install) {
push @args, task_packages($task, 1);
task_script($task->{task}, "preinst");
}
# If the user selected no other tasks and manual package
# selection, run aptitude w/o the --visual-preview parameter.
if (! @packages_install && $manual_selection) {
if (! @args && $manual_selection) {
my $ret=run("aptitude");
if ($ret != 0) {
error gettext("aptitude failed")." ($ret)";
@@ -605,15 +594,18 @@ sub main {
}
else {
if ($manual_selection) {
unshift @packages_install, "--visual-preview";
unshift @args, "--visual-preview";
}
my $ret=run(@aptitude, "--without-recommends",
"-y", "install",
@packages_install);
@args);
if ($ret != 0) {
error gettext("aptitude failed")." ($ret)";
}
}
foreach my $task (@tasks_remove) {
task_script($task->{task}, "postrm");
}
foreach my $task (@tasks_install) {
task_script($task->{task}, "postinst");
}


Loading…
Cancel
Save