~ubuntu-branches/debian/wheezy/dpkg/wheezy

« back to all changes in this revision

Viewing changes to lib/dpkg/fields.c

  • Committer: Bazaar Package Importer
  • Author(s): Guillem Jover, Guillem Jover, Raphaël Hertzog, Jonathan Nieder, Steve Langasek, Mark Hymers, Updated programs translations, Updated man page translations, Updated scripts translations, Updated dselect translations
  • Date: 2011-04-01 23:56:54 UTC
  • Revision ID: james.westby@ubuntu.com-20110401235654-8y800dtb75skfrh7
Tags: 1.16.0
[ Guillem Jover ]
* Use DPKG_MAINTSCRIPT_PACKAGE environment variable as package name on
  dpkg-divert when no --package or --local options have been specified.
* Do not allow versions starting with non-digit when doing strict parsing,
  warn otherwise.
* Update dpkg(1) to note that --status-fd output does not contain newlines
  in error messages anymore (this was fixed in 1.15.0).
* Add a new --status-logger option to dpkg, similar to --status-fd but
  instead invoke the command ourselves and feed the status information
  to its standard input. Suggested by Raphaël Hertzog.
* Add missing space in update-alternative --set-selections output.
* Add missing options to update-alternative --help output.
* Count “conffile name is duplicated” for dpkg-deb warning count summary.
* Improve and clarify strings for translation. Closes: #604914
* Prefix all fatal error messages with “error: ”.
* Do not check presence of update-rc.d in the PATH in dpkg, as it's not
  a program needed for dpkg correct operation.
* Fix dpkg -GEO options on multiple versions of the same packages.
  Closes: #31141
* Propagate --admindir to programs run from maintainer scritpts.
  Closes: #97076
* Do not fail when trying to remove the root directory. This will only
  happen either on distributions where dpkg is a foreign package manager,
  or on artificial dpkg databases.
* Always warn when parsing any package control data which does not have
  an Architecture field except for status and status log files when
  packages are not-installed or half-installed.
* By default reject installing packages w/o an Architecture field. They
  now need --force-architecture, dpkg will still warn about them though.
* Fix build failure when passing --disable-nls to configure.
* Do not segfault on “dpkg -i --no-act”.
* Add missing semicolon to the vsnprintf() compat declaration.
  Thanks to Robert Millan. Closes: #612203
* On install for Ubuntu adjust the i386 GNU cpu name in cputable.
  Thanks to Colin Watson <cjwatson@ubuntu.com>. Closes: #611741
* Sync the info database directory on unpack instead of the temporary
  control information directory, and print the correct pathname on error
  instead of the last file acted on that directory.
* Document in dpkg-query --help output and man page that --list and --show
  arguments are optional.
* Do not read and write the available file unnecessarily.
  Thanks to Michel Lespinasse <walken@zoy.org>. Closes: #397121
* Fix typo in «dpkg-name --overwrite» argument parsing so that it actually
  works at all. Thanks to Ivan Gagis <igagis@gmail.com>. LP: #728708
* Add armhf support to ostable and triplettable. Closes: #594179
* Set the modification time for unpacked symlinks on supported systems.
* Fix undefined value useage in dpkg-genchanges when adding files w/o a
  matching architecture, because they are not present in debian/control,
  this is most commonly the case due to dpkg-distaddfile.
* Terminate immediately on dpkg-divert rename errors instead of propagating
  up the error codes, this improves error reporting and avoids triggering
  leak detectors. Closes: #620380
* When moving a diverted file across filesystems in dpkg-divert, remove
  the source file.

[ Raphaël Hertzog ]
* Fail properly when debian/source/format is empty. Closes: #600854
* Add new deb-src-control(5) manual page documenting the debian/control
  file contained in source packages.
  - it documents the X[SBC]- prefix. Closes: #476335
  - it documents the VCS-* fields too. Closes: #483119
  Thanks to Oxan van Leeuwen <oxan@oxanvanleeuwen.nl> who wrote it
  as part of the Google Code In program.
