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

« back to all changes in this revision

Viewing changes to lib/dpkg/dpkg-db.h

  • 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:
36
36
  unsigned long epoch;
37
37
  const char *version;
38
38
  const char *revision;
39
 
};  
 
39
};
40
40
 
41
41
enum deptype {
42
42
  dep_suggests,
101
101
  const char *md5sum;
102
102
};
103
103
 
104
 
struct pkginfoperfile { /* pif */
 
104
/**
 
105
 * Node describing a binary package file.
 
106
 *
 
107
 * This structure holds information contained on each binary package.
 
108
 *
 
109
 * Note: Usually referred in the code as ‘pif’ for historical reasons.
 
110
 */
 
111
struct pkgbin {
105
112
  struct dependency *depends;
106
113
  struct deppossi *depended;
107
 
  bool essential; /* The ‘essential’ flag, true = yes, false = no (absent). */
 
114
  /* The ‘essential’ flag, true = yes, false = no (absent). */
 
115
  bool essential;
108
116
  const char *description;
109
117
  const char *maintainer;
110
118
  const char *source;
111
 
  const char *architecture;
 
119
  const char *arch;
112
120
  const char *installedsize;
113
121
  const char *origin;
114
122
  const char *bugs;
117
125
  struct arbitraryfield *arbs;
118
126
};
119
127
 
 
128
/**
 
129
 * Node indicates that parent's Triggers-Pending mentions name.
 
130
 *
 
131
 * Note: These nodes do double duty: after they're removed from a package's
 
132
 * trigpend list, references may be preserved by the trigger cycle checker
 
133
 * (see trigproc.c).
 
134
 */
120
135
struct trigpend {
121
 
  /* Node indicates that parent's Triggers-Pending mentions name. */
122
 
  /* NB that these nodes do double duty: after they're removed from
123
 
   * a package's trigpend list, references may be preserved by the
124
 
   * trigger cycle checker (see trigproc.c).
125
 
   */
126
136
  struct trigpend *next;
127
137
  const char *name;
128
138
};
129
139
 
 
140
/**
 
141
 * Node indicates that aw's Triggers-Awaited mentions pend.
 
142
 */
130
143
struct trigaw {
131
 
  /* Node indicates that aw's Triggers-Awaited mentions pend. */
132
144
  struct pkginfo *aw, *pend;
133
145
  struct trigaw *samepend_next;
134
146
  struct {
136
148
  } sameaw;
137
149
};
138
150
 
139
 
struct perpackagestate; /* dselect and dpkg have different versions of this */
 
151
/* Note: dselect and dpkg have different versions of this. */
 
152
struct perpackagestate;
140
153
 
141
 
struct pkginfo { /* pig */
 
154
/**
 
155
 * Node describing an architecture package instance.
 
156
 *
 
157
 * This structure holds state information.
 
158
 *
 
159
 * Note: Usually referred in the code as pig.
 
160
 */
 
161
struct pkginfo {
142
162
  struct pkginfo *next;
143
163
  const char *name;
144
164
  enum pkgwant {
145
165
    want_unknown, want_install, want_hold, want_deinstall, want_purge,
146
 
    want_sentinel /* Not allowed except as special sentinel value
147
 
                     in some places */
 
166
    /* Not allowed except as special sentinel value in some places. */
 
167
    want_sentinel,
148
168
  } want;
 
169
  /* The error flag bitmask. */
149
170
  enum pkgeflag {
150
171
    eflag_ok            = 0,
151
172
    eflag_reinstreq     = 1,
152
 
  } eflag; /* Bitmask. */
 
173
  } eflag;
153
174
  enum pkgstatus {
154
175
    stat_notinstalled,
155
176
    stat_configfiles,
172
193
  const char *section;
173
194
  struct versionrevision configversion;
174
195
  struct filedetails *files;
175
 
  struct pkginfoperfile installed;
176
 
  struct pkginfoperfile available;
 
196
  struct pkgbin installed;
 
197
  struct pkgbin available;
177
198
  struct perpackagestate *clientdata;
178
199
 
179
200
  struct {
186
207
  struct trigpend *trigpend_head;
187
208
};
188
209
 
 
210
/*** from dbdir.c ***/
 
211
 
 
212
const char *dpkg_db_set_dir(const char *dir);
 
213
const char *dpkg_db_get_dir(void);
 
214
char *dpkg_db_get_path(const char *pathpart);
 
215
 
189
216
/*** from dbmodify.c ***/
190
217
 
191
218
enum modstatdb_rw {
193
220
  msdbrw_readonly/*s*/, msdbrw_needsuperuserlockonly/*s*/,
194
221
  msdbrw_writeifposs,
195
222
  msdbrw_write/*s*/, msdbrw_needsuperuser,
 
223
 
196
224
  /* Now some optional flags: */
197
 
  msdbrw_flagsmask= ~077,
198
 
  /* flags start at 0100 */
199
 
