summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* 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>
* pmtest: allow tests to specify test binaryAndrew Gregory2014-10-13
| | | | | | | | | | | Adds a cmd property to tests (defaults to pacman) which is resolved using directories specified with --bindir (defaults to PATH). The ability to manually specify a particular binary is preserved in order to allow running individual tests with differently named binaries such as lt-pacman. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman: add --confirm optionAndrew Gregory2014-10-13
| | | | | | | | | --confirm cancels the effect of a previous --noconfirm. This makes it easier for scripts to default to --noconfirm but allow users to override it. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmtest: allow tests to specify db versionAndrew Gregory2014-10-13
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmrule: make backup file test more robustAndrew Gregory2014-10-13
| | | | | | | | | This prevents an exception in the event backup entries are not in the correct format and brings the test in line with alpm's backup parsing which splits on the last tab rather than the first. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pmdb: include directories in package file listsAndrew Gregory2014-10-13
| | | | | | | Needed for checking directories with PKG_FILES. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Add --assume-installed optionFlorian Pritz2014-09-30
| | | | | | This allows to ignore specific dependencies. Signed-off-by: Florian Pritz <bluewind@xinu.at>
* Check the version of the local database during validationAllan McRae2014-09-23
| | | | | | | When we check the database version directly, there is no longer a need to scan for depends files. Signed-off-by: Allan McRae <allan@archlinux.org>
* Add version file to empty local databaseAllan McRae2014-09-23
| | | | | | | If a user manually creates the local database directory, or has an empty local database for some other reason, we silently add a version file Signed-off-by: Allan McRae <allan@archlinux.org>