Browse Source

* tasksel changes by Anthony Towns

- data.c: Made tasksel process fields after the long description. This was
     stopping tasksel for handling the new Packages files that actually
     include Task: headers, so it's kinda useful. :)
   - tasksel.c: When no tasks are present, print a trailing newline.
tags/debian_version_1_7
Anthony Towns 20 years ago
parent
commit
48ea3d9316
3 changed files with 25 additions and 7 deletions
  1. +17
    -3
      data.c
  2. +6
    -2
      debian/changelog
  3. +2
    -2
      tasksel.c

+ 17
- 3
data.c View File

@@ -1,4 +1,4 @@
/* $Id: data.c,v 1.12 2001/05/23 17:39:54 joeyh Exp $ */
/* $Id: data.c,v 1.13 2001/07/02 03:43:58 ajt Rel $ */
/* data.c - encapsulates functions for reading a package listing like dpkg's available file
* Internally, packages are stored in a binary tree format to faciliate search operations
*/
@@ -340,6 +340,13 @@ void taskfile_read(char *fn, struct tasks_t *tasks, struct packages_t *pkgs,
while (!feof(f)) {
fgets(buf, BUF_SIZE, f);
dontmakemethink:
/* after reading the Description:, we make actually have some more fields.
* but the only way we might know this is if we've just read one of those
* fields. to ensure we don't miss it, we immediately goto the label above
* when we realise our mistake. a computer scientist would use lookahead
* for this
*/
CHOMP(buf);
if (buf[0] == 0) break;

@@ -351,7 +358,7 @@ void taskfile_read(char *fn, struct tasks_t *tasks, struct packages_t *pkgs,
do {
if (fgets(buf, BUF_SIZE, f) == 0)
break;
if (buf[0] != ' ') break;
if (buf[0] != ' ') goto dontmakemethink;
if (buf[1] == '.') buf[1] = ' ';
if (longdesc == NULL) {
longdesc = (char *)MALLOC(strlen(buf) + 1);
@@ -421,6 +428,13 @@ void packages_readlist(struct tasks_t *tasks, struct packages_t *pkgs)
/* look for depends/suggests and shotdesc/longdesc */
while (!feof(f)) {
fgets(buf, BUF_SIZE, f);
dontmakemethink:
/* after reading the Description:, we make actually have some more fields.
* but the only way we might know this is if we've just read one of those
* fields. to ensure we don't miss it, we immediately goto the label above
* when we realise our mistake. a computer scientist would use lookahead
* for this
*/
CHOMP(buf);
if (buf[0] == 0) break;

@@ -457,7 +471,7 @@ void packages_readlist(struct tasks_t *tasks, struct packages_t *pkgs)
do {
if (fgets(buf, BUF_SIZE, f) == 0)
break;
if (buf[0] != ' ') break;
if (buf[0] != ' ') goto dontmakemethink;
if (buf[1] == '.') buf[1] = ' ';
if (longdesc == NULL) {
longdesc = (char *)MALLOC(strlen(buf) + 1);


+ 6
- 2
debian/changelog View File

@@ -1,8 +1,12 @@
tasksel (1.5) unstable; urgency=high

*
* tasksel changes by Anthony Towns
- data.c: Made tasksel process fields after the long description. This was
stopping tasksel for handling the new Packages files that actually
include Task: headers, so it's kinda useful. :)
- tasksel.c: When no tasks are present, print a trailing newline.

-- Adam Di Carlo <aph@debian.org> Mon, 28 May 2001 21:07:52 -0400
-- Anthony Towns <aj@azure.humbug.org.au> Mon, 2 Jul 2001 13:38:27 +1000

tasksel (1.4) unstable; urgency=high



+ 2
- 2
tasksel.c View File

@@ -1,4 +1,4 @@
/* $Id: tasksel.c,v 1.12 2001/05/23 17:39:54 joeyh Exp $ */
/* $Id: tasksel.c,v 1.13 2001/07/02 03:43:58 ajt Rel $ */
#include "tasksel.h"

#include <stdio.h>
@@ -164,7 +164,7 @@ int main(int argc, char * const argv[])
taskfile_read(TASKDESC, &tasks, &packages, showempties);

if (tasks.count == 0) {
fprintf(stderr, _("No tasks found on this system.\nDid you update your available file?"));
fprintf(stderr, _("No tasks found on this system.\nDid you update your available file?\n"));
return 255;
}


Loading…
Cancel
Save