Browse Source

- Add tasksel remove command. Closes: #259664

tags/2.07
Joey Hess 17 years ago
parent
commit
8c04a5126d
3 changed files with 25 additions and 1 deletions
  1. +1
    -0
      debian/changelog
  2. +22
    -1
      tasksel.pl
  3. +2
    -0
      tasksel.pod

+ 1
- 0
debian/changelog View File

@@ -11,6 +11,7 @@ tasksel (2.07) UNRELEASED; urgency=low
server to the top.
- Use aptitude's new --visual-preview option to allow selection and then
fine-tuning of tasks.
- Add tasksel remove command. Closes: #259664
* Per Olofsson
- Added openoffice.org-help-sv and gimp-help-sv to swedish-desktop.
Closes: #259832.


+ 22
- 1
tasksel.pl View File

@@ -240,6 +240,7 @@ sub name_to_task {
sub usage {
print STDERR gettext(q{Usage:
tasksel install <task>
tasksel remove <task>
tasksel [options]; where options is any combination of:
-t, --test test mode; don't really do anything
-r, --required install all required-priority packages
@@ -268,6 +269,10 @@ sub getopts {
shift @ARGV;
$ret{install} = shift @ARGV;
}
if (@ARGV && $ARGV[0] eq "remove") {
shift @ARGV;
$ret{remove} = shift @ARGV;
}
if (@ARGV) {
usage();
exit 1;
@@ -331,10 +336,15 @@ sub main {
my $task=name_to_task($options{"install"}, @tasks);
$task->{_install} = 1 if $task;
}
my @aptitude_remove;
if ($options{"remove"}) {
my $task=name_to_task($options{"remove"}, @tasks);
push @aptitude_remove, task_packages($task, 0);
}
# The interactive bit.
my @list = order_for_display(grep { $_->{_display} == 1 } @tasks);
if (@list && ! $options{"no-ui"} && ! $options{install}) {
if (@list && ! $options{"no-ui"} && ! $options{install} && ! $options{remove}) {
map { $_->{_install} = 0 } @list; # don't install displayed tasks unless selected
my $question="tasksel/tasks";
if ($options{"new-install"}) {
@@ -383,6 +393,17 @@ sub main {
}
}
}
if (@aptitude_remove) {
if ($options{test}) {
print "aptitude remove ".join(" ", @aptitude_remove)."\n";
}
else {
my $ret=system("aptitude", "remove", @aptitude_remove) >> 8;
if ($ret != 0) {
error gettext("aptitude failed");
}
}
}
}

main();

+ 2
- 0
tasksel.pod View File

@@ -6,6 +6,8 @@ tasksel - a user interface for installing tasks

tasksel install <task>

tasksel remove <task>

tasksel [options]

=head1 DESCRIPTION


Loading…
Cancel
Save