summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Control
AgeCommit message (Collapse)AuthorFilesLines
2019-11-26Dpkg: Say class instead of object when appropriateGuillem Jover5-6/+6
These were referring to the type and not the instance, which makes using the incorrect nomenclature confusing.
2019-02-23dpkg-genbuildinfo: Add support for a new Build-Tainted-By fieldGuillem Jover1-1/+6
This field will contain a list of tainting reason tags, which can denote that the current build has potentially been broken. Suggested-by: Alexander E. Patrakov <patrakov@gmail.com>
2019-01-15perl: Fix POD for Dpkg::Interface::Storable derived method implementationsGuillem Jover2-17/+17
Document inherited methods. Document the return values. Note which arguments are optional. Reorder methods by their position in the stack.
2018-08-30Dpkg::Control::Fields: Do not use & sigil for function callsGuillem Jover1-3/+6
Warned-by: perlcritic Fixes: Subroutines::ProhibitAmpersandSigils
2017-10-16Dpkg::Control::HashCore: Optimize field/value parsing in parse()Guillem Jover1-2/+3
We switch from a capturing regex to split() plus a checking regex.
2017-10-16Dpkg::Control::HashCore: Optimize first character matching in parse()Guillem Jover1-2/+4
We store the first character in a variable.
2017-10-16Dpkg::Control::HashCore: Optimize trailing space trimming in parse()Guillem Jover1-1/+1
We should only apply the "costly" substitution when there is at least one whitespace.
2017-10-16Dpkg::Control::HashCore: Optimize trailing space matching on parse()Guillem Jover1-6/+10
We remove the trailing space after the chomp, so that we cover the common case of a single \n with chomp, and do not need to check for trailing spaces more than once while parsing. We preserve the chomp'ed string to be used for the Armor Header checks, which have a different set of allowed whitespace, than what \s covers.
2017-10-16Dpkg::Control::HashCore: Expect stanza delimiters more often than Armor HeadersGuillem Jover1-10/+10
Usually we will just have Armor Headers at the beginning and end of the data, so it's more common to find stanza delimiter lines. Optimize for that.
2017-10-16Dpkg::Control::HashCore: Do not use an intermediate variable in STORE methodGuillem Jover1-2/+1
2017-10-12scripts: Add support for source package Description and substvarsGuillem Jover1-4/+4
We support a new source package Description field in debian/control that will be copied into the .dsc file. The field will also be used to initialize the new source:Synopsis and source:Extended-Description substvars that will be available when generating the DEBIAN/control and .changes files. Closes: #555743
2017-10-12dpkg-genbuildinfo: Add support for new Build-Kernel-Version fieldGuillem Jover1-2/+6
Packages intended to be built in a generic way must never rely on the currently running kernel on the build system (an exception could be an optimization rebuild using the current system as the reference baseline). But to be able to detect when a package might not be reproducible due to varying kernel information it is still useful to be able to record this information. Although that information can be very sensitive. When the builder has explicitly enabled the Build-Kernel-Version field with the new dpkg-genbuildinfo --always-include-kernel option, it will get included in the generated .buildinfo file. Closes: #873937
2017-09-24dpkg-buildpackage: Add support for rootless buildsGuillem Jover1-0/+5
Implement the rootless-builds specification, by honoring the Rules-Requires-Root (R³) field.
2017-09-24Dpkg::Control::HashCore: Use substr instead of a regexGuillem Jover1-2/+2
When we want to match the first character on a parsed control file line, using substr is more efficient than using a regex.
2017-09-24Dpkg::Control::FieldsCore: Do not execute code at import timeGuillem Jover1-11/+21
2017-09-24Dpkg::Control::FieldsCore: Remove dependency on Dpkg::ChecksumsGuillem Jover1-19/+39
2017-09-24Dpkg::Control::FieldsCore: Switch internal field name handling to lowercaseGuillem Jover1-157/+271
Change field name handling to always work with them as lowercase, add a new name key to store the capitalized form, and use that when we need to return that form instead of computing it on every instance.
2017-09-24Dpkg::Control::FieldsCore: Complete field order for all control typesGuillem Jover1-3/+8
The CTRL_PKG_DEB and CTRL_FILE_STATUS types were missing some allowed fields in their order list, which meant that the field information was not coherent.
2017-09-24Dpkg::Control::FieldsCore: Mark all missing CTRL_INDEX_* fields as allowedGuillem Jover1-6/+6
2017-09-24Dpkg::Control::Types: Move misplaced commentsGuillem Jover1-2/+2
2017-05-20test: Enable perlcritic Miscellanea::ProhibitTiesGuillem Jover1-1/+1
2017-05-06doc: Spelling fixesJosh Soref1-1/+1
Signed-off-by: Guillem Jover <guillem@debian.org>
2017-01-29Revert "dpkg-source: Generate Testsuite-Restrictions fields from test ↵Guillem Jover1-6/+1
restrictions" This reverts commit 9899bdcf9bde76d969b124abf0a898fcbb202c70. This change is contentious and should have been discussed more widely. Given that this has been live only for a couple of days, the impact should be minimal, but still something to take into account once and if this gets reintroduced, in the same or different form and shape. Closes: #852820
2017-01-25dpkg-source: Generate Testsuite-Restrictions fields from test restrictionsGuillem Jover1-1/+6
This information is currently only available in the Restrictions field in the debian/tests/control file. When dispatching tests, it might be inconvenient to have to download and unpack the source package beforehand. Let's expose this via the .dsc in a similar way we do for the Testsuite-Triggers field. Closes: #847926 Based-on-patch-by: Iain Lane <laney@debian.org>
2017-01-23man, Dpkg::Control::FieldsCore: Add new Auto-Built-Package fieldGuillem Jover1-1/+5
This field is used to distinguish packages that have been automatically injected by some build tool, and are not present in the debian/control file.
2017-01-22doc: Fix typos in documentation and code commentsGuillem Jover1-1/+1
Warned-by: codespell, spellintian
2016-11-16dpkg-genbuildinfo: Add Build-Date fieldGuillem Jover1-1/+4
This records the time the build happened. This might be useful when there is a need to track down problems caused by external time-based events not visible from inside the build system. Things like hardware, software deployment or other such failures.
2016-11-03scripts: Add support for .buildinfo filesGuillem Jover2-6/+38
The .buildinfo files are a new type of control files, similar to the .changes files, meant to describe the environment of a build and its artifacts. They are meant to be added to the Debian archive to allow independent parties to reproduce a build and verify the result. Specifications for .buildinfo are available at: <https://wiki.debian.org/ReproducibleBuilds/BuildinfoSpecification> This patch adds support for .buildinfo files in Dpkg::Control, adds new .buildinfo fields to Dpkg::Control::Fields, a new builtin-system-build-paths Dpkg::Vendor hook, and adds a new script named dpkg-genbuildinfo, that will now be called by dpkg-buildpackage before generating the .changes file. [ntyni@debian.org: small changes. ] Closes: #138409 Based-on-patch-by: Jérémy Bobbio <lunar@debian.org> Signed-off-by: Guillem Jover <guillem@debian.org>
2016-10-30Dpkg::Substvars: Add new method set_field_substvars()Guillem Jover1-3/+1
Refactor the ad-code in Dpkg::Control::HashCore to use this new method.
2016-10-30Dpkg: Document the behavior for consecutive calls to parse() methodsGuillem Jover3-4/+9
Prompted-by: Johannes Schauer <josch@debian.org>
2016-07-03man, perl: Remove most AUTHOR sectionsGuillem Jover7-28/+0
These are strongly discouraged by the man-pages project, because they are redundant with the copyright notices, and tend to get out-of-sync. In addition their format is inconsitent. Just remove them in the same way we did for man pages in the past.
2016-07-03dpkg-source: Generate Testsuite-Triggers field from test dependenciesGuillem Jover1-2/+6
Sometimes autopkgtests regress due to change in a package which is only a test dependency (Depends: in debian/tests/control), not a build or binary one. It is useful to trigger a test if such a test dependency changes. Record the union of all test dependency packages in a new Testsuite-Triggers field in the .dsc, so that they will be recorded in the Sources package index. Ignore versions and flatten OR dependencies as they are not interesting for determining reverse test dependencies and should not be (ab)used for replacing debian/tests/control parsing. Closes: #779559 LP: #1491145 Based-on-patch-by: Martin Pitt <martin.pitt@ubuntu.com> Signed-off-by: Guillem Jover <guillem@debian.org>
2016-07-03Dpkg::Control: Add new autopkgtest control files supportGuillem Jover4-1/+200
Add new CTRL_TESTS control types, new Dpkg::Control::Tests and Dpkg::Control::Tests::Entry modules, add support for the fields that can appear on these control files, and update Dpkg::Index to handle them as well. [niels@thykier.net: Fix logic inversion. ]
2016-07-03Dpkg::Changelog: Add new Timestamp field to outputGuillem Jover1-1/+4
This field contains the date of the entry in seconds since the epoch. To make it easier to retrieve the date in a format that is easier to handle.
2016-07-03scripts: Fix typos in PODGuillem Jover1-1/+1
2016-04-01Dpkg::Control::HashCore: Remove unused Dpkg::Checksums importGuillem Jover1-1/+0
2016-01-26Dpkg::Control::Types: Move constant comments into their own lineGuillem Jover1-10/+20
This gets rid of the need to align the comments when longer constants are added, and unifies the style with the rest of the code base.
2016-01-26Dpkg::Control: Add new CTRL_COPYRIGHT control block typesGuillem Jover2-3/+41
The types are CTRL_COPYRIGHT_HEADER, CTRL_COPYRIGHT_FILES and CTRL_COPYRIGHT_LICENSE. These describe the different control blocks of a machine readable debian/copyright file, as specified in <https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/>.
2016-01-26Dpkg::Control: Add new CTRL_REPO_RELEASE control block typeGuillem Jover2-4/+34
2015-12-25Dpkg::Control::FieldsCore: Add support for Build-Essential fieldGuillem Jover1-0/+3
Closes: #806315
2015-07-29Dpkg::Control::FieldsCore: Allow the Maintainer field in CTRL_FILE_STATUSGuillem Jover1-1/+1
This field is part of the status field.
2015-07-29Dpkg::Control::HashCore: Remove trailing space before handling dot-separatorsGuillem Jover1-1/+1
Regression introduced in commit aea291e3db1ac0414dcf005a0a607e78bdd77a5e. Any spaces after the blank line dot-separator should be stripped before handling the dot-separator, otherwise we get duplicated dots in field contents. Closes: #789580 Stable-Candidate: 1.16.x 1.17.x
2015-07-28Dpkg: Remove my keyword from POD function prototypesGuillem Jover2-4/+4
2015-05-30scripts: Add missing strict and warnings pragmas for submodulesGuillem Jover1-0/+3
2015-05-18scripts: Document dpkg version when module versions got bumpedGuillem Jover6-8/+8
This has two purposes, first it will make it easier to know if the module version needs to be bumped for the current development release, and second it will make it easier for users to know how "old" that module version is, and to which dpkg series and specific version it corresponds to.
2015-05-18scripts: Say METHODS instead of FUNCTIONS or OBJECT FOO in POD section titlesGuillem Jover3-3/+3
2015-05-18Dpkg::Control::HashCore: Use proper quotesGuillem Jover1-1/+1
Reverts partial regression introduced with cherry pick in commit aea291e3db1ac0414dcf005a0a607e78bdd77a5e.
2015-05-09Dpkg::Control::Info: Do not print on undef filehandle in output()Roderich Schupp1-1/+1
Closes: #781887 Signed-off-by: Guillem Jover <guillem@debian.org>
2015-05-09Dpkg::Control::Info: Allow not loading the file in the constuctorGuillem Jover1-8/+22
Accept an %opts argument for the constructor, and accept either passing a filename option as undef, or a scalar undef. Closes: #782019
2015-05-09Dpkg::Control::HashCore: Fix OpenPGP Armor Header Line parsingGuillem Jover1-9/+12
Cherry picked from commit b4ccfe4982161b8beb44f1d0c98f791c4f238edd. We should only accept [\r\t ] as trailing whitespace, although RFC4880 does not clarify what whitespace really maps to, we should really match the GnuPG implementation anyway, as that is what we use to verify the signatures. Fixes: CVE-2015-0840 Reported-by: Jann Horn <jann@thejh.net>