summaryrefslogtreecommitdiff
path: root/scripts/t
AgeCommit message (Collapse)AuthorFilesLines
2010-01-12Dpkg::Shlibs::*: style adjustments.Modestas Vainius1-3/+2
Use "my ($foo, $bar) = @_" rather than multiple shift()s. Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2010-01-11scripts/t/200_Dpkg_Shlibs.t: extend test suite to cover symbol patterns ↵Raphaël Hertzog4-2/+291
functionality Signed-off-by: Modestas Vainius <modax@debian.org> Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2010-01-11scripts/t/200_Dpkg_Shlibs.t: cleanup and fix non-regression testModestas Vainius5-79/+85
* Rename previous tag tests to 'basictags'. Change the name everywhere and use it consistenly throughout the testsuite. No new tests added. * Fix 'wildcard symbol' test. It started failing due to changes in the symbol data structure. * Add a sub for save_load test. Signed-off-by: Modestas Vainius <modax@debian.org> Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2010-01-11Dpkg::Shlibs::Symbol::clone(): replaced by dclone() and sclone().Modestas Vainius1-1/+11
dclone() - deep cloning of the symbol. sclone() - shallow copying of the symbol. Signed-off-by: Modestas Vainius <modax@debian.org> Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2010-01-11Dpkg::Shlibs::Cppfilt: new interface to the c++filt utility.Modestas Vainius1-0/+89
This new module can be used to do symbol demangling with the c++filt utility. For performance reasons, the c++filt program is run in the background and used as a daemon: for each line written it immediately outputs the demangled line. The module also takes care of the c++filt process management (forking and termination). Signed-off-by: Modestas Vainius <modax@debian.org> Signed-off-by: Raphaël Hertzog <hertzog@debian.org>
2010-01-08Merge branch 'sid'Raphaël Hertzog1-8/+9
2010-01-08Dpkg::BuildOptions: change API so that an empty value can be properly supportedRaphaël Hertzog1-8/+9
No value results in a hash item with undef value while an empty value results in a hash ite with an empty value. Update the non-regression tests accordingly. Also update dpkg-buildpackage that was using defined instead of exists to test the existence of an option.
2009-12-02scripts/t/200_Dpkg_Shlibs.t: fix path of ld.so.conf file to loadRaphaël Hertzog1-1/+1
2009-12-02Dpkg::Deps: cleanup APIRaphaël Hertzog1-14/+14
Rename public functions with deps_ prefix. Export them by default. Update all scripts using Dpkg::Deps accordingly, including the test-suite.
2009-12-02Dpkg::Deps: replace dump() method with output([$fh])Raphaël Hertzog1-10/+11
Update test suite accordingly as well as all scripts using Dpkg::Deps. Also use overload to provide a string representation corresponding to what's returned by output().
2009-11-29Merge sid branch through commit '1.15.5.3'Raphaël Hertzog1-1/+1
Conflicts: man/po/de.po man/po/sv.po scripts/dpkg-scanpackages.pl scripts/po/de.po scripts/po/sv.po
2009-11-22Dpkg::Control::Hash: Strip leading spaces in the first line of a field's valueGuillem Jover1-1/+1
The fields in a compliant control-style file are allowed to have values starting with any number of spaces. But that only applies to the first line on multi-line field values, so do not do the same on subsequent lines as those are handled differently. Regression introduced in commit 7d8d193332478de82e20ed5b49053378801d160f. Closes: #557547
2009-11-20build: Do not ship objdump.tags-<arch> files in the repoGuillem Jover3-147/+5
This was causing diff problems as the file was changing depending on the build system. Now it should be stable as it's always generated at check time.
2009-11-20Namespace temporary directories for test casesGuillem Jover2-2/+3
We avoid any name clashes during the test suite run. And the hierarchy gets more clear when debugging in case any problem arises.
2009-11-20Refactor temporary test cases path to a tmpdir variableGuillem Jover2-33/+36
This allows to change it in a single place.
2009-11-20build: Do not copy 200_Dpkg_Shlibs data files to t.tmpGuillem Jover4-4/+11
The copy was done to make the relative paths inside the ld.so.conf fragments work even in out of tree builds. We now switch the current directory to $srcdir in 200_Dpkg_Shlibs.t when loading the fragments and then go back.
2009-11-20Use new datadir variable instead of redefining srcdirGuillem Jover4-38/+38
2009-11-18Dpkg::Version: accept invalid versions by defaultRaphaël Hertzog1-3/+16
Accepting invalid version is the right default behaviour because you often have to mix empty strings and versions and it's nice to not have to special case too much. In particular, we should be able to do "$vobj eq ''" without encountering an error. Ensure this behaviour is kept by adding proper non-regression tests. Also enable fallback behaviour for all operators which have not been explicitely implemented. The boolean operator returns true if the version is valid, false otherwise. Update the rest of the code that was doing "Dpkg::Version->new($v) || $v" precisely to be able to store a version even if it's invalid.
2009-11-17scripts: Update objdump.tags filesGuillem Jover2-63/+67
2009-11-08Add missing license headersGuillem Jover11-0/+143
2009-11-06Dpkg::Control::Hash: handle arbitrary field valuesRaphaël Hertzog2-11/+21
Checking the validity of new field values at run-time was very expensive. In order to avoid this check, the design of the object has been changed to accept arbitrary values, they are simply escaped as necessary during output. The only data lost in a save()/load() cycle are the trailing whitespaces on every line of all values. This API change implies fixes in all scripts/modules reading/creating values for multiline fields. The non-regression test also had to be adjusted.
2009-10-31Add supplementary non-regression tests for Dpkg::Changelog related modulesRaphaël Hertzog2-26/+95
2009-10-31Dpkg::Changelog: completely update the APIRaphaël Hertzog1-37/+16
The previous API was too different from the other modules inside dpkg-dev. Dpkg::Changelog now behaves as an array of Dpkg::Changelog::Entry and the documentation explains how it can be derived to create a new changelog parser. The non-regression tests as well as the official Debian changelog parser script had to be updated to cope with the new API.
2009-10-31Update Dpkg::Changelog to use new ::Entry modulesRaphaël Hertzog1-4/+4
Drop the Dpkg::Changelog::Entry embedded in Dpkg::Changelog. Update Dpkg::Changelog and Dpkg::Changelog::Debian to use the new modules. Some (undocumented) features have been removed with this rewrite. The entries are not parsed item by item anymore. The Urgency field will no longer receive the comment that can follow the urgency. The content of “Closes” is exported by Dpkg::Changelog::Entry::Debian as an optional field. The test-suite also had to be updated to cope with the API changes and the fact that bugs are no longer duplicated in the “Closes” field.
2009-10-14Do not use C++ style comments in C codeGuillem Jover1-5/+9
2009-10-05Dpkg::Version: rename some functions and constantsRaphaël Hertzog1-3/+3
version_compare_op() becomes version_compare_relation(). version_normalize_cmp_op() becomes version_normalize_relation(). The CMP_OP_* constants become REL_*. Update all scripts and modules accordingly.
2009-10-04Ensure that the string representation of Dpkg::Version is unchangedRaphaël Hertzog1-1/+4
The version string used at creation time should be returned when you stringify a Dpkg::Version object. Ensure this by adding a non-regression test.
2009-10-04Dpkg::Version: drop the old API and implementationRaphaël Hertzog1-4/+5
Switch the non-regression tests to the new API.
2009-10-04Dpkg::Version: new implementation and new object interfaceRaphaël Hertzog1-1/+25
The old implementation is still around in this commit so that it's easy to checkout this commit and add supplementary test cases in scripts/t/100_Dpkg_Version.t to verify that both implementations have the same result. Some new test cases have been added during the implementation. The new object interface overrides all the comparison operators so that you can directly compare two Dpkg::Version objects. The object can also be used within strings and it will generate the same version string than the one given at creation time.
2009-09-19Use the new Dpkg::Control interface everywhereRaphaël Hertzog1-1/+1
Update all scripts and module to use Dpkg::Control instead of parsecdata and Dpkg::Fields::Object.
2009-09-16Rename Dpkg::Control in Dpkg::Control::InfoRaphaël Hertzog1-2/+2
Update all scripts and modules to use the new module names.
2009-07-21Dpkg::Changelog: fix heuristic to identify correct start entryRaphael Hertzog1-1/+6
The heuristic to identify the version number that is most approaching was not working properly for the case where the version number was smaller than the oldest version (for example "0"). Add a non-regression test for this case. Also add supplementary warnings message so that people notice when the parameters are discarded.
2009-07-15Add new test case for symbols file parsingRaphael Hertzog3-1/+14
Ensure that an #include can change the name of the currently parsed library (ELF object).
2009-07-08Fix wildcard support in symbol filesModestas Vainius1-1/+12
They were broken due to typo. Also add a test for wildcards. Signed-off-by: Modestas Vainius <modestas@vainius.eu>
2009-06-25Dpkg::Deps: fix dependency parsing codeRaphael Hertzog1-1/+6
Fix dependency parsing code in Dpkg::Deps to not accept "foo\nbar" even if foo is valid. A regex was improperly matching "\n" as end of string due to usage of the "m" modifier. Also improve the warning displayed when the dependency can't be parsed. Add a non-regression test to ensure that this problem doesn't come back. Reported-by: Andrew Sayers <andrew-dpkg@pileofstuff.org>
2009-06-20Dpkg::Substvars: restructure to have a separate namespace for variablesRaphael Hertzog1-1/+1
The addition of “_used” in the structure was in conflict with a possible variable of the same name. So put the variables in a dedicated hash to avoid this conflict and rename “_used” into “used”. Correct the warning message too. Also add Joachim in the THANKS file for his contribution.
2009-06-20Dpkg::Substvars: track unused substitutions and add warning functionJoachim Breitner1-1/+17
This commit adds tracking of used variables in Dpkg::Substvars. It adds two new methods, no_warn() to disable warnings about one of the variables, warn_about_unused() to issue warnings (via Dpkg::ErrorHandling::warning()). The test suite is extended accordingly.
2009-06-20Dpkg::Substvars: add non-regression test suiteJoachim Breitner2-0/+83
2009-06-20Symbol tagging support and implementation of optional and arch tagsModestas Vainius6-21/+355
Symbols might be tagged with arbitary number of tags which are separated by '|' (aka pipe) character. Tags (only if there are any) must be enclosed in the () brackets right before a symbol name. Each tag can appear only once in the tag specification for each symbol. A tag can optionally have a value. The tag value is separated from the tag name by character '='. Tag names and values can be arbitrary strings except they cannot contain any of the special ()|= characters. A name of the tagged symbol can optionally be quoted with either ' or " characters (e.g. to allow whitespaces in the symbol name). If there are no tags specified, symbol name cannot be quoted and symbol name continues up until the first whitespace. Example of the quoted symbol with 2 tags (the first tag has a value while the second does not): (tag1=value of the first tag|tag2)"Foo::Bar::foobar()"@Base 1.0 1 Tags serve two purposes: * they can be used for symbol marking (e.g. when a symbol must be treated specially under certain circumstances); * they tell the parser that the specified symbol name must be processed in certain way to become a raw symbol name as found in the object files. Such tags are processed in the order they are specified. Symbol files with tags are not backwards compatible, so a new parameter 'template_mode' has been added to SymbolFile::dump(). If template_mode is not set (default), dump() emits a fully post-processed symbol specifications as directed by their tags. Tags themselves are ommited from output and unknown tags are ignored. If template_mode is set, dump() keeps tags in the output and emits symbol specifications as they were read from the symbol file. As a result, a new parameter -t was added to dpkg-gensymbols to support writing the symbol file in template mode. Default is to write in non-template mode. (tag|...|tagN)#include "file_to_include" All symbols in the "file_to_include" will be tagged with #include tags by default. A symbol in "file_to_include" can specify additional tags in its tag specification or even override the tag value inherited from #include tags by specifying another one in its own tag specifaction. There is no way for the symbol to untag itself, even if the tag was inherited from #include. #include tags are assumed to go always before (in tagorder) symbol specific tags even if the symbol overrides the tag. Recursive tagged #includes are supported. The patch also adds support for 2 tags: * optional - a symbol marked as optional can disappear from the object file at any time and that will never cause dpkg-gensymbols to fail (just emit the diff). If optional symbol disappears, it is dumped as MISSING with deprecated string set to the current package version (hence it always appears in the dpkg-gensymbols diff). If optional symbol reappears, it gets undeprecated but its minver is kept unchanged (contrary to reappearing MISSING symbols). Example: C++ template instantiation which disappearance is not ABI breaking (i.e. basically it is a private symbol). (optional)_ZN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE0EE11qt_metacastEPKc@Base 4:4.2.0 * arch=<list of architectures as in Build-Depend dep> - allows to mark a symbol as arch-specific. When dumping in non-templace mode, only symbols concerned for the current host architecture are dumped. When dumping in template mode, all arch-specific symbols are always dumped (including proper tags). If arch-specific symbol appears on the arch that it is not supposed to appear, it is made arch neutral (hence it appears in the dpkg-gensymbols diff). If arch-specific symbol disappears from its arch, it gets declared as MISSING. Example: armel specific symbol due to qreal mangling as float on arm(el) and double on other arches. (arch=arm armel)_ZN6Phonon11AudioOutput13volumeChangedEd@Base 4:4.2.0 (arch=!armel !arm)_ZN6Phonon11AudioOutput13volumeChangedEf@Base 4:4.2.0
2009-06-15Dpkg::ErrorHandling: Add new report_options()Guillem Jover2-4/+5
Set report options via this new function instead of directly exporting private variables.
2009-05-04update-alternatives: don't remove real files conflicting with linkRaphael Hertzog1-1/+4
When an alternative is installed and a real file is in conflict, the real file is kept. When the same alternative is fully removed, the real file should be kept according to the same logic (but currently it was removed). This commit modifies update-alternatives to follow this expected behaviour. Also add a non-regression test.
2009-03-17dpkg-shlibdeps: fix code to find out minimal version among all symbolsRaphael Hertzog3-5/+11
dpkg-shlibdeps did not always correctly initialize symbol-based dependencies for libraries having symbols associated with a version "0". “$minver ||= $sym->{minver};” changed $minver to the first non-null version that followed a null version. Because the null version is evidently selected as the minimal version but that code considers it unset and replaces it with whatever it has. Add a non-regression test for this part of the code.
2009-03-16Dpkg::IPC: add sanity check for timeout parameter and a non-regression testRaphael Hertzog1-2/+10
2009-03-02u-a: Fix test suite to use t.tmp from builddir instead of srcdirGuillem Jover1-4/+4
This fixes “make distcheck”, as t.tmp is a read/write directory it has to be used under builddir, which in most cases happens to be the same as srcdir.
2009-02-27dpkg-gensymbols: replace #PACKAGE# in dependency templatesRaphael Hertzog2-2/+2
To better support packages of libraries that have different names between architectures, offer the possibility to not hardcode the package name in the symbols file by using #PACKAGE#. This marker is then substituted by dpkg-gensymbols when the symbols files are installed inside the binary package.
2009-02-27update-alternatives: add some consistency in the outputRaphael Hertzog1-2/+3
Make sure that all messages that are likely to appear in the output as part of --install and --remove call are identified as coming from update-alternatives. Factorize the logic of output and verbosity in some standard function (info, warning, verbose).
2009-02-22update-alternatives: add --log optionRaphael Hertzog1-2/+2
This option overrides the default log file /var/log/dpkg.log. It is needed to make the update-alternatives test-suite succeed when run with fakeroot because without override the test-suite would try to write to /var/log/dpkg.log and fail. Hence adjust the test-suite accordingly.
2009-02-22update-alternatives: don't replace real files by alternative links without ↵Raphael Hertzog1-7/+17
--force update-alternatives should not replace real files by symlinks. When --install is called, the alternative link should either not exist or already be a link. It that's not the case, it will simply skip installing that link and display a warning. However if --force is given, it will (try to) replace the file. Ensure that behaviour within the test suite.
2009-02-22update-alternatives: new option --set-selectionsRaphael Hertzog1-3/+12
The option --set-selections is the counterpart of --get-selections, it reads configuration on standard input and reconfigures alternatives accordingly.
2009-02-22update-alternatives: skip slave link if associated file doesn't existRaphael Hertzog1-6/+35
All slave links are optional in the sense that they are only installed if the currently associated file does exist. This allows most update-alternatives call to succeed even if the admin removed documentation files or other optional files. Closes: #143701 A message is still displayed by default in this case to warn the user that something uncommon has been detected. Adjusted the test suite to verify this behaviour.