  msdbrw_noavail= 0100,
 
225
  msdbrw_available_mask= ~077,
 
226
  /* Flags start at 0100. */
 
227
  msdbrw_available_readonly = 0100,
 
228
  msdbrw_available_write = 0200,
200
229
};
201
230
 
202
 
bool modstatdb_is_locked(const char *admindir);
203
 
void modstatdb_lock(const char *admindir);
 
231
void modstatdb_init(void);
 
232
void modstatdb_done(void);
 
233
bool modstatdb_is_locked(void);
 
234
bool modstatdb_can_lock(void);
 
235
void modstatdb_lock(void);
204
236
void modstatdb_unlock(void);
205
 
enum modstatdb_rw modstatdb_init(const char *admindir, enum modstatdb_rw reqrwflags);
 
237
enum modstatdb_rw modstatdb_open(enum modstatdb_rw reqrwflags);
206
238
void modstatdb_note(struct pkginfo *pkg);
207
239
void modstatdb_note_ifwrite(struct pkginfo *pkg);
208
240
void modstatdb_checkpoint(void);
209
241
void modstatdb_shutdown(void);
210
242
 
211
 
const char *pkgadmindir(void);
212
 
const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile);
213
 
 
214
243
/*** from database.c ***/
215
244
 
216
 
struct pkginfo *findpackage(const char *name);
217
 
void blankpackage(struct pkginfo *pp);
218
 
void blankpackageperfile(struct pkginfoperfile *pifp);
 
245
void pkg_blank(struct pkginfo *pp);
 
246
void pkgbin_blank(struct pkgbin *pifp);
219
247
void blankversion(struct versionrevision*);
220
 
bool informative(struct pkginfo *pkg, struct pkginfoperfile *info);
221
 
int countpackages(void);
222
 
void resetpackages(void);
223
 
 
224
 
struct pkgiterator *iterpkgstart(void);
225
 
struct pkginfo *iterpkgnext(struct pkgiterator*);
226
 
void iterpkgend(struct pkgiterator*);
227
 
 
228
 
void hashreport(FILE*);
 
248
bool pkg_is_informative(struct pkginfo *pkg, struct pkgbin *info);
 
249
 
 
250
struct pkginfo *pkg_db_find(const char *name);
 
251
int pkg_db_count(void);
 
252
void pkg_db_reset(void);
 
253
 
 
254
struct pkgiterator *pkg_db_iter_new(void);
 
255
struct pkginfo *pkg_db_iter_next(struct pkgiterator *iter);
 
256
void pkg_db_iter_free(struct pkgiterator *iter);
 
257
 
 
258
void pkg_db_report(FILE *);
229
259
 
230
260
/*** from parse.c ***/
231
261
 
232
262
enum parsedbflags {
233
 
  pdb_recordavailable   =001, /* Store in `available' in-core structures, not `status' */
234
 
  pdb_rejectstatus      =002, /* Throw up an error if `Status' encountered             */
235
 
  pdb_weakclassification=004, /* Ignore priority/section info if we already have any   */
236
 
  pdb_ignorefiles       =010, /* Ignore files info if we already have them             */
 
263
  /* Store in ‘available’ in-core structures, not ‘status’. */
 
264
  pdb_recordavailable = 001,
 
265
  /* Throw up an error if ‘Status’ encountered. */
 
266
  pdb_rejectstatus = 002,
 
267
  /* Ignore priority/section info if we already have any. */
 
268
  pdb_weakclassification = 004,
 
269
  /* Ignore files info if we already have them. */
 
270
  pdb_ignorefiles = 010,
237
271
  /* Ignore packages with older versions already read. */
238
 
  pdb_ignoreolder       =020,
 
272
  pdb_ignoreolder = 020,
239
273
  /* Perform laxer parsing, used to transition to stricter parsing. */
240
 
  pdb_lax_parser        =040,
 
274
  pdb_lax_parser = 040,
241
275
};
242
276
 
243
 
const char *illegal_packagename(const char *p, const char **ep);
244
 
int parsedb(const char *filename, enum parsedbflags, struct pkginfo **donep,
245
 
            FILE *warnto, int *warncount);
 
277
const char *pkg_name_is_illegal(const char *p, const char **ep);
 
278
int parsedb(const char *filename, enum parsedbflags, struct pkginfo **donep);
246
279
void copy_dependency_links(struct pkginfo *pkg,
247
280
                           struct dependency **updateme,
248
281
                           struct dependency *newdepends,
250
283
 
251
284
/*** from parsehelp.c ***/
252
285
 
253
 
struct namevalue {
254
 
  const char *name;
255
 
  int value, length;
256
 
};
 
286
#include <dpkg/namevalue.h>
257
287
 
258
288
extern const struct namevalue booleaninfos[];
259
289
extern const struct namevalue priorityinfos[];
273
303
/*** from dump.c ***/
274
304
 
275
305
void writerecord(FILE*, const char*,
276
 
                 const struct pkginfo*, const struct pkginfoperfile*);
 
306
                 const struct pkginfo *, const struct pkgbin *);
277
307
 
278
308
void writedb(const char *filename, bool available, bool mustsync);
279
309
 
280
 
void varbufrecord(struct varbuf*, const struct pkginfo*, const struct pkginfoperfile*);
 
310
/* Note: The varbufs must have been initialized and will not be
 
311
 * NUL-terminated. */
 
312
void varbufrecord(struct varbuf *, const struct pkginfo *,
 
313
                  const struct pkgbin *);
281
314
void varbufdependency(struct varbuf *vb, struct dependency *dep);
282
 
  /* NB THE VARBUF MUST HAVE BEEN INITIALISED AND WILL NOT BE NULL-TERMINATED */
283
315
 
284
316
/*** from vercmp.c ***/
285
317
 
286
 
bool versionsatisfied(struct pkginfoperfile *it, struct deppossi *against);
 
318
bool versionsatisfied(struct pkgbin *it, struct deppossi *against);
287
319
bool versionsatisfied3(const struct versionrevision *it,
288
320
                       const struct versionrevision *ref,
289
321
                       enum depverrel verrel);