* Enhance dpkg-shlibdeps to not fail immediatly when a library is not found.
  Instead continue and fail after all problems have been reported. Thanks
  to Chris Baines <cbaines8@gmail.com> for the patch. Closes: #596841
* Fix dpkg-source to not list Debian packaging files as modified
  upstream files in Format "1.0" when unpacking to a non-standard
  directory.
* Apply patch from Colin Watson to let dpkg-buildflags return -O3
  instead of -O2 when building ppc64 packages on Ubuntu. Closes: #612472
* Add new function get_control_path() to Dpkg::Path, it wraps dpkg-query
  --control-path.
* Update dpkg-shlibdeps to be multiarch-ready:
  - use get_control_path() to find symbols/shlibs files
  - parse correctly the output of dpkg --search
* Small fix to support files >2GB in .deb on 64-bit systems. Closes: #616502
  Thanks to Martin Dorey <mdorey@bluearc.com> for the patch.
* dpkg-source now keeps the file ordering in the autogenerated patch when
  regenerating it. Closes: #606080
  Thanks to Colin Watson for the patch.
* dpkg-source now uses a timestamp retrieved from the filesystem when
  resetting the timestamp of patched files so that a time skew when using
  NFS doesn't introduce any inconsistency. Closes: #613023
  Thanks to Jonathan Nieder <jrnieder@gmail.com> for the patch and the
  diagnosis.
* dpkg-source will now remove quilt's .pc directory when --unapply-patches
  is in use. Closes: #591858
* dpkg-source is now a bit less strict when parsing patches:
  - it accepts seeing the same file twice; Closes: #608829
  - it doesn't match on the English text "No newline at end of file" as it
    might be translated in some cases. Closes: #612465
* Improve parser in Dpkg::Control::Hash to not require an empty line
  before the PGP signature. Closes: #617923
  Thanks to Roger Leigh for the initial patch.
* Fix a regression in dpkg-divert where using --rename led to a failure when
  the rename implies crossing file systems. Thanks to Durk Strooisma for
  spotting it.
* Use the correct mtime when installing a file with statoverrides.
  Regression introduced in 1.16.0. LP: #739179
* Remove duplicate word in german translation of dpkg(1). Closes: #616096
* Strip repeated non-significant spaces before and after newlines
  in Uploaders. Closes: #598922
* Ignore whitespaces after options in headers of changelog entries.
  Closes: #605719
* Fix dpkg-source's regression with empty patches (introduced while fixing
  #613023). Closes: #619541

[ Jonathan Nieder ]
* Remove support for use of synchronous sync(2), due to its pernicious
  side-effects and to ease maintenance.
* Clarify that an up-to-date dpkg only needs to be unpacked for
  dpkg-maintscript-helper to work.

[ Steve Langasek ]
* Add new variables to dpkg-architecture, DEB_HOST_MULTIARCH and
  DEB_BUILD_MULTIARCH, that return the "ideal" GNU triplet for each
  architecture which should be used as the path component for library
  installation.

[ Mark Hymers ]
* Add support for Built-Using field. Closes: #619311

[ Updated programs translations ]
* German (Sven Joachim).
* Portuguese (Miguel Figueiredo).
* Spanish (Javier Fernandez-Sanguino).
* Swedish (Peter Krefting).

[ Updated man page translations ]
* German (Helge Kreutzmann).
* Swedish (Peter Krefting).

[ Updated scripts translations ]
* German (Helge Kreutzmann).
* Swedish (Peter Krefting).

[ Updated dselect translations ]
* Spanish (Javier Fernandez-Sanguino).

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include <dpkg/triglib.h>
35
35
 
36
36
static int
37
 
convert_string(struct parsedb_state *ps, const char *what, int otherwise,
38
 
               const struct pkginfo *pigp,
39
 
               const char *startp, const struct namevalue *ivip,
40
 
               const char **endpp)
 
