summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Use Python's "range" instead of deprecated "xrange".Jeremy Heiner2013-10-14
| | | | | | | | | | | | | Reported by 2to3. Python 3 throws out the old range, renames the old xrange to be the new range, leaving no xrange. A shim could be used, but using the less efficient version does not have a noticeable impact on the run time. This observed (lack of an) effect is as described in the Python 2 docs for xrange. The largest range created is only 1000 elements big, and the memory cost of those ranges is negligible when compared to that of all the pmpkg instances created. Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Use dict iteration methods common to both Python 2 and 3.Jeremy Heiner2013-10-14
| | | | | | | | | | | | | | | The .items, .keys, and .values methods in Python 2 make copies, so the test framework uses the .iter* flavors of those methods. But in Python 3 those .iter* (and even the 2.7 .view*) flavors are removed and the original methods return views. Measurements were taken under Python2 to see what impact the copying had, and there was none. Thus it is not worth the effort to avoid. Reported as a compatibility issue by 2to3. Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Use Python's "0o#" octal literal instead of deprecated "0#".Jeremy Heiner2013-10-14
| | | | | | | Reported as a compatibility issue by 2to3. Signed-off-by: Jeremy Heiner <ScalaProtractor@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Use "exec" instead of "execfile" (deprecated in Python 3).Jeremy Heiner2013-10-14
| | | | | | | This was the only compatibility issue reported by "python2 -3". Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Bail early with a clear error message if Python runtime isn't 2.7+.Jeremy Heiner2013-10-14
| | | | | | | | | | | | | | Prior to this a test that used a feature too new for the runtime would blow up when it was "exec"d (possibly in the middle of a run of a bunch of tests) with an error message that was not very helpful. Remove Python 2.5 and 2.6 runtimes from the list configure searches. 2.5 suffers the problem described above. The code currently will run on 2.6 but, as was noted on the dev list, that runtime is at the end of its life, so 2.7 is a better cutoff. Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* include invalid options in error messagesAndrew Gregory2013-10-14
| | | | | | | | On invalid combinations of flags we were only printing the unhelpfully vague message "invalid option". Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman: die on invalid option combinationsAndrew Gregory2013-10-14
| | | | | | | Fixes FS#20950 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* rename PKG_LOCALITY_LOCAL -> PKG_LOCALITY_NATIVEAndrew Gregory2013-10-14
| | | | | | | | | PKG_LOCALITY_LOCAL was confusing because the enum is used with -Q, so all packages are "local". Also reversed the config->op_q_locality assignment so that the locality matches the option used. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* do not run scriptlets with --dbonlyAndrew Gregory2013-10-14
| | | | | | | | Running an install script does not fall under "Adds/removes the database entry only." Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* imply --print from --print-formatAndrew Gregory2013-10-14
| | | | | | | | | --print-format is totally useless without --print. Implying --print will also save us the hassle of checking it when we add transaction option validation. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* use non-ascii identifiers for optflagsAndrew Gregory2013-10-14
| | | | | | | | | | | | | | | | | Removes the overlap between optflags for different operations that allowed non-sensical combinations of flags such as: $ pacman -Si --changelog $package --changelog is -c, meaning --clean for -S $ pacman -Q --sysupgrade --sysupgrade is -u, meaning --upgrades for -Q Also add a few missing braces. Original-work-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman/util: remove strsplitAndrew Gregory2013-10-14
| | | | | | | strsplit was used in only one place and did the same thing as strtok. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* submitting-patches: address common mistakesAndrew Gregory2013-10-14
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* remove executable bit on paclog-pkglist.sh.inAndrew Gregory2013-10-14
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Makefile.am: remove old targets from .PHONYAndrew Gregory2013-10-14
| | | | | | | These targets were part of the old test suite and no longer exist. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Jettison the truncation of the display of pmrules.Jeremy Heiner2013-10-14
| | | | | | | | | | The truncation helped back when the test output appeared when run via make. But now "make check" logs that output, and it makes little sense to log the truncated rules. Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: add LIBRARY variableAllan McRae2013-10-14
| | | | | | | | | This points makepkg to where is library is located. Can be overridden by value in the environment. Signed-off-by: Allan McRae <allan@archlinux.org> [Ashley: Rebased] Signed-off-by: Ashley Whetter <ashley@awhetter.co.uk>
* makepkg: run locally with libtool style wrapperAllan McRae2013-10-14
| | | | | | | | | | Build makepkg to scripts/.lib/makepkg and add a wrapper script to call it. This is not useful at the moment, but is the first step to allowing makepkg to be split into smaller pieces. Signed-off-by: Allan McRae <allan@archlinux.org> [Ashley: rebased] Signed-off-by: Ashley Whetter <ashley@awhetter.co.uk>
* makepkg: alphabetically order option variablesAllan McRae2013-10-14
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: do not refer to src/ or pkg/Allan McRae2013-10-14
| | | | | | Use $srcdir and $pkgdir instead. Signed-off-by: Allan McRae <allan@archlinux.org>
* Add a -C, --cleanbuild option to clear the source directory before building ↵Lukáš Jirkovský2013-10-14
| | | | | | | | | a package. Implements FS#17175. [Allan: Minor changes to output strings, fix removing of source directory] Signed-off-by: Allan McRae <allan@archlinux.org>
* Link non-vcs sources into $srcdir during extractionAllan McRae2013-10-14
| | | | | | | | | | | | | The separation between downloading and extracting for non-vsc sources was incomplete due to symlinks being made in $srcdir during the download stage. Have download_{local,file} just ensure the presence of the files in $startdir or $SRCDEST (downloading if needed) and then have extract_file symlink these files into $srcdir. Also replace "continue" with "return" in extract_file to make it clearer what is happening. Signed-off-by: Allan McRae <allan@archlinux.org>
* Ignore failure to patch during autogen.shAllan McRae2013-10-14
| | | | | | | patch -N ignores the previously applied patch but still returns 1. This causes a git build with a reused source directory to fail. Signed-off-by: Allan McRae <allan@archlinux.org>
* Remove makepkg license checkAllan McRae2013-10-14
| | | | | | | There is little reason for this field to be checked over all other fields. Signed-off-by: Allan McRae <allan@archlinux.org>
* Use $srcdir/ rather than src/ in makepkg helpAllan McRae2013-10-14
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Clarify --repackage descriptionAllan McRae2013-10-14
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* Add make target for TESTSAndrew Gregory2013-10-14
| | | | | | | | | | | | | This causes make to update TESTS when tests are added (or updated). For simplicity, this changes TESTS from a single multi-line list to individually appending each test file. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> [Allan: use C locale for sorting] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* Display old and new version in pacman -Qu outputFlorian Pritz2013-10-14
| | | | | | | | This changes the output from "foo 1.0" to "foo 1.0 -> 1.1" which makes cronjobs that mail the -Qu output way more helpful. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
* TESTS: add missing testsAndrew Gregory2013-09-19
| | | | | Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix make distcheckAndrew Gregory2013-09-19
| | | | | | | | | * set util binary paths relative to top_builddir * set pactest.py path relative to top_srcdir * include tap.py in check_SCRIPTS Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: redirect downloader output to STDERRXyne2013-09-18
| | | | | | This allows scripts to safely capture the output of "makepkg -g". Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: include all hash types in integlistXyne2013-09-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* bacman: optionally include unmodified backup files when availableXyne2013-09-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* bacman: update copyright information in version functionXyne2013-09-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* bacman: pass unshifted arguments to fakerootXyne2013-09-18
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* dload: avoid renaming files downloaded via sync operationsChristian Hesse2013-09-18
| | | | | | | | | | | | | | | | | | If the server redirects from ${repo}.db to ${repo}.db.tar.gz pacman gets this wrong: It saves to new filename and fails when accessing ${repo}.db. We need the remote filename only when downloading remote files with pacman's -U operation. This introduces a new field 'trust_remote_name' to payload. If set pacman downloads to the filename given by the server. The field trust_remote_name is set in alpm_fetch_pkgurl(). Fixes FS#36791 ([pacman] downloads to wrong filename with redirect). [dave: remove redundant assignment leading to memory leak] Signed-off-by: Allan McRae <allan@archlinux.org>
* contrib: Unify quoting in error messagesAaron Lindsay2013-09-18
| | | | | | | | | | | | | | | This fixes error messages to display the contents of variables rather than the variable name by replacing backticks with single quotes (m4 eats backticks). It also removes $"" localization from error messages to eliminate security holes. For instance, `rankmirrors nonexistent_file' will now display: 'nonexistent_file' does not exist. rather than: $1 does not exist. Signed-off-by: Aaron Lindsay <aaron@aclindsay.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: use c-style for loops for integrity checksDave Reisner2013-09-18
| | | | | | | | | | These loops already maintain an independent loop counter, so cut out the middle man. While this change doesn't necessarily require that we drop support for sparse arrays, we do via this patch. A new lint check is added in check_sanity to abort when a sparse array is encountered. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: always use read's -r flag with filenamesDave Reisner2013-09-18
| | | | | | | | These are all cases where we're reading filenames -- any backslashes are intentional and should not be interpreted. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: inline creation of checksum indentingDave Reisner2013-09-18
| | | | | | | | | With some simple math and printf formatting tokens, we can create the whitespace necessary for this without the need for a loop and string concatentation. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: cleanup a few format string injectionsDave Reisner2013-09-18
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* pactree: set full usage on DBs when registeringDave Reisner2013-09-04
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman: add front end support for repo usage levelDave Reisner2013-09-04
| | | | | | | | | | | Add a "Usage" key to the repo section of the config which allows for the tokens "Search", "Install", "Upgrade", "All", which correspond to values in the alpm_db_usage_t enum. Users can specify "Usage" multiple times for a given repo, or multiple flags per "Usage" line and they will be OR'd together. If unspecified, the default is full usage of the repo. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* libalpm: introduce a usage level for reposDave Reisner2013-09-04
| | | | | | | | | | | | | | | | This defines a level of interest a user has in a repository. These are described by the bitmask flags in the alpm_db_usage_t enum: ALPM_DB_USAGE_SEARCH: repo is valid for searching ALPM_DB_USAGE_INSTALL: repo is valid for installs (e.g. -S pkg) ALPM_DB_USAGE_UPGRADE: repo is valid for sysupgrades ALPM_DB_USAGE_ALL: all of the above are valid Explicitly listing the contents of a repo will always be valid, and the repo will always be refreshed appropriately on sync operations. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* proto: remove redundancy in cd for each functionDave Reisner2013-09-04
| | | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman/util.c: use switch when there are fall through statementsSami Kerola2013-09-04
| | | | | | | | | | | | | | An 'if' clause with empty statement is allowed, but unusual construct. When 'if' is used this way the statement should at least have orphan semicolon ';'. For empty statements 'switch' feels like a native way express what is meant. Signed-off-by: Sami Kerola <kerolasa@iki.fi> [Allan] Keep comment Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* Improve --help switch output for pacman utilsJason St. John2013-09-04
| | | | | | | | | | | | | | | | | | | | | | | | Unify the formatting of the --help switch for pacman utils, if it exists. All of the pacman utils will now output help text using the following format: util-name (pacman) v<pacman version> one line description of util's purpose Usage: util-name [options] -b, --bar whatever --bar does -f, --foo whatever --foo does -h, --help display this help message The --help switch does not exist for a couple of the utils, so the help/usage text for those will be displayed when the util is run with no arguments. Reported-by: Karol Błażewicz <karol.blazewicz at gmail.com> Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: add support for sha224 checksumsDave Reisner2013-09-04
| | | | | | | Implements FS#36776. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: unify list of known hash algorithmsDave Reisner2013-09-04
| | | | | | | | | Unifying this list makes adding new algorithms easier. There's also some menial cleanup in this patch to avoid use of eval and properly treat lists of data as array instead of simple strings. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* libalpm: avoid name space conflictSami Kerola2013-09-04
| | | | | | | | | The symbol 'err' refers to err() from err.h, and is wisest to be avoided as a variable name. Reference: http://man7.org/linux/man-pages/man3/err.3.html Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Allan McRae <allan@archlinux.org>