summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* extract db files with dbonlyAndrew Gregory2017-01-04
| | | | | | | | | | | Some database files (install, mtree, and changelog) are extracted directly from the package, but DBONLY was skipping extraction altogether, causing those files to be missing after the transaction. Fixes #52052 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright yearsAllan McRae2017-01-04
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Remove pacsortAllan McRae2016-12-05
| | | | | | Moved to the pacman-contrib project Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: Move parseopts from library to libmakepkgAlad Wenter2016-10-22
| | | | | | | | | | | | | | | parseopts is used in makepkg and other scripts such as pacman-key as a getopt replacement. Instead of including it in those scripts via a macro, move it to libmakepkg/util/parseopts.sh and have scripts source this file where appropriate. To keep the parseopts test, a new variable was introduced: PM_LIBMAKEPKG_DIR Signed-off-by: Alad Wenter <alad@archlinux.info> Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix memory leak in remove_notify_needed_optdependsAllan McRae2016-09-03
| | | | | | | Also add pactest which captures this leak when run under valgrind. Reported-by: Sergey Petrenko Signed-off-by: Allan McRae <allan@archlinux.org>
* recursedeps: include cyclic dependenciesAndrew Gregory2016-08-30
| | | | | | | | | | | | | | Cyclic dependencies (A depends on B, B depends on A) were not selected because neither package could be removed individually, so can_remove_package would always return false for both. By preselecting all dependencies then filtering back out any dependencies still required by any packages that will not be uninstalled, groups of unneeded cyclic dependencies can be found. Fixes FS#41031 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Print replacements when using -SupAllan McRae2016-05-05
| | | | | | | | | When printing a list of URLs of packages to be updated, pacman was ignoring any replacements that would be made in the update process. Fixes FS#35812 Signed-off-by: Allan McRae <allan@archlinux.org>
* do not rely on localdb for hook matchingAndrew Gregory2016-02-23
| | | | | | | | | | | | Relying on localdb to determine which trigger operations should match is completely broken for PostTransaction hooks because the localdb has already been updated. Store a copy of the old version of any packages being updated to use instead. Fixes FS#47996 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* only remove pacnew file if it is newAndrew Gregory2016-02-21
| | | | | | | | | | | Check if we overwrote an exiting pacnew file before unlinking it. Otherwise, updating to a version with an unchanged file would delete existing pacnew files. FS#47993 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* test version range restrictions corner caseDominik Fischer2016-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test introduced herein illustrates a behavior that may be unexpected to package writers. It creates a package "pkg3" that is configured to depend on a "dependency" which version is between 3 and 4, inclusive. Two other packages are already present, providing "dependency" in version 2 and 5, respectively. So, the situation looks roughly like this: pkg1 pkg3 pkg2 provides depends on provides | <------------> | version __________2____________3____________4____________5___________... This seems to be enough to satisfy pacman when installing "pkg3". From an iterative standpoint, this is completely logical: First, the requirement "dependency>=3" is checked. There is a package that satisfies this restriction, it is called "pkg2". Afterwards, "dependency<=4" is covered in the same way by "pkg1". Nonetheless, what a package writer intends when specifying depends=('dependency>=3' 'dependency<=4') is most probably that pacman should only allow this package to be installed when there indeed is a package present that provides a version of "dependency" that lies _between_ 3 and 5. Signed-off-by: Dominik Fischer <d dot f dot fischer at web dot de> Signed-off-by: Allan McRae <allan@archlinux.org>
* Add pacsort tests with invalid inputRikard Falkeborn2016-01-04
| | | | | Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright years for 2016Allan McRae2016-01-04
| | | | | | make update-copyright OLD=2015 NEW=2016 Signed-off-by: Allan McRae <allan@archlinux.org>
* skip conflicts resolved by file replacementAndrew Gregory2015-12-05
| | | | | | | | | | | When replacing a file with a directory, any files inside the new directory cannot possibly exist on the filesystem and can be skipped. This allows cross-package symlink-to-directory transitions when there are files with the same name under both the symlinked directory and the new directory. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Detect potential conflict when symlink to directory is changing to directoryAllan McRae2015-12-05
| | | | | | | | | When a symlink to a directory is changing to a directory, any package file inside the new directory can create an unexpected conflict with the filesystem. Reported by Neofytos and Luca from Chakra. Signed-off-by: Allan McRae <allan@archlinux.org>
* hooks: pass matched targets to hooksAndrew Gregory2015-11-28
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* allow arguments in hook Exec fieldsAndrew Gregory2015-11-28
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* tap.py: replace newlines with escape sequenceAndrew Gregory2015-11-28
| | | | | | | Newlines clutter tap output and can potentially confuse TAP parsers. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmrule.py: add FILE_CONTENTS ruleAndrew Gregory2015-11-28
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* add hook testsAndrew Gregory2015-10-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: add hook/script supportAndrew Gregory2015-10-18
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* util.py: return the created pathAndrew Gregory2015-10-18
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pactest: use pacman --hookdir optionAndrew Gregory2015-10-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* sortbydeps: skip local packages being updatedAndrew Gregory2015-09-19
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg-template: support multiple --template-dirsDominik Fischer2015-05-12
| | | | | | | | | | | | | | | | | | | | | | Especially when maintaining local templates in addition to the ones stored in /usr/share/makepkg-template, it can be useful to include templates stored in multiple different locations into one PKGBUILD. This patch makes this possible by allowing --template-dir to be specified multiple times. This also introduces a dedicated error message when a template cannot be found, in contrast to the already existing "Couldn't detect version for template '%s'". If a template of the same name is present in more than one of the given directories, the last one always takes precedence. Neither the default behaviour without the option given, nor the handling of a single template dir is changed. Signed-off-by: Dominik Fischer <d.f.fischer@web.de> Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* remove: use strcmp for files in skip_removeAndrew Gregory2015-03-03
| | | | | | | | | Paths from noupgrade, the transaction skip_remove, and package backup lists were combined into a single list matched using fnmatch causing paths with glob characters to match unrelated files. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Merge branch 'maint'Allan McRae2015-02-12
|\
| * sync200.py.in: remove unused substitutionAndrew Gregory2015-02-12
| | | | | | | | | | | | | | | | | | | | LIBCURL was never set in the Makefile so XferCommand was always being set in the test file. This removes the only substitution in our test files which will prevent the TESTS file from being rebuilt every time configure is run. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | Update copyright notices for 2015Allan McRae2015-02-01
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | pmenv.py: Fix typo in copyright assignmentAllan McRae2015-02-01
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | remove support for .pacorig filesAndrew Gregory2015-01-21
| | | | | | | | | | | | | | | | Leave user files in place and save new config files with a .pacnew extension. This reduces the complexity of file extraction and respects the principle that pacman shouldn't modify files it didn't create. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
* | test makepkg-template: Add update-version-with-newest-optionFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add template-without-versionFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add name-charset-validFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add name-charset-invalidFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add missing-template-symlinkFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add missing-template-fileFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add keep-old-versionFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add invalid-template-line-unknown-markerFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add invalid-template-line-missing-nameFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | test makepkg-template: Add invalid-keyFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | Add testrunner for makepkg-templateFlorian Pritz2015-01-11
| | | | | | | | Signed-off-by: Florian Pritz <bluewind@xinu.at>
* | add tap_ prefix to test helper functionsAndrew Gregory2014-12-28
| | | | | | | | | | | | | | | | Allows tap.sh to show the line number where the helper function was called on failures. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | use tap.sh for bash testsAndrew Gregory2014-12-28
| | | | | | | | | | | | | | | | tap.sh is a reusable TAP library that handles test counting and provides useful diagnostic messages on test failures. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* | add vim modeline to test filesAndrew Gregory2014-12-24
|/ | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* remove.c: honor inverted patterns in noupgradeAndrew Gregory2014-12-18
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacsort: parse inputs up front into control structDave Reisner2014-11-20
| | | | | | | | | | | | | | | | | | | | | | This moves most of the parsing work out of the sorting path. The explode and splitfile functions now call input_new and append input_t structs to the list of sort candidates instead of raw strings. This lets us make smarter and easier decisions in the sorting callbacks, which are now also split into the version and file comparison methods for clarity. This fixes two bugs: 1) Incorrect ordering with filenames containing epoch in the pkgver 2) Incorrect ordering with package names which are substrings of each other (e.g. "systemd" and "systemd-sysvcompat"). Performance of the --files mode degrades slightly as a result of this change, but not unreasonably. Sorting with small inputs (5-10) doubles in runtime, but larger inputs (4000+) only increase by 20%. ref: https://bugs.archlinux.org/task/37631 Signed-off-by: Allan McRae <allan@archlinux.org>
* add pacman-db-upgrade-v9.py to check_SCRIPTSAndrew Gregory2014-11-04
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* tests/pacman-db-upgrade-v9: set additional pathsAndrew Gregory2014-11-04
| | | | | | | | | | | --config does not respect root, causing pacman-db-upgrade to read the local pacman.conf rather than the one in the test root. Also add a rule to ensure the ALPM_DB_VERSION file is actually being created. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmtest: make test paths easily available to testsAndrew Gregory2014-11-04
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* add pacman-db-upgrade testAndrew Gregory2014-10-13
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>