summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-01-28pacman: Fix delayed warnings/errors sent to stdout not stderrOlivier Brunel1-2/+3
Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-28pacman.c: remove unnecessary optarg checksAndrew Gregory1-11/+0
getopt takes care of making sure that options that require a value have one. These checks were only added to silence clang, which no longer complains about optarg being unchecked, and newer options already use optarg unchecked. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-15sync_prepare: treat from_sync as a booleanAndrew Gregory1-2/+5
We only care that packages are being installed from a repo, not how many. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-15base64.c: comment out unused variableAndrew Gregory1-0/+2
Commit e47eb9a7 commented out base64_encode, which left base64_enc_map unused, causing warnings under clang. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-15package.h: convert scriptlet field to intAndrew Gregory1-1/+1
It's a boolean, so signedness doesn't matter, and the public API already exposes it as an int through alpm_pkg_has_scriptlet(). Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-10Consistently use #ifdefAllan McRae2-4/+4
Fix the occurances of #if to be #ifdef for consistency.
2014-01-10Fix build with --disable-gpgmeAllan McRae2-35/+31
The alpm_decode_signature function was made available for frontends to display signature information, but this required libalpm to be build with gpgme support. As that function did not require anything from gpgme, have it build unconditionally. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-10Fix compile warnings on systems without getmntentDan McGee1-0/+3
Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-10Makefile.am: move test-suite.log into test/Andrew Gregory1-0/+1
Pushing down the testing .gitignore entries in commit e25afaf6 exposed test-suite.log in the root. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-10create_verbose_row: free malloc'd stringsAndrew Gregory1-5/+5
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06check_keyring: plug memory leakAndrew Gregory1-0/+1
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06valgrind.supp: suppress leak in gpgme_get_keyAndrew Gregory1-0/+7
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Reorder and reshape the package struct for better packingDan McGee1-12/+13
This shrinks down the total size of the package struct by a handful of bytes, saving us some memory and cache pressure when we are loading up the entirety of the sync and local databases. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Minor struct member reordering for packing concernsDan McGee4-6/+8
Noticed using clang and `-Wpadded`. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Use O_CLOEXEC as much as possible when opening filesDan McGee4-11/+18
When calling open(), use O_CLOEXEC as much as possible to ensure the file descriptor is closed when and if a process using libalpm forks. For most of these cases, and especially in utility functions, the file descriptor is opened and closed in the same function, so we don't have too much to worry about. However, for things like the log file and database lock file, we should ensure descriptors aren't left hanging around for children to touch. This patch is inspired by the problem in FS#36161, where an open file descriptor to the current working directory prevents chroot() from working on FreeBSD. We don't need this file descriptor in the child process, so open it (and now several others) with O_CLOEXEC. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Log more in search debug messageDan McGee1-1/+2
Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Remove -fgnu89-inline from compile optionsDan McGee3-25/+0
This was a hack done by me in commit d8e88aa0175fd back in 2007 that is no longer necessary, given a sufficiently smart compiler and one that supports the inline keyword. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Push down testing .gitignore entriesDan McGee2-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Clear up definition of INFRQ_ALLDan McGee1-2/+3
Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Update copyright years for 2014Allan McRae100-106/+109
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Copy validation field in _alpm_pkg_dupAllan McRae1-0/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Update comment for local db entry creationAllan McRae1-2/+2
Mention mtree files do not need creation in addtion to install files. Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Add the unit tests for -Qk and -Qkk that are possible now.Jeremy Heiner3-0/+32
The -Qk test (001) validates the existence of the package files (which were installed to the filesystem by the framework because the package was added to the "local" db). The -Qkk test (002) does not validate any file's properties - it can only check that the pacman run produces the expected warning message saying that the package lacks an mtree. Further tests will require modifications to the testing framework to allow intentional damage to the filesystem and generating an mtree. Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> [Allan] Make warning message detection more specific Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06deps.c: remove filtered_depend functionsAndrew Gregory1-22/+10
filtered_dep was duplicating an alpm_depend_t solely for the purpose of overriding its depmod and would effectively cause alpm_checkdeps to ignore ALPM_TRANS_FLAG_NODEPVERSION if the duplication failed. Manually overriding/restoring the depmod for the original depend removes the duplication as a point of failure and fixes a memory leak where the duplicated depend was not being properly freed. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06conf.c: add missing newline to warningAndrew Gregory1-1/+1
Fixes tests that use pacman's output when built without libcurl. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Fix build warnings with --disable-nlsAllan McRae2-3/+3
The gettext functions return a "char *", so do the same for the defines in the case where gettext is unavailable. This prevents a number of warnings about const being dropped. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-21Use the 'configure'd PYTHON to run pactest.Jeremy Heiner8-15/+1
Use the 'configure'd PYTHON to run pactest instead of the one hard-coded (with '#!') in pactest.py. Also remove useless '#!' from non-main .py files. Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-21makepkg: fix check for distccMaxime Arthaud1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-19trans_prepare: always sort trans->remove by depsAndrew Gregory5-12/+46
Packages can be removed during a sync transaction either directly or due to conflicts and need to be sorted. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-19dload: allow curl to response to any auth challengeDave Reisner1-0/+1
Previously, we only allowed the default of responding to basic auth challenges. Mirrors requiring authorization are far and away the edge case, but there's no sense in preventing access to them. Implements FS#38184. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15alpm: Rename a variable for future clarityOlivier Brunel1-7/+7
We will be adding event structs in the following patches. Signed-off-by: Olivier Brunel <jjk@jjacky.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15Fix pactest READMEAllan McRae1-3/+2
The --test option no longer exists. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15remove useless continueAndrew Gregory1-1/+0
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15db.c: require unique database namesAndrew Gregory2-4/+18
Allowing multiple databases with the same name causes conflicts as they both point to the same database file but may use different servers, usages, or siglevels. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15makepkg: fix consistency of downloaded sources permissionsSébastien Luttringer1-3/+3
Running 'makepkg -g' or 'makepkg' to download source files results in different permissions on the files if the user has a non-default umask. Put the umask definition at the "beginning" of the makepkg script to ensure all files generated by makepkg have a 0022 umask. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15alpm_sync_sysupgrade: skip packages being removedAndrew Gregory1-0/+5
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15Color output from pm_vasprintfAllan McRae1-2/+4
This makes sure warning and error messages from _alpm_log are colored. Fixes FS#35160. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15Fix misspellings and some grammar issues in output of some pacman contrib ↵Jason St. John4-21/+38
scripts Affected files: -- contrib/bacman.sh.in -- contrib/paccache.sh.in -- contrib/pacdiff.sh.in -- contrib/rankmirrors.sh.in Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15pacdiff: do not remove pacfile after viewingVasiliy Korchagin1-1/+2
Automatically removing the file after viewing is not good if on viewing you decide to deal with it later. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15pacscripts: Improve error message when sudo binary is not foundJason St. John1-2/+2
Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15Close file descirptor before forkWolfgang Bumiller1-0/+1
FreeBSD chroot(2) fails with EPERM when a directory file descriptor is open with either `kern.chroot_allow_open_directories` being 0, or when the process already is inside a chroot. This is exposed in alpm_run_chroot that uses opendir() to open a file descriptor to the current directory before doing the forking and chrooting. Since the file descriptor is not used in the forked process, we close it. Fixes FS#36161. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15.gitignore: Add intl directory.Allan McRae1-0/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-12-15paccache: clarify help outputAllan McRae1-3/+3
The help output referred to variables in the script rather than what they were labelled in the parameter argument. Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15Improve --help switch output for pacman contrib and pacman scriptsJason St. John14-54/+99
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 Reported-by: Karol Błażewicz <karol.blazewicz at gmail.com> Signed-off-by: Jason St. John <jstjohn@purdue.edu>
2013-11-15Replace "echo" command with "printf" in human_to_size_test.shJason St. John1-1/+1
Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15Fix typo in pacman-optimizeJason St. John1-1/+1
Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15Fix whitespace and other formatting issuesJason St. John25-118/+119
This commit: -- replaces space-based indents with tabs per the coding standards -- removes extraneous whitespace (e.g. extra spaces between function args) -- adds missing braces for a one-line if statement Signed-off-by: Jason St. John <jstjohn@purdue.edu>
2013-11-15Fix minor grammatical issues in doc/index.txtJason St. John1-8/+8
Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15log important events from the backendAndrew Gregory3-28/+29
This ensures that important events will be logged and consistent regardless of the frontend. The need for global context in the event callback is also removed. The event is logged before any post_* scripts run, so this also moves the post_* script output underneath the event in the log. Fixes FS#36504 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15Makefile.am: fix typo in LOG_DRIVER variableAndrew Gregory5-6/+6
Self-executing tests were not being run through the tap log driver. This caused `make check` to ignore discrepancies between the expected number of tests and the actual number of tests. Also, fix some uncommented output from test scripts that could confuse TAP parsers. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>