summaryrefslogtreecommitdiff
path: root/scripts/t
AgeCommit message (Collapse)AuthorFilesLines
2019-11-26Update number of tests (?)Igor Pashev1-1/+1
2019-11-26Dpkg::Version: Remove deprecation warning from semantic change in bool overloadGuillem Jover1-6/+0
2019-10-30test: Fix typosGuillem Jover1-1/+1
Warned-by: codespell
2019-10-12scripts/mk: Add support for nostrip DEB_BUILD_OPTIONS when setting STRIPGuillem Jover1-1/+7
2019-02-23dpkg-genbuildinfo: Add support for a new Build-Tainted-By fieldGuillem Jover1-2/+3
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-15scripts/mk: Add support for an improved dpkg_vendor_derives_from macroGuillem Jover4-1/+16
Version the macros so that both can be used, and default the unversioned one to the version 0 macro.
2019-01-15dpkg-genchanges: Only reference binary packages being uploadedGuillem Jover3-8/+2
The .changes file describes an upload, and its Binary and Description fields should contain (as documented) only references to the packages being uploaded. In case of a source-only upload, the Binary and Description fields should be empty. Closes: #818618
2019-01-15Dpkg::Source::Format: New moduleGuillem Jover1-0/+65
This new public module centralizes the handling of debian/source/format so that other projects can reuse it instead of having to reimplement it. Prompted-by: Mattia Rizzolo <mattia@debian.org> Ref: https://salsa.debian.org/debian/devscripts/merge_requests/63
2019-01-15Dpkg::Vendor::Ubuntu: Fix buildflags override after default setting moveGuillem Jover1-0/+57
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 Jover1-3/+1
This makes several call sites more clear, as we move the logic inside the function.
2019-01-15Dpkg::Changelog::Debian: Preserve modelines at EOFGuillem Jover9-2/+33
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
2018-10-08test: Skip version checks involving «dpkg --compare-versions» if not availableGuillem Jover1-2/+15
For the CPAN distribution or a non-dpkg-based distribution we cannot assume that dpkg will be installed, or even available at build time. Skip these tests if the tools is missing.
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 Jover1-1/+5
This option will make the output be in reverse order.
2018-09-18Dpkg::Dist::Files: Add support for file attributesGuillem Jover2-11/+24
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-0/+1
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/+20
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-08-30scripts/t: Improve coverage of unit testsGuillem Jover7-16/+137
2018-08-30Dpkg::Substvars: Reword used/unused warnings to clarify their meaningGuillem Jover1-2/+2
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-4/+4
Thanks-to: Niels Thykier <niels@thykier.net> (for typo in dpkg(1))
2018-08-01dselect: Use override attribute for virtual methods in derived classesGuillem Jover1-1/+1
C++11 makes it possible to use these attributes so that errors can be avoided, by helping the compiler know when we mean methods to override the ones from the parent class. Warned-by: cppcheck
2018-07-30scripts/t: Improve Dpkg::Deps test casesGuillem Jover1-5/+37
Add new TODO tests for behavior that is not yet implemented, but should.
2018-07-30Dpkg::Deps: Clarify arch-qualified dependency simplificationGuillem Jover1-1/+21
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-05-04Dpkg::Version: Fix bool overload behaviorGuillem Jover1-9/+8
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-04scripts: Refresh test data and update code to matchGuillem Jover7-664/+911
2018-05-04Dpkg::Shlibs::Objdump: Fix ELF program detectionGuillem Jover1-2/+4
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.
2018-01-16arch: Add support for riscv64 CPUManuel A. Fernandez Montecelo1-2/+2
[guillem@debian.org: - Update unit-tests. ] Closes: #822914 Stable-Candidate: 1.18.x Signed-off-by: Guillem Jover <guillem@debian.org>
2018-01-16scripts: Reject negated values in Architecture fieldGuillem Jover1-1/+8
Add new positive options argument to arch validators, as the Architecture field should not accept negated architectures. We preserve the current functions default behavior and add a new option to control whether to reject negated architectures. Fixes: commit d355b340f3a6cde7fc1cb5649d82fbebd3b97ea1 Stable-Candidate: 1.18.x
2018-01-16scripts/mk: Add new buildtools variablesGuillem Jover2-0/+21
This adds support for AS, STRIP, OBJCOPY, OBJDUMP, NM, AR and RANLIB. Prompted-by: Helmut Grohne <helmut@subdivi.de>
2018-01-16test: Infer automatically the unit test temp directoryGuillem Jover6-16/+10
Add new test_get_temp_path() function, and replace all hardcoded settings of the temporary directory and its creation.
2018-01-16test: Infer automatically the unit test data directoryGuillem Jover13-13/+15
We can easily know the name of the calling unit test, and can thus infer the pathname for the data directory, instead of having to duplicate the name, and potentially ending with it being out of sync.
2017-10-17scripts/t: Skip Dpkg::OpenPGP test if gpg is not presentGuillem Jover1-5/+7
2017-10-17Dpkg::Getopt: Do not normalize args past a passthrough stop wordGuillem Jover1-3/+8
Some commands pass some arguments through to another command, and those must not be normalized as that might break their invocation. Reported-by: Helmut Grohne <helmut@subdivi.de> Stable-Candidate: 1.17.x 1.18.x
2017-10-17Dpkg::Source::Package: Auto-convert binary signatures to OpenPGP ASCII ArmorGuillem Jover4-0/+72
When we are building a source package, if we find a binary signature in the form of a .sig file, we should try to auto-convert it to the format that we expect to include in the source package, which is an OpenPGP ASCII Armor.
2017-10-16scripts/mk: Add new buildtools.mk supportGuillem Jover2-1/+48
This make fragment contains setup for build tool variables for both TOOL and TOOL_FOR_BUILD. It does not get included by default from default.mk
2017-10-12scripts: Rename debarch_to_cpuattrs() to debarch_to_abiattrs()Guillem Jover1-3/+3
2017-10-12scripts: Add support for source package Description and substvarsGuillem Jover1-6/+7
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-3/+3
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-24scripts/t: Switch from IO::String to native open supportGuillem Jover2-17/+19
We can also remove the versioned dpkg-dev Build-Depends now that we do not use any build profile anymore.
2017-09-24scripts/t: Add new unit test for Dpkg::Control::FieldsGuillem Jover1-0/+247
2017-09-24Dpkg::File: Move file_lock() into a new Dpkg::Lock moduleGuillem Jover1-0/+27
This reduces the load chain for several Dpkg modules.
2017-09-24scripts/t: Avoid many function arguments in check_options()Guillem Jover1-97/+137
Fixes: Subroutines::ProhibitManyArgs Warned-by: perlcritic
2017-08-26perl: Use -> operator for function variablesGuillem Jover1-2/+2
2017-05-20Dpkg::Util: Remove and replace with core module List::UtilGuillem Jover1-38/+0
Our current minimal Perl version contains a new enough List::Util module implementing none and any, and several other functions.
2017-05-17Dpkg::Source::Patch: Indented patch test-caseGuillem Jover2-1/+14
POSIX specifies that a diff hunk can be indented by spaces or tabs (while the original patch(1) by Larry Wall also accepts 'X'), as long as the amount of spaces is consistent for all subsequent lines. And as we are not checking for this condition at all, any such indented hunk can avoid the sanity checks performed by Dpkg::Source::Patch. On systems using GNU patch >= 2.7.5, this should, in principle, not be a problem anymore, as that implementation protects against directory traversal issue. But on other systems where the patch implementation does not perform such checks (such as the BSDs) this is an issue, so check for this in the test-suite. Those are arguably all security issues in these various patch implementations, but given that we are performing sanity checks and that those implementations are currently very lax, it seems prudent to do the heavy lifting ourselves and also take the possible blame too. Ref: CVE-2017-8283 Stable-Candidate: 1.17.x
2017-05-07arch: Add support for ARM64 ILP32Guillem Jover1-2/+2
Closes: #824742 Based-on-patch-by: Wookey <wookey@wookware.org>
2017-05-06doc: Spelling fixesJosh Soref9-25/+25
Signed-off-by: Guillem Jover <guillem@debian.org>
2017-02-26test: Use the detected perl interpreter instead of a random one from PATHGuillem Jover4-5/+6
We check for a specific version of perl and store that in the PERL variable. But the shebangs on several test scripts hardcode a specific perl that might not be present or might not be recent enough. Always invoke perl scripts explicitly with PERL, or implicitly by letting the currently running interpreter use itself.
2017-01-29Revert "dpkg-source: Generate Testsuite-Restrictions fields from test ↵Guillem Jover2-32/+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-27dpkg-buildpackage: Add support for signed .buildinfo filesGuillem Jover1-0/+1
Add new options -ui and --unsigned-buildinfo. Closes: #843925