Browse Source

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

keep-around/43e990ab3f4cc50982f8dbc32e3465ca7c827876
Joey Hess 18 years ago
parent
commit
0d514368f6
  1. 1
      debian/changelog
  2. 41
      tasksel.pl
  3. 7
      tasksel.pod

1
debian/changelog

@ -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.

41
tasksel.pl

@ -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;

7
tasksel.pod

@ -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