37
parse_nv_next(struct parsedb_state *ps, const struct pkginfo *pigp,
 
38
              const char *what, const struct namevalue *nv_head,
 
39
              const char **strp)
41
40
{
42
 
  const char *ep;
43
 
  const struct namevalue *nvip = ivip;
 
41
  const char *str_start = *strp, *str_end;
 
42
  const struct namevalue *nv;
44
43
 
45
 
  if (!*startp)
 
44
  if (str_start[0] == '\0')
46
45
    parse_error(ps, pigp, _("%s is missing"), what);
47
 
  while (nvip->name) {
48
 
    if (strncasecmp(nvip->name, startp, nvip->length))
49
 
      nvip++;
50
 
    else
51
 
      break;
52
 
  }
53
 
  if (!nvip->name) {
54
 
    if (otherwise != -1) return otherwise;
55
 
    parse_error(ps, pigp, _("`%.*s' is not allowed for %s"),
56
 
                (int)strnlen(startp, 50), startp, what);
57
 
  }
58
 
 
59
 
  ep = startp + nvip->length;
60
 
  while (isspace(*ep))
61
 
    ep++;
62
 
  if (*ep && !endpp)
63
 
    parse_error(ps, pigp, _("junk after %s"), what);
64
 
  if (endpp) *endpp= ep;
65
 
  return nvip->value;
 
46
 
 
47
  nv = namevalue_find_by_name(nv_head, str_start);
 
48
  if (nv == NULL)
 
49
    parse_error(ps, pigp, _("'%.50s' is not allowed for %s"), str_start, what);
 
50
 
 
51
  str_end = str_start + nv->length;
 
52
  while (isspace(str_end[0]))
 
53
    str_end++;
 
54
  *strp = str_end;
 
55
 
 
56
  return nv->value;
 
57
}
 
58
 
 
59
static int
 
60
parse_nv_last(struct parsedb_state *ps, const struct pkginfo *pkg,
 
61
              const char *what, const struct namevalue *nv_head,
 
62
              const char *str)
 
63
{
 
64
  int value;
 
65
 
 
66
  value = parse_nv_next(ps, pkg, what, nv_head, &str);
 
67
  if (str[0] != '\0')
 
68
    parse_error(ps, pkg, _("junk after %s"), what);
 
69
 
 
70
  return value;
66
71
}
67
72
 
68
73
void
69
 
f_name(struct pkginfo *pigp, struct pkginfoperfile *pifp,
 
74
f_name(struct pkginfo *pigp, struct pkgbin *pifp,
70
75
       struct parsedb_state *ps,
71
76
       const char *value, const struct fieldinfo *fip)
72
77
{
73
78
  const char *e;
74
 
  if ((e= illegal_packagename(value,NULL)) != NULL)
 
79
 
 
80
  e = pkg_name_is_illegal(value, NULL);
 
81
  if (e != NULL)
75
82
    parse_error(ps, pigp, _("invalid package name (%.250s)"), e);
76
 
  pigp->name= findpackage(value)->name;
77
 
  /* We use the new name, as findpackage() may have
78
 
     done a tolower for us.
79
 
   */
 
83
  /* We use the new name, as pkg_db_find() may have done a tolower for us. */
 
84
  pigp->name = pkg_db_find(value)->name;
80
85
}
81
86
 
82
 
void f_filecharf(struct pkginfo *pigp, struct pkginfoperfile *pifp,
83
 
                 struct parsedb_state *ps,
84
 
                 const char *value, const struct fieldinfo *fip) {
 
87
void
 
88
f_filecharf(struct pkginfo *pigp, struct pkgbin *pifp,
 
89
            struct parsedb_state *ps,
 
90
            const char *value, const struct fieldinfo *fip)
 
91
{
85
92
  struct filedetails *fdp, **fdpp;
86
93
  char *cpos, *space;
87
94
  int allowextend;
121
128
                  "(compared to others)"), fip->name);
122
129
}
123
130
 
