po: Update German man pages translation
[dpkg.git] / lib / dpkg / fields.c
blobefcfb26c63d633c9010777d43616850815d53ab9
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 int flags = CONFFILE_NONE;
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 if (hashlen == sizeof(remove_on_upgrade_str) - 1 &&
379 memcmp(hashstart, remove_on_upgrade_str, hashlen) == 0) {
380 flags |= CONFFILE_REMOVE_ON_UPGRADE;
381 conffvalue_lastword(value, endfn, endent, &hashstart, &hashlen, &endfn,
382 ps);
385 if (hashlen == sizeof(obsolete_str) - 1 &&
386 memcmp(hashstart, obsolete_str, hashlen) == 0) {
387 flags |= CONFFILE_OBSOLETE;
388 conffvalue_lastword(value, endfn, endent,
389 &hashstart, &hashlen, &endfn,
390 ps);
393 newlink = nfmalloc(sizeof(*newlink));
394 value = path_skip_slash_dotslash(value);
395 namelen= (int)(endfn-value);
396 if (namelen <= 0)
397 parse_error(ps,
398 _("root or empty directory listed as a conffile in '%s' field"),
399 fip->name);
400 newptr = nfmalloc(namelen+2);
401 newptr[0]= '/';
402 memcpy(newptr+1,value,namelen);
403 newptr[namelen+1] = '\0';
404 newlink->name= newptr;
405 newptr= nfmalloc(hashlen+1);
406 memcpy(newptr, hashstart, hashlen);
407 newptr[hashlen] = '\0';
408 newlink->hash= newptr;
409 newlink->flags = flags;
410 newlink->next =NULL;
411 *lastp= newlink;
412 lastp= &newlink->next;
413 value= endent;
417 void
418 f_dependency(struct pkginfo *pkg, struct pkgbin *pkgbin,
419 struct parsedb_state *ps,
420 const char *value, const struct fieldinfo *fip)
422 const char *p, *emsg;
423 static struct varbuf depname, version;
425 struct dependency **ldypp;
427 /* Empty fields are ignored. */
428 if (!*value)
429 return;
430 p= value;
432 ldypp = &pkgbin->depends;
433 while (*ldypp)
434 ldypp = &(*ldypp)->next;
436 /* Loop creating new struct dependency's. */
437 for (;;) {
438 struct deppossi **ldopp;
439 struct dependency *dyp;
441 dyp = nfmalloc(sizeof(*dyp));
442 /* Set this to NULL for now, as we don't know what our real
443 * struct pkginfo address (in the database) is going to be yet. */
444 dyp->up = NULL;
445 dyp->next= NULL; *ldypp= dyp; ldypp= &dyp->next;
446 dyp->list= NULL; ldopp= &dyp->list;
447 dyp->type= fip->integer;
449 /* Loop creating new struct deppossi's. */
450 for (;;) {
451 const char *depnamestart;
452 int depnamelength;
453 struct deppossi *dop;
455 depnamestart= p;
456 /* Skip over package name characters. */
457 while (*p && !c_isspace(*p) && *p != ':' && *p != '(' && *p != ',' &&
458 *p != '|')
459 p++;
460 depnamelength= p - depnamestart ;
461 if (depnamelength == 0)
462 parse_error(ps,
463 _("'%s' field, missing package name, or garbage where "
464 "package name expected"), fip->name);
466 varbuf_set_buf(&depname, depnamestart, depnamelength);
468 emsg = pkg_name_is_illegal(depname.buf);
469 if (emsg)
470 parse_error(ps,
471 _("'%s' field, invalid package name '%.255s': %s"),
472 fip->name, depname.buf, emsg);
473 dop = nfmalloc(sizeof(*dop));
474 dop->up= dyp;
475 dop->ed = pkg_hash_find_set(depname.buf);
476 dop->next= NULL; *ldopp= dop; ldopp= &dop->next;
478 /* Don't link this (which is after all only ‘new_pkg’ from
479 * the main parsing loop in parsedb) into the depended on
480 * packages' lists yet. This will be done later when we
481 * install this (in parse.c). For the moment we do the
482 * ‘forward’ links in deppossi (‘ed’) only, and the ‘backward’
483 * links from the depended on packages to dop are left undone. */
484 dop->rev_next = NULL;
485 dop->rev_prev = NULL;
487 dop->cyclebreak = false;
489 /* See if we have an architecture qualifier. */
490 if (*p == ':') {
491 static struct varbuf arch;
492 const char *archstart;
493 int archlength;
495 archstart = ++p;
496 while (*p && !c_isspace(*p) && *p != '(' && *p != ',' && *p != '|')
497 p++;
498 archlength = p - archstart;
499 if (archlength == 0)
500 parse_error(ps, _("'%s' field, missing architecture name, or garbage "
501 "where architecture name expected"), fip->name);
503 varbuf_set_buf(&arch, archstart, archlength);
505 dop->arch_is_implicit = false;
506 dop->arch = dpkg_arch_find(arch.buf);
508 if (dop->arch->type == DPKG_ARCH_ILLEGAL)
509 emsg = dpkg_arch_name_is_illegal(arch.buf);
510 if (emsg)
511 parse_error(ps, _("'%s' field, reference to '%.255s': "
512 "invalid architecture name '%.255s': %s"),
513 fip->name, depname.buf, arch.buf, emsg);
514 } else if (fip->integer == dep_conflicts || fip->integer == dep_breaks ||
515 fip->integer == dep_replaces) {
516 /* Conflicts/Breaks/Replaces get an implicit "any" arch qualifier. */
517 dop->arch_is_implicit = true;
518 dop->arch = dpkg_arch_get(DPKG_ARCH_WILDCARD);
519 } else {
520 /* Otherwise use the pkgbin architecture, which will be assigned to
521 * later on by parse.c, once we can guarantee we have parsed it from
522 * the control stanza. */
523 dop->arch_is_implicit = true;
524 dop->arch = NULL;
527 /* Skip whitespace after package name. */
528 while (c_isspace(*p))
529 p++;
531 /* See if we have a versioned relation. */
532 if (*p == '(') {
533 char c1;
534 const char *versionstart;
535 int versionlength;
537 p++;
538 while (c_isspace(*p))
539 p++;
540 c1= *p;
541 if (c1 == '<' || c1 == '>') {
542 char c2;
544 c2= *++p;
545 dop->verrel = (c1 == '<') ? DPKG_RELATION_LT : DPKG_RELATION_GT;
546 if (c2 == '=') {
547 dop->verrel |= DPKG_RELATION_EQ;
548 p++;
549 } else if (c2 == c1) {
550 /* Either ‘<<’ or ‘>>’. */
551 p++;
552 } else if (c2 == '<' || c2 == '>') {
553 parse_error(ps,
554 _("'%s' field, reference to '%.255s':\n"
555 " bad version relationship %c%c"),
556 fip->name, depname.buf, c1, c2);
557 } else {
558 parse_warn(ps,
559 _("'%s' field, reference to '%.255s':\n"
560 " '%c' is obsolete, use '%c=' or '%c%c' instead"),
561 fip->name, depname.buf, c1, c1, c1, c1);
562 dop->verrel |= DPKG_RELATION_EQ;
564 } else if (c1 == '=') {
565 dop->verrel = DPKG_RELATION_EQ;
566 p++;
567 } else {
568 parse_warn(ps,
569 _("'%s' field, reference to '%.255s':\n"
570 " implicit exact match on version number, "
571 "suggest using '=' instead"),
572 fip->name, depname.buf);
573 dop->verrel = DPKG_RELATION_EQ;
575 if ((dop->verrel != DPKG_RELATION_EQ) && (fip->integer == dep_provides))
576 parse_lax_problem(ps, pdb_lax_stanza_parser,
577 _("only exact versions may be used for '%s' field"),
578 fip->name);
580 if (!c_isspace(*p) && !c_isalnum(*p)) {
581 parse_warn(ps,
582 _("'%s' field, reference to '%.255s':\n"
583 " version value starts with non-alphanumeric, "
584 "suggest adding a space"),
585 fip->name, depname.buf);
587 /* Skip spaces between the relation and the version. */
588 while (c_isspace(*p))
589 p++;
591 versionstart= p;
592 while (*p && *p != ')' && *p != '(') {
593 if (c_isspace(*p))
594 break;
595 p++;
597 versionlength= p - versionstart;
598 while (c_isspace(*p))
599 p++;
600 if (*p == '\0')
601 parse_error(ps,
602 _("'%s' field, reference to '%.255s': "
603 "version unterminated"), fip->name, depname.buf);
604 else if (*p != ')')
605 parse_error(ps,
606 _("'%s' field, reference to '%.255s': "
607 "version contains '%c' instead of '%c'"),
608 fip->name, depname.buf, *p, ')');
609 varbuf_set_buf(&version, versionstart, versionlength);
610 if (parse_db_version(ps, &dop->version, version.buf) < 0)
611 parse_problem(ps,
612 _("'%s' field, reference to '%.255s': version '%s'"),
613 fip->name, depname.buf, version.buf);
614 p++;
615 while (c_isspace(*p))
616 p++;
617 } else {
618 dop->verrel = DPKG_RELATION_NONE;
619 dpkg_version_blank(&dop->version);
621 if (!*p || *p == ',') break;
622 if (*p != '|')
623 parse_error(ps,
624 _("'%s' field, syntax error after reference to package '%.255s'"),
625 fip->name, dop->ed->name);
626 if (fip->integer == dep_conflicts ||
627 fip->integer == dep_breaks ||
628 fip->integer == dep_provides ||
629 fip->integer == dep_replaces)
630 parse_error(ps, _("alternatives ('|') not allowed in '%s' field"),
631 fip->name);
632 p++;
633 while (c_isspace(*p))
634 p++;
636 if (!*p) break;
637 p++;
638 while (c_isspace(*p))
639 p++;
643 void
644 f_obs_dependency(struct pkginfo *pkg, struct pkgbin *pkgbin,
645 struct parsedb_state *ps,
646 const char *value, const struct fieldinfo *fip)
648 parse_warn(ps, _("obsolete '%s' field used"), fip->name);
649 f_dependency(pkg, pkgbin, ps, value, fip);
652 static const char *
653 scan_word(const char **valp)
655 static struct varbuf word;
656 const char *p, *start, *end;
658 p = *valp;
659 for (;;) {
660 if (!*p) {
661 *valp = p;
662 return NULL;
664 if (c_iswhite(*p)) {
665 p++;
666 continue;
668 start = p;
669 break;
671 for (;;) {
672 if (*p && !c_iswhite(*p)) {
673 p++;
674 continue;
676 end = p;
677 break;
680 varbuf_set_buf(&word, start, end - start);
682 *valp = p;
684 return word.buf;
687 void
688 f_trigpend(struct pkginfo *pend, struct pkgbin *pkgbin,
689 struct parsedb_state *ps,
690 const char *value, const struct fieldinfo *fip)
692 const char *word;
694 if (ps->flags & pdb_rejectstatus)
695 parse_error(ps,
696 _("value for '%s' field not allowed in this context"),
697 fip->name);
699 while ((word = scan_word(&value))) {
700 const char *emsg;
702 emsg = trig_name_is_illegal(word);
703 if (emsg)
704 parse_error(ps,
705 _("illegal pending trigger name '%.255s': %s"), word, emsg);
707 if (!trig_note_pend_core(pend, nfstrsave(word)))
708 parse_error(ps,
709 _("duplicate pending trigger '%.255s'"), word);
713 void
714 f_trigaw(struct pkginfo *aw, struct pkgbin *pkgbin,
715 struct parsedb_state *ps,
716 const char *value, const struct fieldinfo *fip)
718 const char *word;
720 if (ps->flags & pdb_rejectstatus)
721 parse_error(ps,
722 _("value for '%s' field not allowed in this context"),
723 fip->name);
725 while ((word = scan_word(&value))) {
726 struct pkginfo *pend;
727 struct dpkg_error err;
729 pend = pkg_spec_parse_pkg(word, &err);
730 if (pend == NULL)
731 parse_error(ps,
732 _("illegal package name in awaited trigger '%.255s': %s"),
733 word, err.str);
735 if (!trig_note_aw(pend, aw))
736 parse_error(ps,
737 _("duplicate awaited trigger package '%.255s'"), word);
739 trig_awaited_pend_enqueue(pend);