Dpkg::Vendor::Debian: Add support for new hardening branch feature
[dpkg.git] / lib / dpkg / fields.c
blob471e6e02e97925f5a3f9384ba3d4c4669a0ac7f3
1 /*
2 * libdpkg - Debian packaging suite library routines
3 * fields.c - parsing of all the different fields, when reading in
5 * Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
6 * Copyright © 2001 Wichert Akkerman
7 * Copyright © 2006-2015 Guillem Jover <guillem@debian.org>
8 * Copyright © 2009 Canonical Ltd.
9 * Copyright © 2011 Linaro Limited
10 * Copyright © 2011 Raphaël Hertzog <hertzog@debian.org>
12 * This is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <https://www.gnu.org/licenses/>.
26 #include <config.h>
27 #include <compat.h>
29 #include <string.h>
30 #include <stdio.h>
32 #include <dpkg/i18n.h>
33 #include <dpkg/c-ctype.h>
34 #include <dpkg/dpkg.h>
35 #include <dpkg/dpkg-db.h>
36 #include <dpkg/arch.h>
37 #include <dpkg/string.h>
38 #include <dpkg/path.h>
39 #include <dpkg/parsedump.h>
40 #include <dpkg/pkg-spec.h>
41 #include <dpkg/triglib.h>
43 /**
44 * Flags to parse a name associated to a value.
46 enum parse_nv_mode {
47 /** Expect no more words (default). */
48 PARSE_NV_LAST = 0,
49 /** Expect another word after the parsed name. */
50 PARSE_NV_NEXT = 1,
51 /** Do not fail if there is no name with an associated value found. */
52 PARSE_NV_FALLBACK = 2,
55 /**
56 * Parses a name and returns its associated value.
58 * Gets a pointer to the string to parse in @a strp, and modifies the pointer
59 * to the string to point to the end of the parsed text. If no value is found
60 * for the name and @a flags is set to #PARSE_NV_FALLBACK then @a strp is set
61 * to NULL and returns -1, otherwise a parse error is emitted.
63 static int
64 parse_nv(struct parsedb_state *ps, enum parse_nv_mode parse_mode,
65 const char **strp, const struct namevalue *nv_head)
67 const char *str_start = *strp, *str_end;
68 const struct namevalue *nv;
69 int value;
71 dpkg_error_destroy(&ps->err);
73 if (str_start[0] == '\0')
74 return dpkg_put_error(&ps->err, _("is missing a value"));
76 nv = namevalue_find_by_name(nv_head, str_start);
77 if (nv == NULL) {
78 /* We got no match, skip further string validation. */
79 if (parse_mode != PARSE_NV_FALLBACK)
80 return dpkg_put_error(&ps->err, _("has invalid value '%.50s'"), str_start);
82 str_end = NULL;
83 value = -1;
84 } else {
85 str_end = str_start + nv->length;
86 while (c_isspace(str_end[0]))
87 str_end++;
88 value = nv->value;
90 if (parse_mode != PARSE_NV_NEXT && str_is_set(str_end))
91 return dpkg_put_error(&ps->err, _("has trailing junk"));
94 *strp = str_end;
96 return value;
99 void
100 f_name(struct pkginfo *pkg, struct pkgbin *pkgbin,
101 struct parsedb_state *ps,
102 const char *value, const struct fieldinfo *fip)
104 const char *e;
106 e = pkg_name_is_illegal(value);
107 if (e != NULL)
108 parse_error(ps, _("invalid package name in '%s' field: %s"), fip->name, e);
109 /* We use the new name, as pkg_hash_find_set() may have done a tolower for us. */
110 pkg->set->name = pkg_hash_find_set(value)->name;
113 void
114 f_archives(struct pkginfo *pkg, struct pkgbin *pkgbin,
115 struct parsedb_state *ps,
116 const char *value, const struct fieldinfo *fip)
118 struct archivedetails *fdp, **fdpp;
119 char *cpos, *space;
120 int allowextend;
122 if (!*value)
123 parse_error(ps, _("empty archive details '%s' field"), fip->name);
124 if (!(ps->flags & pdb_recordavailable))
125 parse_error(ps,
126 _("archive details '%s' field not allowed in status file"),
127 fip->name);
128 allowextend = !pkg->archives;
129 fdpp = &pkg->archives;
130 cpos= nfstrsave(value);
131 while (*cpos) {
132 space = cpos;
133 while (*space && !c_isspace(*space))
134 space++;
135 if (*space)
136 *space++ = '\0';
137 fdp= *fdpp;
138 if (!fdp) {
139 if (!allowextend)
140 parse_error(ps,
141 _("too many values in archive details '%s' field "
142 "(compared to others)"), fip->name);
143 fdp = nfmalloc(sizeof(*fdp));
144 fdp->next= NULL;
145 fdp->name= fdp->msdosname= fdp->size= fdp->md5sum= NULL;
146 *fdpp= fdp;
148 STRUCTFIELD(fdp, fip->integer, const char *) = cpos;
149 fdpp= &fdp->next;
150 while (*space && c_isspace(*space))
151 space++;
152 cpos= space;
154 if (*fdpp)
155 parse_error(ps,
156 _("too few values in archive details '%s' field "
157 "(compared to others)"), fip->name);
160 void
161 f_charfield(struct pkginfo *pkg, struct pkgbin *pkgbin,
162 struct parsedb_state *ps,
163 const char *value, const struct fieldinfo *fip)
165 if (*value)
166 STRUCTFIELD(pkgbin, fip->integer, char *) = nfstrsave(value);
169 void
170 f_boolean(struct pkginfo *pkg, struct pkgbin *pkgbin,
171 struct parsedb_state *ps,
172 const char *value, const struct fieldinfo *fip)
174 bool boolean;
176 if (!*value)
177 return;
179 boolean = parse_nv(ps, PARSE_NV_LAST, &value, booleaninfos);
180 if (dpkg_has_error(&ps->err))
181 parse_error(ps, _("boolean (yes/no) '%s' field: %s"),
182 fip->name, ps->err.str);
184 STRUCTFIELD(pkgbin, fip->integer, bool) = boolean;
187 void
188 f_multiarch(struct pkginfo *pkg, struct pkgbin *pkgbin,
189 struct parsedb_state *ps,
190 const char *value, const struct fieldinfo *fip)
192 int multiarch;
194 if (!*value)
195 return;
197 multiarch = parse_nv(ps, PARSE_NV_LAST, &value, multiarchinfos);
198 if (dpkg_has_error(&ps->err))
199 parse_error(ps, _("quadstate (foreign/allowed/same/no) '%s' field: %s"),
200 fip->name, ps->err.str);
201 STRUCTFIELD(pkgbin, fip->integer, int) = multiarch;
204 void
205 f_architecture(struct pkginfo *pkg, struct pkgbin *pkgbin,
206 struct parsedb_state *ps,
207 const char *value, const struct fieldinfo *fip)
209 pkgbin->arch = dpkg_arch_find(value);
210 if (pkgbin->arch->type == DPKG_ARCH_ILLEGAL)
211 parse_warn(ps, _("'%s' is not a valid architecture name in '%s' field: %s"),
212 value, fip->name, dpkg_arch_name_is_illegal(value));
215 void
216 f_section(struct pkginfo *pkg, struct pkgbin *pkgbin,
217 struct parsedb_state *ps,
218 const char *value, const struct fieldinfo *fip)
220 if (!*value) return;
221 pkg->section = nfstrsave(value);
224 void
225 f_priority(struct pkginfo *pkg, struct pkgbin *pkgbin,
226 struct parsedb_state *ps,
227 const char *value, const struct fieldinfo *fip)
229 const char *str = value;
230 int priority;
232 if (!*value) return;
234 priority = parse_nv(ps, PARSE_NV_FALLBACK, &str, priorityinfos);
235 if (dpkg_has_error(&ps->err))
236 parse_error(ps, _("word in '%s' field: %s"), fip->name, ps->err.str);
238 if (str == NULL) {
239 pkg->priority = PKG_PRIO_OTHER;
240 pkg->otherpriority = nfstrsave(value);
241 } else {
242 pkg->priority = priority;
246 void
247 f_obs_class(struct pkginfo *pkg, struct pkgbin *pkgbin,
248 struct parsedb_state *ps,
249 const char *value, const struct fieldinfo *fip)
251 parse_warn(ps, _("obsolete '%s' field used"), fip->name);
252 f_priority(pkg, pkgbin, ps, value, fip);
255 void
256 f_status(struct pkginfo *pkg, struct pkgbin *pkgbin,
257 struct parsedb_state *ps,
258 const char *value, const struct fieldinfo *fip)
260 if (ps->flags & pdb_rejectstatus)
261 parse_error(ps,
262 _("value for '%s' field not allowed in this context"),
263 fip->name);
264 if (ps->flags & pdb_recordavailable)
265 return;
267 pkg->want = parse_nv(ps, PARSE_NV_NEXT, &value, wantinfos);
268 if (dpkg_has_error(&ps->err))
269 parse_error(ps, _("first (want) word in '%s' field: %s"),
270 fip->name, ps->err.str);
271 pkg->eflag = parse_nv(ps, PARSE_NV_NEXT, &value, eflaginfos);
272 if (dpkg_has_error(&ps->err))
273 parse_error(ps, _("second (error) word in '%s' field: %s"),
274 fip->name, ps->err.str);
275 pkg->status = parse_nv(ps, PARSE_NV_LAST, &value, statusinfos);
276 if (dpkg_has_error(&ps->err))
277 parse_error(ps, _("third (status) word in '%s' field: %s"),
278 fip->name, ps->err.str);
281 void
282 f_version(struct pkginfo *pkg, struct pkgbin *pkgbin,
283 struct parsedb_state *ps,
284 const char *value, const struct fieldinfo *fip)
286 if (parse_db_version(ps, &pkgbin->version, value) < 0)
287 parse_problem(ps, _("'%s' field value '%.250s'"), fip->name, value);
290 void
291 f_obs_revision(struct pkginfo *pkg, struct pkgbin *pkgbin,
292 struct parsedb_state *ps,
293 const char *value, const struct fieldinfo *fip)
295 char *newversion;
297 parse_warn(ps, _("obsolete '%s' field used"), fip->name);
298 if (!*value) return;
299 if (str_is_set(pkgbin->version.revision)) {
300 newversion = nfmalloc(strlen(pkgbin->version.version) +
301 strlen(pkgbin->version.revision) + 2);
302 sprintf(newversion, "%s-%s", pkgbin->version.version,
303 pkgbin->version.revision);
304 pkgbin->version.version = newversion;
306 pkgbin->version.revision = nfstrsave(value);
309 void
310 f_configversion(struct pkginfo *pkg, struct pkgbin *pkgbin,
311 struct parsedb_state *ps,
312 const char *value, const struct fieldinfo *fip)
314 if (ps->flags & pdb_rejectstatus)
315 parse_error(ps,
316 _("value for '%s' field not allowed in this context"),
317 fip->name);
318 if (ps->flags & pdb_recordavailable)
319 return;
321 if (parse_db_version(ps, &pkg->configversion, value) < 0)
322 parse_problem(ps, _("'%s' field value '%.250s'"), fip->name, value);
326 * The code in f_conffiles ensures that value[-1] == ' ', which is helpful.
328 static void conffvalue_lastword(const char *value, const char *from,
329 const char *endent,
330 const char **word_start_r, int *word_len_r,
331 const char **new_from_r,
332 struct parsedb_state *ps)
334 const char *lastspc;
336 if (from <= value+1) goto malformed;
337 for (lastspc= from-1; *lastspc != ' '; lastspc--);
338 if (lastspc <= value+1 || lastspc >= endent-1) goto malformed;
340 *new_from_r= lastspc;
341 *word_start_r= lastspc + 1;
342 *word_len_r= (int)(from - *word_start_r);
343 return;
345 malformed:
346 parse_error(ps,
347 _("value for '%s' field has malformed line '%.*s'"),
348 "Conffiles", (int)min(endent - value, 250), value);
351 void
352 f_conffiles(struct pkginfo *pkg, struct pkgbin *pkgbin,
353 struct parsedb_state *ps,
354 const char *value, const struct fieldinfo *fip)
356 static const char obsolete_str[]= "obsolete";
357 static const char remove_on_upgrade_str[] = "remove-on-upgrade";
358 struct conffile **lastp;
360 lastp = &pkgbin->conffiles;
361 while (*value) {
362 struct conffile *newlink;
363 const char *endent, *endfn, *hashstart;
364 char *newptr;
365 int c, namelen, hashlen;
366 bool obsolete, remove_on_upgrade;
368 c= *value++;
369 if (c == '\n') continue;
370 if (c != ' ')
371 parse_error(ps,
372 _("value for '%s' field has line starting with non-space '%c'"),
373 fip->name, c);
374 for (endent = value; (c = *endent) != '\0' && c != '\n'; endent++) ;
375 conffvalue_lastword(value, endent, endent,
376 &hashstart, &hashlen, &endfn,
377 ps);
378 remove_on_upgrade = (hashlen == sizeof(remove_on_upgrade_str) - 1 &&
379 memcmp(hashstart, remove_on_upgrade_str, hashlen) == 0);
380 if (remove_on_upgrade)
381 conffvalue_lastword(value, endfn, endent, &hashstart, &hashlen, &endfn,
382 ps);
384 obsolete= (hashlen == sizeof(obsolete_str)-1 &&
385 memcmp(hashstart, obsolete_str, hashlen) == 0);
386 if (obsolete)
387 conffvalue_lastword(value, endfn, endent,
388 &hashstart, &hashlen, &endfn,
389 ps);
390 newlink = nfmalloc(sizeof(*newlink));
391 value = path_skip_slash_dotslash(value);
392 namelen= (int)(endfn-value);
393 if (namelen <= 0)
394 parse_error(ps,
395 _("root or empty directory listed as a conffile in '%s' field"),
396 fip->name);
397 newptr = nfmalloc(namelen+2);
398 newptr[0]= '/';
399 memcpy(newptr+1,value,namelen);
400 newptr[namelen+1] = '\0';
401 newlink->name= newptr;
402 newptr= nfmalloc(hashlen+1);
403 memcpy(newptr, hashstart, hashlen);
404 newptr[hashlen] = '\0';
405 newlink->hash= newptr;
406 newlink->obsolete= obsolete;
407 newlink->remove_on_upgrade = remove_on_upgrade;
408 newlink->next =NULL;
409 *lastp= newlink;
410 lastp= &newlink->next;
411 value= endent;
415 void
416 f_dependency(struct pkginfo *pkg, struct pkgbin *pkgbin,
417 struct parsedb_state *ps,
418 const char *value, const struct fieldinfo *fip)
420 const char *p, *emsg;
421 static struct varbuf depname, version;
423 struct dependency **ldypp;
425 /* Empty fields are ignored. */
426 if (!*value)
427 return;
428 p= value;
430 ldypp = &pkgbin->depends;
431 while (*ldypp)
432 ldypp = &(*ldypp)->next;
434 /* Loop creating new struct dependency's. */
435 for (;;) {
436 struct deppossi **ldopp;
437 struct dependency *dyp;
439 dyp = nfmalloc(sizeof(*dyp));
440 /* Set this to NULL for now, as we don't know what our real
441 * struct pkginfo address (in the database) is going to be yet. */
442 dyp->up = NULL;
443 dyp->next= NULL; *ldypp= dyp; ldypp= &dyp->next;
444 dyp->list= NULL; ldopp= &dyp->list;
445 dyp->type= fip->integer;
447 /* Loop creating new struct deppossi's. */
448 for (;;) {
449 const char *depnamestart;
450 int depnamelength;
451 struct deppossi *dop;
453 depnamestart= p;
454 /* Skip over package name characters. */
455 while (*p && !c_isspace(*p) && *p != ':' && *p != '(' && *p != ',' &&
456 *p != '|')
457 p++;
458 depnamelength= p - depnamestart ;
459 if (depnamelength == 0)
460 parse_error(ps,
461 _("'%s' field, missing package name, or garbage where "
462 "package name expected"), fip->name);
464 varbuf_set_buf(&depname, depnamestart, depnamelength);
466 emsg = pkg_name_is_illegal(depname.buf);
467 if (emsg)
468 parse_error(ps,
469 _("'%s' field, invalid package name '%.255s': %s"),
470 fip->name, depname.buf, emsg);
471 dop = nfmalloc(sizeof(*dop));
472 dop->up= dyp;
473 dop->ed = pkg_hash_find_set(depname.buf);
474 dop->next= NULL; *ldopp= dop; ldopp= &dop->next;
476 /* Don't link this (which is after all only ‘new_pkg’ from
477 * the main parsing loop in parsedb) into the depended on
478 * packages' lists yet. This will be done later when we
479 * install this (in parse.c). For the moment we do the
480 * ‘forward’ links in deppossi (‘ed’) only, and the ‘backward’
481 * links from the depended on packages to dop are left undone. */
482 dop->rev_next = NULL;
483 dop->rev_prev = NULL;
485 dop->cyclebreak = false;
487 /* See if we have an architecture qualifier. */
488 if (*p == ':') {
489 static struct varbuf arch;
490 const char *archstart;
491 int archlength;
493 archstart = ++p;
494 while (*p && !c_isspace(*p) && *p != '(' && *p != ',' && *p != '|')
495 p++;
496 archlength = p - archstart;
497 if (archlength == 0)
498 parse_error(ps, _("'%s' field, missing architecture name, or garbage "
499 "where architecture name expected"), fip->name);
501 varbuf_set_buf(&arch, archstart, archlength);
503 dop->arch_is_implicit = false;
504 dop->arch = dpkg_arch_find(arch.buf);
506 if (dop->arch->type == DPKG_ARCH_ILLEGAL)
507 emsg = dpkg_arch_name_is_illegal(arch.buf);
508 if (emsg)
509 parse_error(ps, _("'%s' field, reference to '%.255s': "
510 "invalid architecture name '%.255s': %s"),
511 fip->name, depname.buf, arch.buf, emsg);
512 } else if (fip->integer == dep_conflicts || fip->integer == dep_breaks ||
513 fip->integer == dep_replaces) {
514 /* Conflicts/Breaks/Replaces get an implicit "any" arch qualifier. */
515 dop->arch_is_implicit = true;
516 dop->arch = dpkg_arch_get(DPKG_ARCH_WILDCARD);
517 } else {
518 /* Otherwise use the pkgbin architecture, which will be assigned to
519 * later on by parse.c, once we can guarantee we have parsed it from
520 * the control stanza. */
521 dop->arch_is_implicit = true;
522 dop->arch = NULL;
525 /* Skip whitespace after package name. */
526 while (c_isspace(*p))
527 p++;
529 /* See if we have a versioned relation. */
530 if (*p == '(') {
531 char c1;
532 const char *versionstart;
533 int versionlength;
535 p++;
536 while (c_isspace(*p))
537 p++;
538 c1= *p;
539 if (c1 == '<' || c1 == '>') {
540 char c2;
542 c2= *++p;
543 dop->verrel = (c1 == '<') ? DPKG_RELATION_LT : DPKG_RELATION_GT;
544 if (c2 == '=') {
545 dop->verrel |= DPKG_RELATION_EQ;
546 p++;
547 } else if (c2 == c1) {
548 /* Either ‘<<’ or ‘>>’. */
549 p++;
550 } else if (c2 == '<' || c2 == '>') {
551 parse_error(ps,
552 _("'%s' field, reference to '%.255s':\n"
553 " bad version relationship %c%c"),
554 fip->name, depname.buf, c1, c2);
555 dop->verrel = DPKG_RELATION_NONE;
556 } else {
557 parse_warn(ps,
558 _("'%s' field, reference to '%.255s':\n"
559 " '%c' is obsolete, use '%c=' or '%c%c' instead"),
560 fip->name, depname.buf, c1, c1, c1, c1);
561 dop->verrel |= DPKG_RELATION_EQ;
563 } else if (c1 == '=') {
564 dop->verrel = DPKG_RELATION_EQ;
565 p++;
566 } else {
567 parse_warn(ps,
568 _("'%s' field, reference to '%.255s':\n"
569 " implicit exact match on version number, "
570 "suggest using '=' instead"),
571 fip->name, depname.buf);
572 dop->verrel = DPKG_RELATION_EQ;
574 if ((dop->verrel != DPKG_RELATION_EQ) && (fip->integer == dep_provides))
575 parse_warn(ps,
576 _("only exact versions may be used for '%s' field"),
577 fip->name);
579 if (!c_isspace(*p) && !c_isalnum(*p)) {
580 parse_warn(ps,
581 _("'%s' field, reference to '%.255s':\n"
582 " version value starts with non-alphanumeric, "
583 "suggest adding a space"),
584 fip->name, depname.buf);
586 /* Skip spaces between the relation and the version. */
587 while (c_isspace(*p))
588 p++;
590 versionstart= p;
591 while (*p && *p != ')' && *p != '(') {
592 if (c_isspace(*p))
593 break;
594 p++;
596 versionlength= p - versionstart;
597 while (c_isspace(*p))
598 p++;
599 if (*p == '\0')
600 parse_error(ps,
601 _("'%s' field, reference to '%.255s': "
602 "version unterminated"), fip->name, depname.buf);
603 else if (*p != ')')
604 parse_error(ps,
605 _("'%s' field, reference to '%.255s': "
606 "version contains '%c' instead of '%c'"),
607 fip->name, depname.buf, *p, ')');
608 varbuf_set_buf(&version, versionstart, versionlength);
609 if (parse_db_version(ps, &dop->version, version.buf) < 0)
610 parse_problem(ps,
611 _("'%s' field, reference to '%.255s': version '%s'"),
612 fip->name, depname.buf, version.buf);
613 p++;
614 while (c_isspace(*p))
615 p++;
616 } else {
617 dop->verrel = DPKG_RELATION_NONE;
618 dpkg_version_blank(&dop->version);
620 if (!*p || *p == ',') break;
621 if (*p != '|')
622 parse_error(ps,
623 _("'%s' field, syntax error after reference to package '%.255s'"),
624 fip->name, dop->ed->name);
625 if (fip->integer == dep_conflicts ||
626 fip->integer == dep_breaks ||
627 fip->integer == dep_provides ||
628 fip->integer == dep_replaces)
629 parse_error(ps, _("alternatives ('|') not allowed in '%s' field"),
630 fip->name);
631 p++;
632 while (c_isspace(*p))
633 p++;
635 if (!*p) break;
636 p++;
637 while (c_isspace(*p))
638 p++;
642 void
643 f_obs_dependency(struct pkginfo *pkg, struct pkgbin *pkgbin,
644 struct parsedb_state *ps,
645 const char *value, const struct fieldinfo *fip)
647 parse_warn(ps, _("obsolete '%s' field used"), fip->name);
648 f_dependency(pkg, pkgbin, ps, value, fip);
651 static const char *
652 scan_word(const char **valp)
654 static struct varbuf word;
655 const char *p, *start, *end;
657 p = *valp;
658 for (;;) {
659 if (!*p) {
660 *valp = p;
661 return NULL;
663 if (c_iswhite(*p)) {
664 p++;
665 continue;
667 start = p;
668 break;
670 for (;;) {
671 if (*p && !c_iswhite(*p)) {
672 p++;
673 continue;
675 end = p;
676 break;
679 varbuf_set_buf(&word, start, end - start);
681 *valp = p;
683 return word.buf;
686 void
687 f_trigpend(struct pkginfo *pend, struct pkgbin *pkgbin,
688 struct parsedb_state *ps,
689 const char *value, const struct fieldinfo *fip)
691 const char *word;
693 if (ps->flags & pdb_rejectstatus)
694 parse_error(ps,
695 _("value for '%s' field not allowed in this context"),
696 fip->name);
698 while ((word = scan_word(&value))) {
699 const char *emsg;
701 emsg = trig_name_is_illegal(word);
702 if (emsg)
703 parse_error(ps,
704 _("illegal pending trigger name '%.255s': %s"), word, emsg);
706 if (!trig_note_pend_core(pend, nfstrsave(word)))
707 parse_error(ps,
708 _("duplicate pending trigger '%.255s'"), word);
712 void
713 f_trigaw(struct pkginfo *aw, struct pkgbin *pkgbin,
714 struct parsedb_state *ps,
715 const char *value, const struct fieldinfo *fip)
717 const char *word;
719 if (ps->flags & pdb_rejectstatus)
720 parse_error(ps,
721 _("value for '%s' field not allowed in this context"),
722 fip->name);
724 while ((word = scan_word(&value))) {
725 struct pkginfo *pend;
726 struct dpkg_error err;
728 pend = pkg_spec_parse_pkg(word, &err);
729 if (pend == NULL)
730 parse_error(ps,
731 _("illegal package name in awaited trigger '%.255s': %s"),
732 word, err.str);
734 if (!trig_note_aw(pend, aw))
735 parse_error(ps,
736 _("duplicate awaited trigger package '%.255s'"), word);
738 trig_awaited_pend_enqueue(pend);