Browse Source

- Add --task-packages switch, may be used by Synaptic.

tags/2.07
Joey Hess 17 years ago
parent
commit
0d514368f6
3 changed files with 39 additions and 10 deletions
  1. +1
    -0
      debian/changelog
  2. +33
    -8
      tasksel.pl
  3. +5
    -2
      tasksel.pod

+ 1
- 0
debian/changelog View File

@@ -3,6 +3,7 @@ tasksel (2.07) UNRELEASED; urgency=low
* Joey Hess
- Add --list-tasks switch.
- Document --new-install and long format switches.
- Add --task-packages switch, may be used by Synaptic.
* Translations
- Kęstutis Biliūnas
- Updated Lithuanian translation of tasks.


+ 33
- 8
tasksel.pl View File

@@ -70,6 +70,24 @@ sub read_task_desc {
return @ret;
}

# Given a task name, returns a list of all available packages in the task.
sub task_packages {
my $task=shift;
my @list;
local $/="\n\n";
open (AVAIL, "apt-cache dumpavail|");
while (<AVAIL>) {
if (/^Task: (.*)/m) {
my @tasks=split(", ", $1);
if (grep { $_ eq $task } @tasks) {
push @list, $1 if /^Package: (.*)/m;
}
}
}
close AVAIL;
return @list;
}

# Returns a list of all available packages.
sub list_avail {
my @list;
@@ -188,7 +206,8 @@ sub getopts {
my %ret;
Getopt::Long::Configure ("bundling");
if (! GetOptions(\%ret, "test|t", "required|r", "important|i",
"standard|s", "no-ui|n", "new-install", "list-tasks")) {
"standard|s", "no-ui|n", "new-install", "list-tasks",
"task-packages=s")) {
usage();
exit(1);
}
@@ -199,13 +218,14 @@ sub usage {
print STDERR gettext(q{Usage:
tasksel install <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
-i, --important install all important-priority packages
-s, --standard install all standard-priority packages
-n, --no-ui don't show UI; use with -r or -i usually
--new-install atomatically install some tasks
--list-tasks list tasks that would be displayed and exit
-t, --test test mode; don't really do anything
-r, --required install all required-priority packages
-i, --important install all important-priority packages
-s, --standard install all standard-priority packages
-n, --no-ui don't show UI; use with -r or -i usually
--new-install atomatically install some tasks
--list-tasks list tasks that would be displayed and exit
--task-packages list available packages in a task
});
}

@@ -213,6 +233,11 @@ my @aptitude_install;
my @tasks_to_install;
my %options=getopts();

if (exists $options{"task-packages"}) {
print "$_\n" foreach task_packages($options{"task-packages"});
exit(0);
}

if (@ARGV) {
if ($ARGV[0] eq "install") {
shift;


+ 5
- 2
tasksel.pod View File

@@ -44,8 +44,11 @@ used during new Debian installs.

=item B<--list-tasks>

list on stdout the tasks that would be displayed in the tasksel intserface,
and exit
list on stdout the tasks that would be displayed in the tasksel intserface

=item B<--task-packages> task

lists on stdout the packages that are available and part of the given task

=back



Loading…
Cancel
Save