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

« back to all changes in this revision

Viewing changes to lib/dpkg/varbuf.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:
3
3
 * varbuf.h - variable length expandable buffer handling
4
4
 *
5
5
 * Copyright © 1994, 1995 Ian Jackson <ian@chiark.greenend.org.uk>
6
 
 * Copyright © 2008, 2009 Guillem Jover <guillem@debian.org>
 
6
 * Copyright © 2008-2011 Guillem Jover <guillem@debian.org>
7
7
 *
8
8
 * This is free software; you can redistribute it and/or modify
9
9
 * it under the terms of the GNU General Public License as published by
30
30
DPKG_BEGIN_DECLS
31
31
 
32
32
/*
33
 
 * varbufinit must be called exactly once before the use of each varbuf
 
33
 * varbuf_init must be called exactly once before the use of each varbuf
34
34
 * (including before any call to varbuf_destroy), or the variable must be
35
35
 * initialized with VARBUF_INIT.
36
36
 *
37
 
 * However, varbufs allocated ‘static’ are properly initialised anyway and
38
 
 * do not need varbufinit; multiple consecutive calls to varbufinit before
 
37
 * However, varbufs allocated ‘static’ are properly initialized anyway and
 
38
 * do not need varbuf_init; multiple consecutive calls to varbuf_init before
39
39
 * any use are allowed.
40
40
 *
41
41
 * varbuf_destroy must be called after a varbuf is finished with, if anything
42
 
 * other than varbufinit has been done. After this you are allowed but
43
 
 * not required to call varbufinit again if you want to start using the
 
42
 * other than varbuf_init has been done. After this you are allowed but
 
43
 * not required to call varbuf_init again if you want to start using the
44
44
 * varbuf again.
45
45
 *
46
46
 * Callers using C++ need not worry about any of this.
64
64
 
65
65
#define VARBUF_INIT { 0, 0, NULL }
66
66
 
67
 
void varbufinit(struct varbuf *v, size_t size);
 
67
void varbuf_init(struct varbuf *v, size_t size);
68
68
void varbuf_grow(struct varbuf *v, size_t need_size);
69
69
void varbuf_trunc(struct varbuf *v, size_t used_size);
70
70
char *varbuf_detach(struct varbuf *v);
71
 
void varbufreset(struct varbuf *v);
 
71
void varbuf_reset(struct varbuf *v);
72
72
void varbuf_destroy(struct varbuf *v);
73
73
 
74
 
void varbufaddc(struct varbuf *v, int c);
75
 
void varbufdupc(struct varbuf *v, int c, size_t n);
76
 
void varbufsubstc(struct varbuf *v, int c_src, int c_dst);
77
 
#define varbufaddstr(v, s) varbufaddbuf(v, s, strlen(s))
78
 
void varbufaddbuf(struct varbuf *v, const void *s, size_t size);
 
74
void varbuf_add_char(struct varbuf *v, int c);
 
75
void varbuf_dup_char(struct varbuf *v, int c, size_t n);
 
76
void varbuf_map_char(struct varbuf *v, int c_src, int c_dst);
 
77
#define varbuf_add_str(v, s) varbuf_add_buf(v, s, strlen(s))
 
78
void varbuf_add_buf(struct varbuf *v, const void *s, size_t size);
 
79
void varbuf_end_str(struct varbuf *v);
79
80
 
80
 
int varbufprintf(struct varbuf *v, const char *fmt, ...) DPKG_ATTR_PRINTF(2);
81
 
int varbufvprintf(struct varbuf *v, const char *fmt, va_list va)
 
81
int varbuf_printf(struct varbuf *v, const char *fmt, ...) DPKG_ATTR_PRINTF(2);
 
82
int varbuf_vprintf(struct varbuf *v, const char *fmt, va_list va)
82
83
        DPKG_ATTR_VPRINTF(2);
83
84
 
84
85
DPKG_END_DECLS
87
88
inline
88
89
varbuf::varbuf(size_t _size)
89
90
{
90
 
        varbufinit(this, _size);
 
91
        varbuf_init(this, _size);
91
92
}
92
93
 
93
94
inline
99
100
inline void
100
101
varbuf::init(size_t _size)
101
102
{
102
 
        varbufinit(this, _size);
 
103
        varbuf_init(this, _size);
103
104
}
104
105
 
105
106
inline void
117
118
inline void
118
119
varbuf::operator()(int c)
119
120
{
120
 
        varbufaddc(this, c);
 
121
        varbuf_add_char(this, c);
121
122
}
122
123
 
123
124
inline void
124
125
varbuf::operator()(const char *s)
125
126
{
126
 
        varbufaddstr(this, s);
 
127
        varbuf_add_str(this, s);
127
128
}
128
129
 
129
130
inline void
130
131
varbuf::terminate(void/*to shut 2.6.3 up*/)
131
132
{
132
 
        varbufaddc(this, 0);
133
 
        used--;
 
133
        varbuf_end_str(this);
134
134
}
135
135
 
136
136
inline const char *