Age | Commit message (Collapse) | Author | Files | Lines |
|
Replace direct usage of $diff_ignore_default_regexp and
@tar_ignore_default_pattern with accessor functions.
Addresses Variables::ProhibitPackageVars.
Warned-by: perlcritic
|
|
All changed instances are documentation or private code interfaces.
The only remaining variable instance with a regexp name is a publicly
exposed variable, which will eventually disappear once it has gone
through the deprecation process.
|
|
Add new functions to interact with the exit handlers. Mark @handlers as
deprecated and to stop exporting it on VERSION 2.00.
Addresses Variables::ProhibitPackageVars.
Warned-by: perlcritic
|
|
Replace all direct accesses to $compression_re_file_ext with calls to
the new function, and mark the variable as deprecated to be removed on
VERSION 2.00.
Addresses Variables::ProhibitPackageVars.
Warned-by: perlcritic
|
|
Make sure to error out if one of the subprocesses exits with an error.
Spotted-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
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.
|
|
|
|
In the restore_quilt_backup_files() function, the chmod() call has the
arguments swapped. This prevents restoring quilt patches that remove
files.
Closes: #710265
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
This avoids using the grep builtin on scalar context, which is
suboptimal as it does not short-circuit on first match, and it's
intended to produce an output array.
Ideally we'd directly use the functions from List::MoreUtils, because
they might be more performant, but not being a core module is a show
stopper.
Addresses BuiltinFunctions::ProhibitBooleanGrep.
|
|
Fixes ValuesAndExpressions::ProhibitMixedBooleanOperators.
|
|
These are double negations which are hard to grasp at a first glance.
Fixes ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions.
|
|
|
|
Ensure that a 3.0 (quilt) package has a non-native version and that
a 3.0 (native) package has a native version. To get the information,
extend Dpkg::Version with a is_native method to check whether a
version has a revision or not.
[guillem@debian.org:
- Add is_native to history of changes.
- Do not return an error string when returning a true result. ]
Closes: #700177
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Instead of doing the magic of generating a version string without epoch
and revision and a version string without epoch in Dpkg::Source::Package,
extend Dpkg::Version's as_string function to support generating that
string.
Based-on-patch-by: Bernhard R. Link <brlink@debian.org>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The files inside the diff were being sorted correctly for existing
patches, but not for new ones.
Closes: #689193
|
|
Use the lightweight parent instead of the bloated base.
|
|
Do not use base which is bloated, and we don't need any other of
Exporter's inherited methods anyway.
|
|
Lowercase module names are reserved by convention for pragmas, and
there's really no need to diverge here from the general dpkg project
naming convention. Also make sure source package format variant names
are always in lowercase, to not allow names that would not work with
previous dpkg-source versions.
Fixes NamingConventions::Capitalization.
|
|
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.
|
|
Fixes ValuesAndExpressions::RequireNumberSeparators.
Warned-by: perlcritic
|
|
Fixes ValuesAndExpressions::ProhibitMismatchedOperators.
Warned-by: perlcritic
|
|
Do not read each line to then join it, just switch on slurp mode and
do it in one go. Use the newly created function file_slurp.
Fixes InputOutput::ProhibitJoinedReadline.
Warned-by: perlcritic
|
|
Fixes ControlStructures::ProhibitCStyleForLoops.
Warned-by: perlcritic
|
|
Fixes Variables::ProhibitUnusedVariables.
Warned-by: perlcritic
|
|
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
|
|
Addresses ValuesAndExpressions::ProhibitInterpolationOfLiterals.
Warned-by: perlcritic
|
|
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
|
|
The fixed key names are either inside unstable modules, internal to
them or for keys in code never released, so should not cause much of
an issue.
|
|
|
|
Fixes Subroutines::ProhibitReturnSort.
Warned-by: perlcritic
|
|
Even if these functions are defined inside another function, they are
still global, make them proper global functions by moving the definition
outside of the outter function and mark them explicitly as being private
by using an underscore prefix. There's no point in making these
anonymous nested functions, as they do not need to access any variable
from the outter functions.
Fixes Subroutines::ProhibitNestedSubs.
Warned-by: perlcritic
|
|
Fixes InputOutput::ProhibitBarewordFileHandles.
Warned-by: perlcritic
|
|
This also gets rid of the EOF constant shadowing the EOF member from
Dpkg::Compression::FileHandle.
|
|
|
|
This makes sure the functions always return the appropriate value
independent of the context.
Fixes Subroutines::ProhibitExplicitReturnUndef.
Warned-by: perlcritic
|
|
Mark false positives in the perl code so that perlcritic ignores them,
and so that they are documented in-place.
|
|
These just clutter the code base, as adding modelines for each possible
editor out there does not scale, and they are currently not exhaustive
anyway.
|
|
In addition to avoiding imports from unneeded modules, this fixes
a perl warning due to redefinition of getcwd() exported by both
the POSIX and Cwd modules, affecting any program executed with
«perl -w» and including the Dpkg::Source::Archive module.
Closes: #700978
Reported-by: Niels Thykier <niels@thykier.net>
Analysis-by: Raphaël Hertzog <hertzog@debian.org>
|
|
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>
|
|
When we restore files in the pop operation, the target directory is
usually pre-existing, but in the case where the patch is removing all the
files in the directory, the usage of patch's --remove-empty-files lead to
the removal of the parent directories which are empty.
This caused a regression in dpkg-source's handling of "3.0 (quilt)" source
package since we switched "3.0 (quilt)" to restore the quilt backup files
to unapply patches. Formerly we were using "patch -R" which was creating
the required directories by itself.
Reported-by: Thomas Koch <thomas@koch.ro>
Closes: #683547
|
|
Error messages like "couldn't parse control information from foo.deb"
are not full sentences, so don't punctuate them like one. The main
purpose of this patch is stylistic consistency, but perhaps it can
also make copy-and-paste from messages like
dpkg-query: no path found matching pattern /usr/bin/agrep.
a little easier.
Most actual full sentences should remain untouched. A few full sentences
are error messages at heart, so this patch converts those to lower-case
sentence fragment form, too.
[guillem@debian.org:
- Add missed strings.
- Minor tweaks to strings. ]
Closes: #624000
Requested-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Closes: #677631
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
This option is supported by formats "2.0" and "3.0 (quilt)". It disables
the patch unapplication that can happen in the --after-build hook.
|
|
This new Dpkg::Source::Quilt object handles all the traditional quilt
operations of applying/unapplying patches and the associated handling of
the quilt database (the .pc directory).
This commit should not introduce any user-visible changes.
|
|
That way the same command can be used whatever kind of upstream files has
been modified.
Reported-by: Cyril Brulebois <kibi@debian.org>
|
|
Move the code handling debian/source/include-binaries in a dedicated
object.
|
|
Without this local($_) the function could modify the $_ variable as used
by the caller.
|
|
The commit function already uses various exit handlers to clean up in case
of failures. Unfortunately those handlers were never triggered because
there was no global eval intercepting the failures. This commit adds the
required logic.
|
|
When dpkg-source regenerates the automatic patch (with formats "2.0" or
"3.0 (quilt)") it will keep the current patch header to avoid losing
changes made by the maintainer.
Reported-by: Cyril Brulebois <kibi@debian.org>
|