summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Control
AgeCommit message (Collapse)AuthorFilesLines
2015-04-18debian: Update my copyright yearsGuillem Jover2-0/+2
2015-04-10Consistently use proper quotation marks all over the placeGuillem Jover1-1/+1
That is "" or '', and not the unbalanced `' pair.
2015-03-31Expand EOF and eof into "end of file" in error messagesGuillem Jover1-1/+1
2015-03-31scripts: Uppercase field names in error messagesGuillem Jover1-1/+1
2015-03-30perl: Rework use and exporter declarationsGuillem Jover4-14/+35
Place 'use' strict and warnings first, then Exporter 'our' declarations, then Test module imports, then system module imports, then Dpkg module imports, then 'use' parent and overload pragmas, separated by a blank line for each block. Split each exported symbol declaration into its own line to ease modifications.
2015-01-28Dpkg: Use shift instead of @_ on single argument unpackingGuillem Jover2-2/+2
2015-01-28scripts: Rename and deprecate _g function with g_Guillem Jover3-16/+16
The old function name was inconsistent with the other gettext family of short aliases which has already caused some code typos, and functions starting with underscore are considered by convention private in Perl.
2014-10-12scripts: Document private modules as such in a CHANGES sectionGuillem Jover1-0/+6
This is to try to make sure, that even if documented, people will not accidentally rely on private modules, that have not API stability guarantees.
2014-10-12scripts: Document all public module versions in a CHANGES sectionGuillem Jover6-0/+34
This makes it clear what is the current version of the module, and that it is a public interface.
2014-10-06scripts: Unpack arguments instead of accessing @_ directlyGuillem Jover1-3/+6
Addresses Subroutines::RequireArgUnpacking. Warned-by: perlcritic
2014-10-06perl: Use length instead of /^$/ to test for an empty stringGuillem Jover1-3/+3
Addresses RegularExpressions::ProhibitFixedStringMatches. Warned-by: perlcritic
2014-10-06perl: Do not use the topic variable unnecessarilyGuillem Jover1-4/+4
Fixes BuiltinFunctions::ProhibitUselessTopic and RegularExpressions::ProhibitUselessTopic. Warned-by: perlcritic
2014-10-06scripts: Use named variables instead of using the topic variableGuillem Jover1-5/+5
Switch code that uses roughly more explicit instances of the topic variable than implicit ones. Addresses BuiltinFunctions::ProhibitUselessTopic. Warned-by: perlcritic
2014-08-09Dpkg::Control::HashCore: Say OpenPGP instead of PGP in comments and errorsGuillem Jover1-8/+8
When we meant the standard (and not the tool) we should have been saying OpenPGP.
2014-08-09Dpkg::Substvars: Add automatic variable trackingGuillem Jover1-1/+1
This makes the code more clear and does not require to explicitly list the variables on output.
2014-06-05Dpkg::Control::HashCore: Only skip actual empty first line field valuesGuillem Jover1-1/+1
Regression introduced in commit c2ee90f92ab6c915db774403414b2ea70c967c3e. We need to check if the value is empty, not if it's false. Add a regression test.
2014-05-23Dpkg::Control::HashCore: Do not emit trailing space on field empty first lineGuillem Jover1-6/+9
This spurious space is unnecessary and takes a non-insignificant amount of disk space on archive index files for example. Update dpkg-dev Breaks on devscripts to version << 2.14.4, as previous versions of debchange expect a trailing space from dpkg-parsechangelog output. Closes: #749044 Based-on-patch-by: Johannes Schauer <j.schauer@email.de>
2014-05-17Dpkg: Update and fix CHANGES POD sectionsGuillem Jover1-1/+1
Do not use actual POD =item, just normal paragraphs. Split items in different paragraphs. Sort versions in decreasing order. Document missing changes in public interfaces. Qualify methods with the variable.
2014-05-17perl: Fix unused capture groups false positivesGuillem Jover1-5/+6
These are false positives, as when there's no match perl will leave the subpattern variables untouched. We'll just use the opportunity to unconfuse perlcritic, making some of those variable usages more clear by using intermediate variables. Fixes RegularExpressions::ProhibitUnusedCapture. Warned-by: perlcritic
2014-04-21dpkg-source: Add arch and profile information to Package-List fieldGuillem Jover1-0/+4
Add two new optional values to the Packages-List field, with architecture and build-profiles information. These values have the form «name=value1,value2», and might appear in any order after the mandatory values. This allows to run bootstrapping analysis over the Sources package indices. Requested-by: Johannes Schauer <j.schauer@email.de> Suggested-by: Raphaël Hertzog <hertzog@debian.org>
2014-04-21Dpkg::Control::HashCore: Document is_pgp_signed as a public optionGuillem Jover1-0/+7
Closes: #735975
2014-04-21scripts: Localize $_ in functions with while (<$fh>) style loopsGuillem Jover1-0/+1
This way we make sure we don't affect the $_ value for the caller, in case it was being used.
2014-01-15Dpkg::Control::FieldsCore: Add support for Testsuite source fieldGuillem Jover1-1/+5
This field is used to specify what type of test suite is present in the source package. The values within are comma separated.
2013-12-07Use https:// URLs instead of http:// when possibleGuillem Jover7-7/+7
2013-12-05Add experimental build profiles supportGuillem Jover1-3/+8
This adds the basic infrastructure support for a new class of generic build-time dependency restrictions, and in particular implements the specific build profiles, which will allow to cull build dependencies depending on the profile being used. There's several things this can be used for, like new port bootstrapping, reduced package builds, and similar. In the future other kinds of restrictions could be added as the build profiles are namespaced with “profile.”. An example field could be: Build-Depends: exotic-compiler, libneeded-dev, tool-tiny, tool-huge (>= 1.0) [linux-any] <!profile.embedded !profile.bootstrap> or even stuff like: Depends: net-tools <profile.network>, plugin-curl <!profile.no-plugins> The generated binary packages and .changes files will get a new Built-For-Profiles field containing the active profiles during the build. In addition the build profile can be selected using the environment variable DEB_BUILD_PROFILES, with space separated values, such as: DEB_BUILD_PROFILES="embedded bootstrap" The management and possible registration in the profile namespace is currently out of scope in dpkg, this should probably be handled by a distribution specific process. See draft <http://www.hadrons.org/~guillem/debian/docs/embedded.proposal>. Closes: #661538 Based-on-patch-by: Patrick "P. J." McDermott <pjm@nac.net> Based-on-patch-by: Wookey <wookey@debian.org> Based-on-patch-by: Johannes Schauer <j.schauer@email.de> Signed-off-by: Guillem Jover <guillem@debian.org>
2013-12-05Do not accept an initial hyphen in field namesGuillem Jover1-0/+3
Accepting such field names as valid, would make the parsers accept control stanzas that have not been properly sanitized from OpenPGP dash-escaping. Just refuse these field names, as there's really no reason to accept them.
2013-12-04perl: Surround FileHandles with braces in print callsGuillem Jover2-2/+2
Fixes InputOutput::RequireBracedFileHandleWithPrint. Warned-by: perlcritic
2013-12-04scripts: Use croak instead of internerr on programming errors in modulesGuillem Jover1-1/+3
Remove now unused internerr() function, replaced by croak which does a way better job. Addresses ErrorHandling::RequireCarping. Warned-by: perlcritic
2013-12-04perl: Use croak instead of die on programming errors in modulesGuillem Jover1-1/+2
Addresses ErrorHandling::RequireCarping. Warned-by: perlcritic
2013-12-04perl: Switch to use low precedence boolean operators for error checksGuillem Jover1-2/+2
This will make it safe to remove parenthesis around builtins.
2013-12-04perl: Try to avoid boolean operators after predicates on error checksGuillem Jover1-1/+2
Using boolean operators after predicates for error checking makes the code flow slightly confusing, do that only after actions, to check if they succeeded and error out otherwise.
2013-11-24Dpkg::ErrorHandling: Move syntaxerr to Dpkg::Control::HashCore::parse_errorGuillem Jover2-15/+36
This places the function where it belongs.
2013-10-27doc: Write hyphen instead of dash when we mean the ‘-’ characterGuillem Jover1-1/+1
2013-07-26Dpkg::Source::Package: Do not scan control file twice for PGP signatureGuillem Jover1-3/+3
The code was pre-scanning the control file looking for a PGP signature, and the parser was doing a more thorough check later on. Just remove the double parsing, and rely on the more accurate one from the parser.
2013-07-26Dpkg::Control::HashCore: Correctly apply substvar text cleanupsGuillem Jover1-5/+16
Use the new information to properly apply substvars when outputting control stanzas, and avoid doing text cleanups on field values where those changes are not relevant. Closes: #659814
2013-07-26Dpkg::Control::FieldsCore: Add field value separation informationGuillem Jover1-2/+58
This information helps when needing to handle the field values semantically.
2013-07-26Dpkg::Control::HashCore: Switch module to use Dpkg::Control::FieldsCoreGuillem Jover1-13/+4
Because Dpkg::Vendor is not entangled with Dpkg::Control::FieldsCore anymore, Dpkg::Control::HashCore will be able to use it and Dpkg::Control::HashCore::Tie can use it now instead of duplicating field_capitalize().
2013-07-26Dpkg::Control::Fields: Detangle Dpkg::VendorGuillem Jover4-1025/+1119
Move the bulk of the code into two new vendor-neutral Core sub-modules Dpkg::Control::FieldsCore and Dpkg::Control::HashCore, that get imported by Dpkg::Control::Fields and Dpkg::Control::Hash respectively; so that modules like Dpkg::Control::HashCore can make use of Dpkg::Control::FieldsCore w/o getting into a circular import due to Dpkg::Vendor previously using Dpkg::Control::Hash. The old dependency graph would have been: Control::Hash → Control::Fields ↑ ↓ Vendor The new one would be: Control::Hash → Control::Fields ↓ ↓ ↓ ↓ Vendor ↓ ↓ ↓ ↓ Control::HashCore → Control::FieldsCore
2013-06-22scripts: Use F<> for pathnames in POD markupGuillem Jover1-2/+2
2013-06-22perl: Add a VERSION to all modulesGuillem Jover1-0/+2
Addresses Modules::RequireVersionVar.
2013-06-22scripts: Inherit from parent instead of baseGuillem Jover3-4/+4
Use the lightweight parent instead of the bloated base.
2013-06-22scripts: Do not inherit from Exporter just import its importGuillem Jover2-2/+2
Do not use base which is bloated, and we don't need any other of Exporter's inherited methods anyway.
2013-06-22Dpkg: Deprecate lowercase exported by default variablesGuillem Jover1-1/+1
Rename, uppercase and do not export new variables by default, to avoid cluttering the caller namespace, and to give them consistent names. We'll keep the old variables for a while, to not break uses from external modules. Addresses Variables::ProhibitPackageVars.
2013-06-21scripts: Use a new Dpkg::CONFDIR variable instead of literal stringsGuillem Jover1-1/+1
This will make life easier for downstreams using different paths. Allow overriding pkgconfdir at configure time.
2013-06-21Dpkg::Control::Fields: Use internerr instead of errorGuillem Jover1-1/+1
2013-06-21Dpkg::Control::Hash: Do not require unused Dpkg::ErrorHandlingGuillem Jover1-1/+0
2013-06-21Dpkg::Control::Hash: Fix set_options to take a hash instead of two scalarsGuillem Jover1-2/+2
This fixes the function to behave as documented, and expected from the name itself.
2013-05-04Do not use double-quotes on strings that do not need interpolationGuillem Jover4-33/+33
Using double-quotes imposes a small performance penalty as the perl parser needs to check if any interpolation is needed. Use double-quotes only when the string contains single-quotes. Ideally we'd use double-quotes too for escaped meta-characters that might otherwise be confusing to immediately see if they need interpolation or not, but the policy does not (currently) allow to ignore these. Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
2013-04-30Do not quote simple identifier hash keys in element accessesGuillem Jover2-20/+20
Addresses ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
2013-04-30Do not quote simple identifier hash keys in initializationsGuillem Jover2-7/+7
Do not quote the keys for any hash which will always use simple identifiers, as that is taken care of by the => operator. So this does not apply to overload pragmas, version operators, field names, substvars, command line options or filenames. Addresses ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic