Age | Commit message (Collapse) | Author | Files | Lines |
|
The check is very simple, and can be done w/o requiring calling diff(1)
for each input file.
This makes the code shorter, more portable, and should be faster in the
non-binary cases.
|
|
Thanks-to: Niels Thykier <niels@thykier.net> (for typo in dpkg(1))
|
|
To be able to build a source tree, a user needs write permisions on it,
but not necessarily ownership of those files. We check the existing file
permissions and avoid changing them if not necessary, which helps in the
case where the user does not have ownership of those files, and they
were already present.
Closes: #898010
Naming-by: Julian Andres Klode <jak@debian.org>
|
|
|
|
|
|
That is "" or '', and not the unbalanced `' pair.
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
Do not use base which is bloated, and we don't need any other of
Exporter's inherited methods anyway.
|
|
Fixes ControlStructures::ProhibitCStyleForLoops.
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
|
|
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
|
|
Fixes InputOutput::ProhibitBarewordFileHandles.
Warned-by: perlcritic
|
|
This also gets rid of the EOF constant shadowing the EOF member from
Dpkg::Compression::FileHandle.
|
|
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.
|
|
Without this local($_) the function could modify the $_ variable as used
by the caller.
|
|
Since 1.13.14~20 (2006-02-10), dpkg-source touches the files it
patches when unpacking, with a single date. This way, the order of
mtimes does not depend on the order in which the files were patched,
which is convenient when e.g. configure.in and configure are patched.
More precisely, dpkg-source does something like the following:
my $now = time();
foreach my $fn (@patched_files) {
utime($now, $now, $fn);
}
Unfortunately when the filesystem is NFS, "touch" and normal
modification set mtime and atime to the current time on the server
side, while time() returns the current time on the client side.
The two clocks can disagree, producing breakage.
So unless a timestamp has been passed explicitly, use utime(undef,
undef, $fn) to set mtime for the first file to the server side time
and copy it (rounded down to a number of seconds) to all patched
files.
Reported-by: Stéphane Glondu <glondu@debian.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Raphaël Hertzog <hertzog@debian.org>
Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
|
|
While parsing diff's output, accept any sentence that contains the word
differ (as specified by POSIX) to identify that binary files could
not be compared.
|
|
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.
|
|
|
|
|
|
We don't need to set @ISA now.
|
|
There's no point in a different failure vs error or syserr function, so
let's remove it.
|
|
The remaining non exported functions and variables need to, either
disappear, move to some better place, be renamed, or for variables
to get hidden through a getter/setter.
|
|
* scripts/Dpkg/Source/Functions.pm (fixperms): Fix chmod call to
also work when POSIXLY_CORRECT is set.
|
|
* scripts/Dpkg/Source/Functions.pm (is_binary): New function
to check if a file is binary by using diff against it.
* scripts/Dpkg/Source/Package/V2.pm (do_build): Check that all files from
the debian sub-directory are non-binary and only allow whitelisted binary
files.
* man/dpkg-source.1: Document this behaviour.
|
|
* scripts/Dpkg/Source/Archive.pm: New "in_place" option to
extract an archive in the target directory instead of replacing
the whole target directory. Replace the logic to fix permissions
by fixperms() which is a...
* scripts/Dpkg/Source/Functions.pm (fixperms): new function to
fix permissions on a given directory so that they match the rights
expected through the umask.
|
|
* scripts/Dpkg/Exit.pm: Enable to register some exit handlers that
are called when a script is interrupted by a signal.
* scripts/Dpkg/Source/Functions.pm: Contains some generic functions
used by other Dpkg::Source::* modules. Only erasedir() for now.
|