124
 
void f_charfield(struct pkginfo *pigp, struct pkginfoperfile *pifp,
125
 
                 struct parsedb_state *ps,
126
 
                 const char *value, const struct fieldinfo *fip) {
 
131
void
 
132
f_charfield(struct pkginfo *pigp, struct pkgbin *pifp,
 
133
            struct parsedb_state *ps,
 
134
            const char *value, const struct fieldinfo *fip)
 
135
{
127
136
  if (*value) PKGPFIELD(pifp,fip->integer,char*)= nfstrsave(value);
128
137
}
129
138
 
130
 
void f_boolean(struct pkginfo *pigp, struct pkginfoperfile *pifp,
131
 
               struct parsedb_state *ps,
132
 
               const char *value, const struct fieldinfo *fip) {
 
139
void
 
140
f_boolean(struct pkginfo *pigp, struct pkgbin *pifp,
 
141
          struct parsedb_state *ps,
 
142
          const char *value, const struct fieldinfo *fip)
 
143
{
133
144
  bool boolean;
134
145
 
135
146
  if (!*value)
136
147
    return;
137
148
 
138
 
  boolean = convert_string(ps, _("yes/no in boolean field"),
139
 
                           -1, pigp, value, booleaninfos, NULL);
 
149
  boolean = parse_nv_last(ps, pigp, _("yes/no in boolean field"),
 
150
                          booleaninfos, value);
140
151
  PKGPFIELD(pifp, fip->integer, bool) = boolean;
141
152
}
142
153
 
143
 
void f_section(struct pkginfo *pigp, struct pkginfoperfile *pifp,
144
 
               struct parsedb_state *ps,
145
 
               const char *value, const struct fieldinfo *fip) {
 
154
void
 
155
f_section(struct pkginfo *pigp, struct pkgbin *pifp,
 
156
          struct parsedb_state *ps,
 
157
          const char *value, const struct fieldinfo *fip)
 
158
{
146
159
  if (!*value) return;
147
160
  pigp->section= nfstrsave(value);
148
161
}
149
162
 
150
 
void f_priority(struct pkginfo *pigp, struct pkginfoperfile *pifp,
151
 
                struct parsedb_state *ps,
152
 
                const char *value, const struct fieldinfo *fip) {
 
163
void
 
164
f_priority(struct pkginfo *pigp, struct pkgbin *pifp,
 
165
           struct parsedb_state *ps,
 
166
           const char *value, const struct fieldinfo *fip)
 
167
{
153
168
  if (!*value) return;
154
 
  pigp->priority = convert_string(ps, _("word in `priority' field"),
155
 
                                  pri_other, pigp, value, priorityinfos, NULL);
 
169
  pigp->priority = parse_nv_last(ps, pigp, _("word in `priority' field"),
 
170
                                 priorityinfos, value);
156
171
  if (pigp->priority == pri_other) pigp->otherpriority= nfstrsave(value);
157
172
}
158
173
 
159
 
void f_status(struct pkginfo *pigp, struct pkginfoperfile *pifp,
160
 
              struct parsedb_state *ps,
161
 
              const char *value, const struct fieldinfo *fip) {
162
 
  const char *ep;
163
 
 
 
174
void
 
175
f_status(struct pkginfo *pigp, struct pkgbin *pifp,
 
176
         struct parsedb_state *ps,
 
177
         const char *value, const struct fieldinfo *fip)
 
178
{
164
179
  if (ps->flags & pdb_rejectstatus)
165
180
    parse_error(ps, pigp,
166
181
                _("value for `status' field not allowed in this context"));
167
182
  if (ps->flags & pdb_recordavailable)
168
183
    return;
169
 
  
170
 
  pigp->want = convert_string(ps, _("first (want) word in `status' field"),
171
 
                              -1, pigp, value, wantinfos, &ep);
172
 
  pigp->eflag = convert_string(ps, _("second (error) word in `status' field"),
173
 
                               -1, pigp, ep, eflaginfos, &ep);
174
 
  pigp->status = convert_string(ps, _("third (status) word in `status' field"),
175
 
                                -1, pigp, ep, statusinfos, NULL);
 
184
 
 
185
  pigp->want = parse_nv_next(ps, pigp,
 
186
                             _("first (want) word in `status' field"),
 
187
                             wantinfos, &value);
 
188
  pigp->eflag = parse_nv_next(ps, pigp,
 
189
                              _("second (error) word in `status' field"),
 
190
                              eflaginfos, &value);
 
191
  pigp->status = parse_nv_last(ps, pigp,
 
192
                               _("third (status) word in `status' field"),
 
193
                               statusinfos, value);
176
194
}
177
195
 
178
 
void f_version(struct pkginfo *pigp, struct pkginfoperfile *pifp,
179
 
               struct parsedb_state *ps,
180
 
               const char *value, const struct fieldinfo *fip) {
 
196
void
 
197
f_version(struct pkginfo *pigp, struct pkgbin *pifp,
 
198
          struct parsedb_state *ps,
 
199
          const char *value, const struct fieldinfo *fip)
 
200
{
181
201
  parse_db_version(ps, pigp, &pifp->version, value,
182
202
                   _("error in Version string '%.250s'"), value);
183
 
}  
 
203
}
184
204
 
185
 
void f_revision(struct pkginfo *pigp, struct pkginfoperfile *pifp,
186
 
                struct parsedb_state *ps,
187
 
                const char *value, const struct fieldinfo *fip) {
 
205
void
 
206
f_revision(struct pkginfo *pigp, struct pkgbin *pifp,
 
207
           struct parsedb_state *ps,
 
208
           const char *value, const struct fieldinfo *fip)
 
209
{
188
210
  char *newversion;
189
211
 
190
212
  parse_warn(ps, pigp,
196
218
    pifp->version.version= newversion;
197
219
  }
198
220
  pifp->version.revision= nfstrsave(value);
199
 
}  
 
221
}
200
222
 
201
 
void f_configversion(struct pkginfo *pigp, struct pkginfoperfile *pifp,
202
 
                     struct parsedb_state *ps,
203
 
                     const char *value, const struct fieldinfo *fip) {
 
223
void
 
224
f_configversion(struct pkginfo *pigp, struct pkgbin *pifp,
 
225
                struct parsedb_state *ps,
 
226
                const char *value, const struct fieldinfo *fip)
 
227
{
204
228
  if (ps->flags & pdb_rejectstatus)
205
229
    parse_error(ps, pigp,
206
230
                _("value for `config-version' field not allowed in this context"));
212
236
 
213
237
}
214
238
 
 
239
/*
 
240
 * The code in f_conffiles ensures that value[-1] == ' ', which is helpful.
 
241
 */
215
242
static void conffvalue_lastword(const char *value, const char *from,
216
243
                                const char *endent,
217
244
                                const char **word_start_r, int *word_len_r,
219
246
                                struct parsedb_state *ps,
220
247
                                struct pkginfo *pigp)
221
248
{
222
 
  /* the code in f_conffiles ensures that value[-1]==' ', which is helpful */
223
249
  const char *lastspc;
224
 
  
 
250
 
225
251
  if (from <= value+1) goto malformed;
226
252
  for (lastspc= from-1; *lastspc != ' '; lastspc--);
227
253
  if (lastspc <= value+1 || lastspc >= endent-1) goto malformed;
237
263
              (int)min(endent - value, 250), value);
238
264
}
239
265
 
240
 
void f_conffiles(struct pkginfo *pigp, struct pkginfoperfile *pifp,
241
 
                 struct parsedb_state *ps,
242
 
                 const char *value, const struct fieldinfo *fip) {
 
266
void
 
267
f_conffiles(struct pkginfo *pigp, struct pkgbin *pifp,
 
268
            struct parsedb_state *ps,
 
269
            const char *value, const struct fieldinfo *fip)
 
270
{
243
271
  static const char obsolete_str[]= "obsolete";
244
272
  struct conffile **lastp, *newlink;
245
273
  const char *endent, *endfn, *hashstart;
246
274
  int c, namelen, hashlen, obsolete;
247
275
  char *newptr;
248
 
  
 
276
 
249
277
  lastp= &pifp->conffiles;
250
278
  while (*value) {
251
279
    c= *value++;
287
315
  }
288
316
}
289
317
 
290
 
void f_dependency(struct pkginfo *pigp, struct pkginfoperfile *pifp,
291
 
                  struct parsedb_state *ps,
292
 
                  const char *value, const struct fieldinfo *fip) {
 
318
void
 
319
f_dependency(struct pkginfo *pigp, struct pkgbin *pifp,
 
320
             struct parsedb_state *ps,
 
321
             const char *value, const struct fieldinfo *fip)
 
322
{
293
323
  char c1, c2;
294
324
  const char *p, *emsg;
295
325
  const char *depnamestart, *versionstart;
299
329
  struct dependency *dyp, **ldypp;
300
330
  struct deppossi *dop, **ldopp;
301
331
 
302
 
  if (!*value) return; /* empty fields are ignored */
 
332
  /* Empty fields are ignored. */
 
333
  if (!*value)
 
334
    return;
303
335
  p= value;
304
336
  ldypp= &pifp->depends; while (*ldypp) ldypp= &(*ldypp)->next;
305
 
  for (;;) { /* loop creating new struct dependency's */
 
337
 
 
338
   /* Loop creating new struct dependency's. */
 
339
  for (;;) {
306
340
    dyp= nfmalloc(sizeof(struct dependency));
307
 
    dyp->up= NULL; /* Set this to zero for now, as we don't know what our real
308
 
                 * struct pkginfo address (in the database) is going to be yet.
309
 
                 */
 
341
    /* Set this to NULL for now, as we don't know what our real
 
342
     * struct pkginfo address (in the database) is going to be yet. */
 
343
    dyp->up = NULL;
310
344
    dyp->next= NULL; *ldypp= dyp; ldypp= &dyp->next;
311
345
    dyp->list= NULL; ldopp= &dyp->list;
312
346
    dyp->type= fip->integer;
313
 
    for (;;) { /* loop creating new struct deppossi's */
 
347
 
 
348
    /* Loop creating new struct deppossi's. */
 
349
    for (;;) {
314
350
      depnamestart= p;
315
 
/* skip over package name characters */
 
351
      /* Skip over package name characters. */
316
352
      while (*p && !isspace(*p) && *p != '(' && *p != ',' && *p != '|') {
317
353
        p++;
318
354
      }
319
355
      depnamelength= p - depnamestart ;
320
 
      varbufreset(&depname);
321
 
      varbufaddbuf(&depname, depnamestart, depnamelength);
322
 
      varbufaddc(&depname, '\0');
 
356
      varbuf_reset(&depname);
 
357
      varbuf_add_buf(&depname, depnamestart, depnamelength);
 
358
      varbuf_end_str(&depname);
323
359
      if (!depname.buf[0])
324
360
        parse_error(ps, pigp,
325
361
                    _("`%s' field, missing package name, or garbage where "
326
362
                      "package name expected"), fip->name);
327
 
      emsg = illegal_packagename(depname.buf, NULL);
 
363
      emsg = pkg_name_is_illegal(depname.buf, NULL);
328
364
      if (emsg)
329
365
        parse_error(ps, pigp,
330
366
                    _("`%s' field, invalid package name `%.255s': %s"),
331
367
                    fip->name, depname.buf, emsg);
332
368
      dop= nfmalloc(sizeof(struct deppossi));
333
369
      dop->up= dyp;
334
 
      dop->ed = findpackage(depname.buf);
 
370
      dop->ed = pkg_db_find(depname.buf);
335
371
      dop->next= NULL; *ldopp= dop; ldopp= &dop->next;
336
372
 
337
373
      /* Don't link this (which is after all only ‘newpig’ from
344
380
      dop->rev_prev = NULL;
345
381
 
346
382
      dop->cyclebreak = false;
347
 
/* skip whitespace after packagename */
 
383
 
 
384
      /* Skip whitespace after package name. */
348
385
      while (isspace(*p)) p++;
349
 
      if (*p == '(') {                  /* if we have a versioned relation */
 
386
 
 
387
      /* See if we have a versioned relation. */
 
388
      if (*p == '(') {
350
389
        p++; while (isspace(*p)) p++;
351
390
        c1= *p;
352
391
        if (c1 == '<' || c1 == '>') {
393
432
                       "suggest adding a space"),
394
433
                     fip->name, depname.buf);
395
434
        }
396
 
/* skip spaces between the relation and the version */
 
435
        /* Skip spaces between the relation and the version. */
397
436
        while (isspace(*p)) p++;
398
437
 
399
438
        versionstart= p;
415
454
          parse_error(ps, pigp,
416
455
                      _("`%s' field, reference to `%.255s': "
417
456
                        "version unterminated"), fip->name, depname.buf);
418
 
        varbufreset(&version);
419
 
        varbufaddbuf(&version, versionstart, versionlength);
420
 
        varbufaddc(&version, '\0');
 
457
        varbuf_reset(&version);
 
458
        varbuf_add_buf(&version, versionstart, versionlength);
 
459
        varbuf_end_str(&version);
421
460
        parse_db_version(ps, pigp, &dop->version, version.buf,
422
461
                         _("'%s' field, reference to '%.255s': "
423
462
                           "error in version"), fip->name, depname.buf);
472
511
    break;
473
512
  }
474
513
 
475
 
  varbufreset(&word);
476
 
  varbufaddbuf(&word, start, end - start);
477
 
  varbufaddc(&word, '\0');
 
514
  varbuf_reset(&word);
 
515
  varbuf_add_buf(&word, start, end - start);
 
516
  varbuf_end_str(&word);
478
517
 
479
518
  *valp = p;
480
519
 
482
521
}
483
522
 
484
523
void
485
 
f_trigpend(struct pkginfo *pend, struct pkginfoperfile *pifp,
 
524
f_trigpend(struct pkginfo *pend, struct pkgbin *pifp,
486
525
           struct parsedb_state *ps,
487
526
           const char *value, const struct fieldinfo *fip)
488
527
{
494
533
                  "this context"));
495
534
 
496
535
  while ((word = scan_word(&value))) {
497
 
    emsg = illegal_triggername(word);
 
536
    emsg = trig_name_is_illegal(word);
498
537
    if (emsg)
499
538
      parse_error(ps, pend,
500
539
                  _("illegal pending trigger name `%.255s': %s"), word, emsg);
506
545
}
507
546
 
508
547
void
509
 
f_trigaw(struct pkginfo *aw, struct pkginfoperfile *pifp,
 
548
f_trigaw(struct pkginfo *aw, struct pkgbin *pifp,
510
549
         struct parsedb_state *ps,
511
550
         const char *value, const struct fieldinfo *fip)
512
551
{
519
558
                  "this context"));
520
559
 
521
560
  while ((word = scan_word(&value))) {
522
 
    emsg = illegal_packagename(word, NULL);
 
561
    emsg = pkg_name_is_illegal(word, NULL);
523
562
    if (emsg)
524
563
      parse_error(ps, aw,
525
564
                  _("illegal package name in awaited trigger `%.255s': %s"),
526
565
                  word, emsg);
527
 
    pend = findpackage(word);
 
566
    pend = pkg_db_find(word);
528
567
 
529
568
    if (!trig_note_aw(pend, aw))
530
569
      parse_error(ps, aw,
533
572
    trig_enqueue_awaited_pend(pend);
534
573
  }
535
574
}
536