~ubuntubudgie-dev/tasksel/ubuntu-budgie-tasksel-proposal.zesty

« back to all changes in this revision

Viewing changes to tasksel.c

  • Committer: Joey Hess
  • Date: 2001-05-18 02:02:02 UTC
  • Revision ID: git-v1:9aadd503b5a19ad2c7d4790e7af67660cb60d557
My changes:
  * Added support for task description files.
  * Read in /usr/share/tasksel/debian-tasks.desc as a task description
    file.
  * Added makedesc.pl, a program to generate a task description file from
    a set of task descriptions.
  * Got rid of all the name prettification code since it is no longer used
    anyway.
  * Killed filterdescription, the task packages in woody actually don't
    have that problem anymore.
  * Don't move cursor to the right after a task is selected.
  * Removed unused tasksel.man from source package (keep pod).
  * Fixed an obscure bug if a task package happened to be the last thing in
    the available file.
  * Enable debug mode by default, but turn it off when building from the
    rules file.

Aj's changes:
  * Use "Section:" fields to break tasks into different sections. Have a
    hardcoded list of default sections, with a defined order; remaining
    sections get added to the end, in alphabetical order. Sections that
    don't match "tasks-*" are ignored.
  * "tasksel install foo bar baz" as a replacement for "apt-get install
    task-foo task-bar task-baz"
  * Increase the size of the "apt-get install" command line buffer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: tasksel.c,v 1.10 2001/04/24 06:35:07 tausq Exp $ */
 
1
/* $Id: tasksel.c,v 1.11 2001/05/18 02:02:02 joeyh Exp $ */
2
2
#include "tasksel.h"
3
3
 
4
4
#include <stdio.h>
45
45
{
46
46
  int i, c = 0;
47
47
  FILE *todpkg;
48
 
  char buf[8192];
 
48
  char buf[20480];
49
49
 
50
50
  if (queueinstalls) {
51
51
    if (testmode)
63
63
    for (i = 0; i < taskcount; i++) {
64
64
      if (tasklist[i]->selected > 0) {
65
65
        int j;
66
 
        if (tasklist[i]->task_pkg) {
 
66
        if (tasklist[i]->task_pkg && ! tasklist[i]->task_pkg->pseudopackage) {
67
67
          fprintf(todpkg, "%s install\n", tasklist[i]->task_pkg->name);
68
68
        }
69
69
        for (j = 0; j < tasklist[i]->packagescount; j++) {
92
92
      if (tasklist[i]->selected > 0) { 
93
93
        int j;
94
94
        /* TODO check buffer overflow; not likely, but still... */
95
 
        if (tasklist[i]->task_pkg) {
 
95
        if (tasklist[i]->task_pkg && ! tasklist[i]->task_pkg->pseudopackage) {
96
96
          strcat(buf, tasklist[i]->task_pkg->name);
97
97
          strcat(buf, " ");
98
98
        }
149
149
    }
150
150
  }
151
151
  
 
152
  /* Initialization */
 
153
  memset(&packages, 0, sizeof(struct packages_t));
 
154
  memset(&tasks, 0, sizeof(struct tasks_t));
 
155
  
 
156
  /* Must read packages first. */
152
157
  packages_readlist(&tasks, &packages);
 
158
  
 
159
  /* TODO: should probably read in all files in a directory. */
 
160
  taskfile_read(TASKDESC, &tasks, &packages);
153
161
 
154
162
  if (tasks.count == 0) {
155
163
    fprintf(stderr, _("No task packages found on this system.\nDid you update your available file?"));
176
184
  }
177
185
 
178
186
  tasklist = tasks_enumerate(&tasks);
 
187
  if (noninteractive) {
 
188
    if (optind + 1 < argc && strcmp(argv[optind], "install") == 0) {
 
189
      for (optind++; optind < argc; optind++) {
 
190
        /* mark task argv[optind] for install, if it exists */
 
191
        int i;
 
192
        for (i = 0; i < tasks.count; i++) {
 
193
          if (strcmp(tasklist[i]->name, argv[optind]) == 0) break;
 
194
        }
 
195
        if (i == tasks.count) {
 
196
          printf("E: %s: no such task\n", argv[optind]);
 
197
        } else {
 
198
          tasklist[i]->selected = 1;
 
199
        }
 
200
      }
 
201
    }
 
202
  }
 
203
 
179
204
  if (r == 0) {
180
205
    r = doinstall(tasklist, tasks.count,
181
206
                  pkglist, (installreqd || installimp || installstd