summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Control
AgeCommit message (Collapse)AuthorFilesLines
2013-04-29scripts: Use // operator instead of an explicit defined checkGuillem Jover1-1/+1
2013-04-29scripts: Do not use sort directly on the return keywordGuillem Jover1-2/+4
Fixes Subroutines::ProhibitReturnSort. Warned-by: perlcritic
2013-04-27Dpkg::Control::Type: Use strict and warningsGuillem Jover1-0/+3
Fixes TestingAndDebugging::RequireUseStrict and TestingAndDebugging::RequireUseWarnings. Warned-by: perlcritic
2013-04-19Use just 'return' instead of 'return undef' in perl codeGuillem Jover3-9/+9
This makes sure the functions always return the appropriate value independent of the context. Fixes Subroutines::ProhibitExplicitReturnUndef. Warned-by: perlcritic
2013-03-18Dpkg::Control::Hash: Do not accept Armor Header Lines inside a paragraphGuillem Jover1-1/+3
Make sure that no fields are injected before a signed block. Although the only possible attack is to add fields not present in the signed block, as otherwise a syntax error due to duplicate field is triggered.
2013-03-18Dpkg::Control::Hash: Check for presence of OpenPGP signaturesGuillem Jover1-0/+10
Make sure the OpenGPG armor contains a signature block, even on EOF. This should get detected and rejected by gpgv anyway, but it's better to check the structure of the message before doing any further parsing on it.
2013-03-18Dpkg: Fix OpenPGP armored signature parsingGuillem Jover1-6/+7
Change parsing code to honour RFC4880. Handle whitespaces at EOL, and correctly expect five trailing dashes on the Armor Header Lines. Closes: #695919 Reported-by: Ansgar Burchardt <ansgar@debian.org>
2012-06-30Add support for binary-only key-value option in changelogsGuillem Jover1-4/+8
This allows to mark changelog entries as being for a binary-only upload, which implies there cannot be any source produced, and the binary version is going to be different to the source version. As such the version substvars will get different values, w/o needing to hardcode a specific syntax. Although we fallback to the old syntax just in case, for example to handle possible multiple consecutive binary-only entries w/o needing to complicate the code too much. Closes: #440094, #672723
2012-06-30Dpkg::Control::Fields: Remove obsolete changelog fieldsGuillem Jover1-2/+1
These were made not visible as fields in commit 825656afe3e9856dc846c225df8af73d2376fa3e.
2012-06-06Dpkg::Control::Fields: Put an & before field_capitalize() callsGuillem Jover1-2/+2
The definition of the function appears later on, and perl 5.16 gives warnings about usage before declaration. Closes: #676262
2012-05-23Add Build-Depends-Arch and Build-Conflicts-ArchRoger Leigh1-3/+13
dpkg currently supports Build-Depends (arch all and any) Build-Depends-Indep (arch all) and the same Build-Conflicts. This patch adds Build-Depends-Arch (arch any) and Build-Conflicts-Arch. This makes the support for build dependencies for arch all and any packages symmetrical and more logical. It also permits arch-any dependencies to be omitted for arch-all-only builds. This change will not break any existing packages: if the arch any deps are in Build-Depends, they may be installed unnecessarily, but they will still be installed. This change just allows an additional optimisation, and tidies up a slight omission in the original implementation of build dependencies, and would give the buildds additional options when arch-all autobuilding is enabled (especially now it's available as a separate independent arch). Closes: #629480 Signed-off-by: Roger Leigh <rleigh@debian.org> Signed-off-by: Guillem Jover <guillem@debian.org>
2012-05-23scripts: Use new member set_as_used() instead of ad-hoc codeGuillem Jover1-2/+1
Use the new member instead of setting and then marking the substvars.
2012-04-27Dpkg::Control: Fix memory leak due to objects not being garbage-collectedBen Harris1-8/+19
When runnung a Perl script that repeatedly creates unreferenced Dpkg::Control objects, the perl process consumes memory without limit. A one-line sample: perl -MDpkg::Control -e 'Dpkg::Control->new while 1' It would be expected from a script like this to have a constant memory usage, as the Dpkg::Control objects are garbage-collected soon after being created. What happens instead, is that after running for thirty seconds, perl has consumed over 100 MiB of memory. By contrast, the same test using Dpkg::Index consumes a constant 6 MiB. This problem effectively means that a process can't operate on a large number of Dpkg::Control objects sequentially. The cause of the problem appears to be a circular reference between a Dpkg::Control::Hash and its contained tied hash. This patch explicitly breaks this loop when a Dpkg::Control::Hash is destroyed, following the advice in perlobj(1). Closes: #669012 Signed-off-by: Guillem Jover <guillem@debian.org>
2012-04-24Fix typo: "same syntax than" → "same syntax as".Peter Krefting1-1/+1
2012-03-05Store Multi-Arch field after Architecture field in status fileGuillem Jover1-1/+1
2011-08-01Revert "dpkg-buildpackage: support for Build-Features: build-arch"Raphaël Hertzog1-3/+0
This reverts commit 14d48ef9abc2ce2d394e9ae4d69d4ba68b551620. Given that Guillem does not want this field and that the technical committee has not yet decided on the proper approach to enable build-arch/build-indep, it's safer to revert this change for now and allow us to proceed with a release. Conflicts: man/deb-src-control.5
2011-07-07Refer to Sources and Packages files as part of a repositoryGuillem Jover1-2/+2
Instead of as being of exclusive use or owned by APT, which has never been the case. Those files existed long before APT even existed.
2011-06-25dpkg-source: add some supplementary checks of debian/controlRaphaël Hertzog1-1/+5
We're now ensuring that debian/control contains a source entry and at least one entry for a binary package. And we also ensure that the Architecture field is present. This a new restriction but it's really in-line with the change made in dpkg where we complain of the lack of this field. Reported-by: Niels Thykier <niels@thykier.net>
2011-06-06dpkg-buildpackage: support for Build-Features: build-archBill Allombert1-0/+3
With this flag set in debian/control, dpkg-buildpackage will use "debian/rules build-arch" or "debian/rules build-indep" when appropriate. Improved-by: Raphaël Hertzog <hertzog@debian.org> Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2011-03-24dpkg-source: add new Package-List field to .dsc filesRaphaël Hertzog1-1/+5
This field has been requested by ftpmasters so that they can install overrides for all binary packages as soon as they have approved the source package. It contains a the list of packages that the source can build along with their sections and priorities. It looks like this: Package-List: src:foo admin optional foo admin optional foo-common admin optional udeb:foo-udeb debian-installer extra
2011-03-24Dpkg::Control::Fields: define the place of the Built-Using fieldRaphaël Hertzog1-2/+2
Commit a8cb927edb7dbd67c7a6084685998818b811caec forgot to add the Built-Using field in %FIELD_ORDER.
2011-03-23dpkg-gencontrol: add support for Built-Using fieldMark Hymers1-0/+5
And teach dpkg-deb to not complain about it. Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2011-03-12Dpkg::Control::Hash: accept PGP signature as end of blockRoger Leigh1-1/+1
Improved-by: Raphaël Hertzog <hertzog@debian.org>
2010-04-11Fix POD in several perl modules to avoid two consecutive lines starting with ↵Raphaël Hertzog1-0/+1
=item An empty line is required between the two or pod2man decides that the second is the continuation of the former and includes "=item" in the generated manual page.
2010-02-26Update POD documentation to indicate that it's using UTF-8 encodingRaphaël Hertzog5-2/+12
Also fix many spelling errors spotted by lintian.
2010-02-25Dpkg::Checksums: rewrite to provide an object-oriented APIRaphaël Hertzog2-6/+6
Many other modules and scripts are also updated to cope with the new API. The API of the module should be stable from now on, hence increased $VERSION to "1.00".
2010-02-25Add accent on Raphaël's name in several filesGuillem Jover2-2/+2
2010-02-21dpkg-gencontrol: now indicates which package is concerned by the substvars ↵Raphaël Hertzog1-2/+2
warnings Enhance Dpkg::Substvarst to be able to display a prefix before its warnings and errors and make use of that facility in dpkg-gencontrol to be explicit about where the substitution is done.
2010-02-21Add $VERSION numbers to all perl modulesRaphaël Hertzog4-0/+8
Modules whose API should be stable have a version 1.00. The modules with version 0.01 are expected to have further API changes in the (near) future or are deemed to be useful mostly for dpkg-dev's internal usage.
2010-02-21Dpkg::Interface::Storable: load() and save() accept "-" for standard ↵Raphaël Hertzog1-6/+3
input/output Simplify code in Dpkg::Control::Info thanks to this.
2010-02-21Dpkg::Control::Info: provide an array representation of the objectRaphaël Hertzog1-1/+15
Add non-regression test for this interface.
2010-02-20Update Dpkg::Control::* to use Dpkg::Interface::StorableRaphaël Hertzog2-39/+31
This implies renaming parse_fh() into parse() and parse() into load(). Update all scripts and modules using those methods.
2009-11-29Merge sid branch through commit '1.15.5.3'Raphaël Hertzog1-1/+4
Conflicts: man/po/de.po man/po/sv.po scripts/dpkg-scanpackages.pl scripts/po/de.po scripts/po/sv.po
2009-11-23Dpkg::Control::Hash: document how leading/trailing spaces are treatedRaphaël Hertzog1-0/+3
2009-11-22Dpkg::Control::Hash: Strip leading spaces in the first line of a field's valueGuillem Jover1-1/+1
The fields in a compliant control-style file are allowed to have values starting with any number of spaces. But that only applies to the first line on multi-line field values, so do not do the same on subsequent lines as those are handled differently. Regression introduced in commit 7d8d193332478de82e20ed5b49053378801d160f. Closes: #557547
2009-11-21Use angle brackets to mark i/o from descriptorsGuillem Jover1-1/+1
In this case use “<standard output>” and “<standard input>”, to make it clear that it's not a file with such name, in the same way we do in the reset of the code base.
2009-11-18Dpkg::Control::Fields, Dpkg::Version: avoid the "_" prototypeRaphaël Hertzog1-1/+2
Keep compatibility with perl 5.8 by avoiding the "_" prototype which has been introduced in perl 5.10.
2009-11-08Add missing license headersGuillem Jover1-0/+13
2009-11-08Unify format in license headersGuillem Jover1-3/+3
Indent license text to one space after the '#'. Add '#' to blank lines between paragraphs and remove trailing '#' after the license text.
2009-11-08Replace FSF address by pointing to the gnu.org URLGuillem Jover4-12/+8
Use the <http://www.gnu.org/licenses/> URL, instead of in most cases the outdated FSF address, which is way more stable, as the latter has changed several times in the past.
2009-11-06Dpkg::Control::Hash: handle arbitrary field valuesRaphaël Hertzog1-27/+42
Checking the validity of new field values at run-time was very expensive. In order to avoid this check, the design of the object has been changed to accept arbitrary values, they are simply escaped as necessary during output. The only data lost in a save()/load() cycle are the trailing whitespaces on every line of all values. This API change implies fixes in all scripts/modules reading/creating values for multiline fields. The non-regression test also had to be adjusted.
2009-11-06Dpkg::Control::Hash: use lower-case internally for keysRaphaël Hertzog1-8/+8
Only use field_capitalize() when exporting keys names outside of the object. lc() is way faster than field_capitalize() and that makes a difference in performance when you're reading/setting values many times.
2009-10-31Dpkg::Changelog::Entry, Dpkg::Control::Changelog: new modulesRaphaël Hertzog1-0/+59
Dpkg::Changelog::Entry is a somewhat generic representation of a changelog entry. It offers an interface exporting the basic information that we need to extract for dpkg-parsechangelog. Dpkg::Changelog::Entry::Debian is the implementation of this interface for the typical Debian changelog entry. Dpkg::Control::Changelog is the object representing the information exported by dpkg-parsechangelog. It starts empty as a simple Dpkg::Control of type CTRL_CHANGELOG. Those new modules are not yet used by the Dpkg::Changelog modules.
2009-10-18Dpkg::Control::Fields: allow transfer of custom fieldsRaphaël Hertzog1-6/+15
Custom fields can be copied when they do not target one of the official file type who are explicitely managed by the letter scheme (X[SBC]-).
2009-10-09Dpkg::Control: rename CTRL_APT_* to CTRL_INDEX_*Raphaël Hertzog2-21/+21
The Packages and Sources files are not really specific to APT. Those files are indexes that can be used by other programs.
2009-10-01Dpkg::Control::Fields: add Priority and Section fields to CTRL_APT_SRCRaphaël Hertzog1-2/+3
Both fields are allowed in Sources files, they are generated by dpkg-scansources or apt-ftparchive based on the override files.
2009-09-20Dpkg::Control::Fields: don't fail when vendor hook is not (well) implementedRaphaël Hertzog1-0/+1
2009-09-19Register field Dm-Upload-Allowed as Debian specificRaphaël Hertzog1-4/+1
2009-09-19Add vendor hook to register custom fieldsRaphaël Hertzog1-0/+15
2009-09-19Dpkg::Control::Fields: official list of control fieldsRaphaël Hertzog1-0/+564
This new module provides an official list of control fields as well as many functions to query that list and the meta-information associated to each list.