summaryrefslogtreecommitdiff
path: root/scripts/Dpkg
AgeCommit message (Collapse)AuthorFilesLines
2019-01-15Dpkg::Source::Package: Improve debian/source/format parsing and validationGuillem Jover1-16/+9
Make the regex more strict and decompose it right away instead of doing a second pass over it. Only initialize minor when we need to update the format. And fix the error for an invalid format to stop referencing the Format field, which might not be involved during the parsing.
2019-01-15Dpkg::Source::Package: Add a new format option to the new constructorGuillem Jover1-5/+16
This makes it easier to construct a source package object with the desired object, and initialize it as required. Prompted-by: James McCoy <jamesan@debian.org> Ref: https://salsa.debian.org/debian/devscripts/merge_requests/61
2019-01-15Dpkg::Source::Package::V3::Bzr: Fix format name in output messageGuillem Jover1-1/+1
2019-01-15Dpkg::Source::Patch: Do not recommend --include-removal when not supportedGuillem Jover1-4/+5
If the option has not been set, then the source format does not support it and we should thus not recommend the --include-removal option in the warning. Closes: #913012
2019-01-15Dpkg::Source::Package: Do not reinitialize fields member in constructorGuillem Jover1-2/+1
We initialized it already in the new constructor, no point in doing the same twice.
2019-01-15Dpkg::Shlibs::Objdump: Only select objdump program when going to use itGuillem Jover1-10/+13
Running code in the module scope means that anything importing the module will execute that code, which is undesirable. Move the initialization into a _select_objdump() sub, which gets assigned into a state variable on demand.
2019-01-15Dpkg::Shlibs::Objdump: Remove unused Dpkg::IPC importGuillem Jover1-1/+0
The spawn() call was removed but not the matching import. Fixes: commit 8ae966ae7d3635b8359829085db4262923ceae96
2019-01-15Dpkg::Vendor::Ubuntu: Fix buildflags override after default setting moveGuillem Jover1-5/+7
The default buildflags got moved from the Dpkg::BuildFlags module to the Dpkg::Vendor::Debian, but this module was not adapted to match. Instead of running the Debian hooks after the Ubuntu buildflags are set up, run them first, and then modify/prepend the bits we need to change. This fixes compiler optimization on ppc64el, and makes setting it more future proof. Fixes: commit d5374bc618310917557daa9c9ac2f4930515a0b2 Closes: #915881 Co-Author: Iain Lane <laney@ubuntu.com> Co-Author: Adam Conrad <adconrad@ubuntu.com>
2019-01-15Dpkg::File: Make file_slurp() also accept pathnames in addition to filehandlesGuillem Jover2-6/+17
This makes several call sites more clear, as we move the logic inside the function.
2019-01-15Dpkg::Changelog::Debian: Preserve modelines at EOFGuillem Jover1-2/+6
We should keep these and consider them as pseudo-EOF markers, and stop processing once seen. [lamby@debian.org: - Initial test cases for dpkg-mergechangelogs functional tests. ] Closes: #916056
2019-01-15Dpkg::Deps::Simple: Fix POD signature for new constructorGuillem Jover1-1/+1
2019-01-15perl: Fix POD for Dpkg::Interface::Storable derived method implementationsGuillem Jover8-74/+79
Document inherited methods. Document the return values. Note which arguments are optional. Reorder methods by their position in the stack.
2018-10-08Dpkg::Source::Package::V2: Move binary file detection to BinaryFiles moduleGuillem Jover2-44/+59
This makes it possible to reuse the code by other modules.
2018-10-08Dpkg::Source::Package::V2: Split BinaryFiles module into its own fileGuillem Jover2-84/+111
2018-10-08Dpkg::Source::Functions: Reimplement is_binary() w/o using diff(1)Guillem Jover1-23/+8
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.
2018-10-08Dpkg::OpenPGP: Do not read the gpg user configuration fileGuillem Jover1-1/+3
2018-10-08Dpkg::OpenPGP: Ignore Version field in enarmored outputGuillem Jover1-0/+1
This will contain different data depending on the program used. We do not really care about that, later versions of GnuPG have stopped emitting it, and it makes the test suite fail when using GnuPG 1.x. Fixes: https://rt.cpan.org/Public/Bug/Display.html?id=127217
2018-09-18perl: Replace all calls to Cwd::cwd with Cwd::getcwdJosh Triplett1-1/+1
The former calls /bin/pwd, while the latter uses the getcwd() syscall directly. Signed-off-by: Guillem Jover <guillem@debian.org>
2018-09-18dpkg-parsechangelog: Add new --reverse optionGuillem Jover2-5/+6
This option will make the output be in reverse order.
2018-09-18Dpkg::Dist::Files: Add support for file attributesGuillem Jover1-3/+14
This will make it possible to track key/value attributes for each file, so that we can track interesting information and pass it to the various programs parsing the debian/files file.
2018-09-18Dpkg::Vendor::Debian: Add fixfilepath support to reproducible featureGuillem Jover1-4/+17
This is a superset of the fixdebugpath feature supported by gcc-8, but covering in addition mappings for macros such as __FILE__ and similar.
2018-09-18Dpkg::Deps::KnownFacts: Satisfy :native with arch:all packages tooGuillem Jover1-1/+2
Architecture:all packages are treated as native ones as part of the current multi-arch design, the only current exception is in build dependencies with the :native arch-qualifier. It looks like this was an oversight when implementing the :native support, as there's been no rationale found for the current behavior. Closes: #854438 Analysis-by: Johannes Schauer <josch@debian.org>
2018-09-03Dpkg::Shlibs: Ignore nonexistent directories present in LD_LIBRARY_PATHGuillem Jover1-1/+3
We were trying to use realpath() on nonexistent directories, which means we'd get undef. Instead just completely ignore nonexistent directories from any processing. Fixes: commit 174a5bd2a080847d0ed901d269a2ba74476eba8b
2018-09-02Dpkg::Substvars: Fix typoGuillem Jover1-2/+1
2018-08-30Dpkg::Control::Fields: Do not use & sigil for function callsGuillem Jover1-3/+6
Warned-by: perlcritic Fixes: Subroutines::ProhibitAmpersandSigils
2018-08-30Dpkg::OpenPGP: Return the destination path on successful ASCII armor conversionGuillem Jover1-2/+2
This way we can distinguish the failure from the success case.
2018-08-30Dpkg::Source::Package::V3::Quilt: Print series file used when applying patchesGuillem Jover1-0/+2
We might use a vendor specific series file, so we should print the one being used to notify if this fact.
2018-08-30Dpkg::Shlibs: Warn when using LD_LIBRARY_PATH with a descendent of cwdGuillem Jover1-0/+10
This makes the deprecation explicit, so that we can start noticing what is inappropriately setting this variable for a purpose it was not designed for.
2018-08-30Dpkg::Substvars: Reword used/unused warnings to clarify their meaningGuillem Jover1-2/+4
Clarify the unknown and unused substitution variable warnings, to try to make them more clear as to what each implies. Closes: #904258
2018-08-30Fix some typosGuillem Jover1-1/+1
Thanks-to: Niels Thykier <niels@thykier.net> (for typo in dpkg(1))
2018-08-01Dpkg::Source: Do not change patch permissions if not necessaryGuillem Jover4-6/+19
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>
2018-07-30Dpkg::Deps: Split subpackagesGuillem Jover7-1349/+1634
This makes the structure easier to comprehend, and easier to read, otherwise it's difficutl to search for specific methods or functions and know immediately to what module they belong. It also makes for more structured POD.
2018-07-30Dpkg::Deps::KnownFacts: Rename _evaluate_simple_dep to evaluate_simple_depGuillem Jover1-2/+8
This method is currently used by Dpkg::Deps::Simple, and is marked as private by way of its underscore prefix. This will be a problem once we split the modules into different files, as then we are not supposed to be using private methods from external modules. Rename the method, and document it explicitly as being private, while only giving a partial prototype to deter its use.
2018-07-30Dpkg::Deps: Improve modules and method documentationGuillem Jover1-151/+377
Document each implemented method. This will make it easier to split the modules into their own files.
2018-07-30Dpkg::Deps: Clarify arch-qualified dependency simplificationGuillem Jover1-0/+3
Dependency simplification can only really be done for metadata for which we have all its context and information during the simplification process. Anything that relies on the state of the dependencies cannot be simplified. This means that any dependency that might change the satisfiability due to the value of Multi-Arch field of the depended on package cannot be simplified. Clarify this in the function commends, and add new test cases to cover this. Prompted-by: Stuart Prescott <stuart@debian.org>
2018-07-30Dpkg::Deps: Fix typo in PODGuillem Jover1-1/+1
2018-07-30Dpkg::Deps: Merge all Copyright notices into the same blockGuillem Jover1-8/+5
There should be no difference between Copyright and Portions Copyright, remove the distinction, and merge all these notices.
2018-07-30Dpkg::Gettext: Document textdomain() and ngettext() replacement functionsGuillem Jover1-0/+13
We should mention when these functions are present and what they do, so that users know when they can rely on these. Warned-by: Test::Pod::Coverage
2018-07-30Dpkg::Gettext: Fix fallback textdomain() to honor its expected interfaceGuillem Jover1-0/+7
Even though we will not use the domain value set by this function, we should honor its original interface and return a domain string, and update it when requested.
2018-07-24Dpkg::BuildFlags: Move default flags setting into the Dpkg::Vendor modulesGuillem Jover2-12/+24
This should really be a vendor specific default. It's also documented that way in the man page.
2018-07-24Dpkg::Vendor::Debian: Inline _parse_feature_area() into _add_build_flags()Guillem Jover1-13/+7
This function was being called on each foreach iteration to parse the options within the DEB_BUILD_MAINT_OPTIONS and DEB_BUILD_OPTIONS environment variables, and needed to parse these at construction time every time. Inlining it should make it more performant and in addition reduce line count.
2018-07-24Dpkg::Shlibs: Disable bool overload Dpkg::Version warningsGuillem Jover2-0/+8
The usage in this file is correct, but we are still doing boolean evaluation.
2018-07-24Dpkg::Shlibs::SymbolFile: Always assign proper Dpkg::Version to deprecatedGuillem Jover1-1/+1
We should always assign a proper Dpkg::Version object to the deprecated variable. Otherwise it can get confused with the scalar value 0 used on boolean context to denote it is *not* deprecated, instead of it being a version number 0.
2018-07-24Dpkg::Version: Bump VERSION and improve semantic change descriptionGuillem Jover1-4/+12
Give context to the warning message, otherwise it's not clear what is going on. If the users to not conditionalize the warning usage they will get a perl warning about the unknown warning category itself, bump the module version to be able to discern this change, and update documentation to reflect this.
2018-07-24Dpkg::Build::Types: Add new set_build_type_from_targets() functionGuillem Jover1-0/+32
2018-07-24Dpkg::Build::Types: Fix set_build_type_from_options() descriptionGuillem Jover1-2/+3
2018-06-22scripts: Do not use stringy eval to define different sub implementationsGuillem Jover1-31/+27
We can just assign an anonymous sub to the typeglob.
2018-05-05Dpkg::Changelog::Parse: Stop using tail(1) to read the end of the fileGuillem Jover1-3/+7
Instead of relying on the tail command, simply read the end of the file ourselves, assuming a packed set of 80 character lines, reading 4096 bytes before the end, implies around 51 lines, which is close to the 40 lines currently used. This should be both faster and should improve portability, because even if we are using the POSIX -n option, some systems do not have a POSIX compliant tail(1) on the default path, such as Solaris. Analysis-by: James Clarke <jrtc27@debian.org>
2018-05-04Dpkg::Version: Fix bool overload behaviorGuillem Jover1-3/+17
The current bool overload has broken semantics, because it considers the version "0" to be false. The bool overload used to have sane semantics (equivalent to is_valid()) before commit 5b9f353b2940de751df47036608afbe71992d622, but there it got changed to return the stringified version if it was valid, or undef otherwise, to fix a problem within dpkg-shlibdeps, instead of properly fixing the local-only problem in the tool. This makes the overload hard to use, and broke existing callers from external projects. We will emit a warning until dpkg 1.20.x to notify of the semantic change in case there is code relying on the broken semantics. For fixed code the warning can then be quiesced with: no warnings qw(Dpkg::Version::semantic_change::overload::bool); Closes: #895004
2018-05-04Dpkg::Shlibs::Objdump: Fix ELF program detectionGuillem Jover1-2/+8
An ELF executable is defined by whether the object has the EXEC_P flag defined or an interpreter in the program header. The former applies to statically linked programs, the latter to dynamically linked programs and possibly some shared libraries that can be executed, such as the ones provided by glibc. This is now more relevant as PIE makes normal executables show up as shared objects, so they do not contain the EXEC_P flag, and were not being detected as executables.