tool/Arch-pacman/.git
8 years agoTESTS: add missing tests master origin/HEAD origin/develop origin/master
Andrew Gregory [Wed, 18 Sep 2013 18:29:07 +0000 (14:29 -0400)]
TESTS: add missing tests

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoFix make distcheck
Andrew Gregory [Wed, 18 Sep 2013 18:27:00 +0000 (14:27 -0400)]
Fix make distcheck

* 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>
8 years agomakepkg: redirect downloader output to STDERR
Xyne [Wed, 18 Sep 2013 03:01:23 +0000 (03:01 +0000)]
makepkg: redirect downloader output to STDERR

This allows scripts to safely capture the output of "makepkg -g".

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agomakepkg: include all hash types in integlist
Xyne [Tue, 17 Sep 2013 15:31:17 +0000 (15:31 +0000)]
makepkg: include all hash types in integlist

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agobacman: optionally include unmodified backup files when available
Xyne [Tue, 17 Sep 2013 09:19:26 +0000 (09:19 +0000)]
bacman: optionally include unmodified backup files when available

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agobacman: update copyright information in version function
Xyne [Tue, 17 Sep 2013 09:19:25 +0000 (09:19 +0000)]
bacman: update copyright information in version function

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agobacman: pass unshifted arguments to fakeroot
Xyne [Tue, 17 Sep 2013 09:19:24 +0000 (09:19 +0000)]
bacman: pass unshifted arguments to fakeroot

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agodload: avoid renaming files downloaded via sync operations
Christian Hesse [Thu, 5 Sep 2013 14:08:23 +0000 (16:08 +0200)]
dload: avoid renaming files downloaded via sync operations

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>
8 years agocontrib: Unify quoting in error messages
Aaron Lindsay [Thu, 5 Sep 2013 18:46:29 +0000 (14:46 -0400)]
contrib: Unify quoting in error messages

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>
8 years agomakepkg: use c-style for loops for integrity checks
Dave Reisner [Wed, 4 Sep 2013 00:03:04 +0000 (20:03 -0400)]
makepkg: use c-style for loops for integrity checks

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>
8 years agomakepkg: always use read's -r flag with filenames
Dave Reisner [Tue, 3 Sep 2013 22:12:53 +0000 (18:12 -0400)]
makepkg: always use read's -r flag with filenames

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>
8 years agomakepkg: inline creation of checksum indenting
Dave Reisner [Tue, 3 Sep 2013 19:47:10 +0000 (15:47 -0400)]
makepkg: inline creation of checksum indenting

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>
8 years agomakepkg: cleanup a few format string injections
Dave Reisner [Mon, 2 Sep 2013 20:50:08 +0000 (16:50 -0400)]
makepkg: cleanup a few format string injections

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopactree: set full usage on DBs when registering
Dave Reisner [Mon, 9 Jul 2012 14:03:20 +0000 (10:03 -0400)]
pactree: set full usage on DBs when registering

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacman: add front end support for repo usage level
Dave Reisner [Mon, 2 Jul 2012 21:16:58 +0000 (17:16 -0400)]
pacman: add front end support for repo usage level

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>
8 years agolibalpm: introduce a usage level for repos
Dave Reisner [Sat, 9 Mar 2013 23:28:28 +0000 (18:28 -0500)]
libalpm: introduce a usage level for repos

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>
8 years agoproto: remove redundancy in cd for each function
Dave Reisner [Sun, 10 Mar 2013 19:56:12 +0000 (15:56 -0400)]
proto: remove redundancy in cd for each function

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacman/util.c: use switch when there are fall through statements
Sami Kerola [Mon, 2 Sep 2013 20:30:47 +0000 (21:30 +0100)]
pacman/util.c: use switch when there are fall through statements

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>
8 years agoImprove --help switch output for pacman utils
Jason St. John [Tue, 3 Sep 2013 19:20:50 +0000 (15:20 -0400)]
Improve --help switch output for pacman utils

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>
8 years agomakepkg: add support for sha224 checksums
Dave Reisner [Mon, 2 Sep 2013 20:02:34 +0000 (16:02 -0400)]
makepkg: add support for sha224 checksums

Implements FS#36776.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agomakepkg: unify list of known hash algorithms
Dave Reisner [Mon, 2 Sep 2013 19:53:33 +0000 (15:53 -0400)]
makepkg: unify list of known hash algorithms

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>
8 years agolibalpm: avoid name space conflict
Sami Kerola [Mon, 2 Sep 2013 20:30:48 +0000 (21:30 +0100)]
libalpm: avoid name space conflict

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>
8 years agocommon: compare value rather than pointer address
Sami Kerola [Mon, 2 Sep 2013 20:30:46 +0000 (21:30 +0100)]
common: compare value rather than pointer address

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agomakepkg.8: fix typo in usage
Dave Reisner [Wed, 21 Aug 2013 15:16:44 +0000 (11:16 -0400)]
makepkg.8: fix typo in usage

Looks like I fat fingered something when I refactored the original
submissions. Woops.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoalpm: log errors for scriptlets terminated by a signal
Dave Reisner [Wed, 21 Aug 2013 02:00:10 +0000 (22:00 -0400)]
alpm: log errors for scriptlets terminated by a signal

Fixes FS#36618.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoStore fgetc output as an int.
Allan McRae [Mon, 12 Aug 2013 11:09:01 +0000 (21:09 +1000)]
Store fgetc output as an int.

Bug exposed on ARM when char is unsigned resulting in the comparison
to EOF always failing.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconflict.c: fix directory ownership check
Andrew Gregory [Fri, 9 Aug 2013 13:15:40 +0000 (09:15 -0400)]
conflict.c: fix directory ownership check

* append "/" to directories before searching package file lists
* use lstat over stat so symlinks aren't resolved
* fix the inverted check for stat's return value

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agodoc/repo-add: Add note on when signatures are added to the db
Olivier Brunel [Wed, 7 Aug 2013 17:04:52 +0000 (19:04 +0200)]
doc/repo-add: Add note on when signatures are added to the db

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agomakepkg: allow make-style environment var overrides
Dave Reisner [Mon, 5 Aug 2013 22:04:37 +0000 (18:04 -0400)]
makepkg: allow make-style environment var overrides

This allows for VAR=value and VAR+=value variable declarations.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agocheck.c: break backup file search loop after match
Andrew Gregory [Sun, 4 Aug 2013 21:18:08 +0000 (17:18 -0400)]
check.c: break backup file search loop after match

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoDo not refer to FlySpray numbers
Allan McRae [Mon, 15 Jul 2013 04:14:46 +0000 (14:14 +1000)]
Do not refer to FlySpray numbers

These references to bug numbers assume we will forever be using that bug
tracker. It is better to properly comment the code instead (which was
done in almost all cases anyway).

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoini.c: give recursion limit file scope
Andrew Gregory [Fri, 2 Aug 2013 12:29:03 +0000 (08:29 -0400)]
ini.c: give recursion limit file scope

The recursion limit is an artificial limitation imposed to prevent
memory exhaustion in a recursive function.  Giving it file-level scope
increases its visibility.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoini.c: make errors in includes fatal
Andrew Gregory [Mon, 22 Jul 2013 06:46:53 +0000 (02:46 -0400)]
ini.c: make errors in includes fatal

If an error in the main file would be fatal there is little reason to
ignore the error in an included file.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoini.c: reuse line buffer
Andrew Gregory [Mon, 22 Jul 2013 06:46:52 +0000 (02:46 -0400)]
ini.c: reuse line buffer

By the time we make the recursive call we have already finished with the
line buffer, making it safe to reuse.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconf.c: extract ini parsing code to separate files
Andrew Gregory [Mon, 22 Jul 2013 06:46:50 +0000 (02:46 -0400)]
conf.c: extract ini parsing code to separate files

Move _parseconfig to ini.c as _parse_ini and create a convenient wrapper
for the public API.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconf.c: pass _parse_directive as a callback
Andrew Gregory [Mon, 22 Jul 2013 06:46:49 +0000 (02:46 -0400)]
conf.c: pass _parse_directive as a callback

This will allow passing arbitrary key/value handlers.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconf.c: move section handling out of _parseconfig
Andrew Gregory [Mon, 22 Jul 2013 06:46:48 +0000 (02:46 -0400)]
conf.c: move section handling out of _parseconfig

_parseconfig now tracks the current section name directly so that the
name stored in the section struct is just a pointer to the one stored by
_parseconfig.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconf.c: move directive parsing out of _parseconfig
Andrew Gregory [Mon, 22 Jul 2013 06:46:47 +0000 (02:46 -0400)]
conf.c: move directive parsing out of _parseconfig

Include directives no longer have to be within a section.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconf.c: move repo parsing out of _parseconfig
Andrew Gregory [Mon, 22 Jul 2013 06:46:46 +0000 (02:46 -0400)]
conf.c: move repo parsing out of _parseconfig

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconf.c: add parse_options to section_t
Andrew Gregory [Mon, 22 Jul 2013 06:46:45 +0000 (02:46 -0400)]
conf.c: add parse_options to section_t

This consolidates all of our state information into a single variable.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopactest: remove results summary
Andrew Gregory [Fri, 2 Aug 2013 02:59:11 +0000 (22:59 -0400)]
pactest: remove results summary

This functionality can be provided by a test harness.  Having pactest
output this information as well clutters the result log created by
automake.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agointegrate tests with automake
Andrew Gregory [Thu, 18 Jul 2013 07:43:51 +0000 (03:43 -0400)]
integrate tests with automake

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopactest: accept test names without a switch
Andrew Gregory [Mon, 29 Jul 2013 19:34:04 +0000 (15:34 -0400)]
pactest: accept test names without a switch

This removes the --test switch, making it easier to call pactest from
a test harness.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoprovide default values for test scripts
Andrew Gregory [Mon, 29 Jul 2013 18:57:59 +0000 (14:57 -0400)]
provide default values for test scripts

Our test scripts currently require that the first argument be the
library or binary to be tested.  This makes integrating them with
automake which doesn't have a mechanism for passing specific arguments
to individual tests.  Instead, provide a default built from paths in the
environment which can be provided to all test scripts by automake.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconvert pactest to TAP output
Andrew Gregory [Mon, 29 Jul 2013 19:22:07 +0000 (15:22 -0400)]
convert pactest to TAP output

Each test produces a single TAP result with the rules run in a sub-test.
This reduces output when run under automake and makes it possible to
continue setting expectfailure at the test level rather than per-rule.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopactest: treat unknown rules as failures
Andrew Gregory [Fri, 2 Aug 2013 02:51:24 +0000 (22:51 -0400)]
pactest: treat unknown rules as failures

Tests should only be skipped when they aren't relevant, not when the
test itself is bad.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoconvert test scripts to tap output
Andrew Gregory [Thu, 18 Jul 2013 07:41:08 +0000 (03:41 -0400)]
convert test scripts to tap output

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoquery006: only set expectfailure on 32-bit systems
Andrew Gregory [Sun, 18 Aug 2013 19:06:30 +0000 (15:06 -0400)]
query006: only set expectfailure on 32-bit systems

Use the architecture of the python interpreter running the test to
detect 32bit systems.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoReport missing directory if we can not initialise alpm library
Allan McRae [Sun, 21 Jul 2013 06:48:31 +0000 (16:48 +1000)]
Report missing directory if we can not initialise alpm library

When pacman failed to initialise the alpm library due to the database
directory being missing (either via the root not existing or the database
directory itself not existing), it just printed the non-informative
message "could not find or read directory".  Add the directory
information the the error output.  E.g.:

error: failed to initialize alpm library
(could not find or read directory: /this/does/not/exist/var/lib/pacman/)

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoRemove setlocale usage from the backend
Allan McRae [Sun, 21 Jul 2013 06:38:17 +0000 (16:38 +1000)]
Remove setlocale usage from the backend

Using setlocale in the backend is bound to lead to frontend issues
and we have have been using epoch in our databases since April 2007
(commit 47622eef).  Remove support for old style times.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoWarn when directory ownership differs between filesystem and package
Allan McRae [Sun, 21 Jul 2013 06:10:25 +0000 (16:10 +1000)]
Warn when directory ownership differs between filesystem and package

We currently only warn if a directory's permissions differ, but using -Qkk
on my system shows that directory permissions tend to change in packages
reasonably frequently without notice.  Provide a warning in such cases
so that it can be altered.  Example output:

(1/1) reinstalling nginx
warning: directory ownership differs on /var/lib/nginx/proxy/
filesystem: 33:0  package: 0:0

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoOnly note backup file changes with -Qkk
Allan McRae [Sun, 21 Jul 2013 05:38:24 +0000 (15:38 +1000)]
Only note backup file changes with -Qkk

Backup files are expected to be changed and should not be flagged by -Qkk.
Note changed back-up files in -Qkk but do not count them as altered. Do
not report backup files in -Qqkk.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoFix whitespace in makepkg.sh.in and makepkg-template.pl.in
Jason St. John [Mon, 22 Jul 2013 01:09:58 +0000 (03:09 +0200)]
Fix whitespace in makepkg.sh.in and makepkg-template.pl.in

Replace spaces with tabs in one instance.
Remove extra spaces.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoFix whitespace in pacsort.c and pactree.c
Jason St. John [Mon, 22 Jul 2013 01:09:57 +0000 (03:09 +0200)]
Fix whitespace in pacsort.c and pactree.c

Replace spaces with tabs.
Remove extra spaces.

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: provide an --output option to show any .pac* files
Jonathan Frazier [Thu, 18 Jul 2013 22:05:58 +0000 (18:05 -0400)]
pacdiff: provide an --output option to show any .pac* files

This is an option to just echo's the pacnews/pacsaves instead of merging
or removing them. This can be used to check the config status such as in
a cron job without modifying the system.

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: make pacmandb search the default type.
Jonathan Frazier [Thu, 18 Jul 2013 21:50:44 +0000 (17:50 -0400)]
pacdiff: make pacmandb search the default type.

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: improve speed, accuracy finding active configs using pacmandb
Jonathan Frazier [Thu, 18 Jul 2013 21:12:32 +0000 (17:12 -0400)]
pacdiff: improve speed, accuracy finding active configs using pacmandb

This is a new search type, using -p or --pacmandb options. It reads
config file locations directly from the local pacman db. It will find
active configs anywhere they are defined in installed packages. It is
not dependant on outside configs such as updatedb.conf or scanning a
large set of directories for find.

This will find more pacnews than find when searching with the current
default of /etc, and it is faster than both find and updatedb when
searching the entire fs. When run directly after an update, the local db
is more likely to be cached than all files in /etc or / as other methods
read. This will increase performance further post upgrade.

After a package is removed and a pacsave is created, this method will
not find these pacsaves until the base config is added to the local db
again. These files have no influence in a working system and only take
up a few blocks of disk space.

Active configs need to be dealt with immediately to keep a system
working. pacsaves related to removed configs can remain for weeks or
months without problems. I would recommend occasionally running other
methods such as --locate to remove them.

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: rework search type handling, add --find option
Jonathan Frazier [Tue, 16 Jul 2013 16:38:15 +0000 (12:38 -0400)]
pacdiff: rework search type handling, add --find option

Change cmd tests to if (( USE_FIND ))... as it is cleaner.  All search
cmds have an option and a variable initialized to zero. The active option
should be set to 1.  Add a switch to exclude multiple search options.
set the default when all are equal to zero.

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: add --nocolor option for the terminally challenged.
Jonathan Frazier [Mon, 15 Jul 2013 17:02:33 +0000 (13:02 -0400)]
pacdiff: add --nocolor option for the terminally challenged.

Allow colors to be disabled for use on broken/serial terminals.

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: allow multiple separated options
Jonathan Frazier [Mon, 15 Jul 2013 16:56:03 +0000 (12:56 -0400)]
pacdiff: allow multiple separated options

loop over arguments, this will allow adding options such as --nocolor

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: clean up and reword --help
Jonathan Frazier [Mon, 15 Jul 2013 15:00:30 +0000 (11:00 -0400)]
pacdiff: clean up and reword --help

Clean up and reword --help
get rid of all the echos to make it easier to read in source.

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: Search and give warnings for older pacsave.[0-9]* files
Jonathan Frazier [Sun, 7 Jul 2013 13:45:02 +0000 (09:45 -0400)]
pacdiff: Search and give warnings for older pacsave.[0-9]* files

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoCorrected return codes for Sg flag
Ashley Whetter [Tue, 16 Jul 2013 09:18:32 +0000 (10:18 +0100)]
Corrected return codes for Sg flag

Non-zero is now returned if a group is searched for that doesn't exist.
Fixes FS#36097.

Signed-off-by: Ashley Whetter <awhetter.2011@my.bristol.ac.uk>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoFix typo
Allan McRae [Mon, 15 Jul 2013 04:29:28 +0000 (14:29 +1000)]
Fix typo

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoclarified descriptions for pactree -r (--help)
Zulker Nayeen Nahiyan [Mon, 15 Jul 2013 01:37:42 +0000 (07:37 +0600)]
clarified descriptions for pactree -r (--help)

Signed-off-by: Zulker Nayeen Nahiyan <nahiyan02@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoClarify inter-conflicts message
Allan McRae [Mon, 15 Jul 2013 01:45:11 +0000 (11:45 +1000)]
Clarify inter-conflicts message

Use a clear message rather than using a made up word to describe what
we are doing.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoInstall makedepends and checkdepends together
Ashley Whetter [Fri, 12 Jul 2013 10:06:38 +0000 (11:06 +0100)]
Install makedepends and checkdepends together

Fixes FS#31557

Signed-off-by: Ashley Whetter <awhetter.2011@my.bristol.ac.uk>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacdiff: Add quit to found pacnew options
Jonathan Frazier [Thu, 11 Jul 2013 17:03:36 +0000 (13:03 -0400)]
pacdiff: Add quit to found pacnew options

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoCarry a copy of gpgme.m4
Allan McRae [Wed, 10 Jul 2013 12:42:40 +0000 (22:42 +1000)]
Carry a copy of gpgme.m4

On systems without gpgme installed, autoreconf will fail with an unrelated
error message unless the gpgme.m4 file is present.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoRemove autoclean.sh
Allan McRae [Sun, 30 Jun 2013 01:12:16 +0000 (11:12 +1000)]
Remove autoclean.sh

Use 'git clean' instead.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoPatch ltmain on autoreconf
Allan McRae [Wed, 26 Jun 2013 04:37:53 +0000 (14:37 +1000)]
Patch ltmain on autoreconf

We used to carry a patched version of ltmain in our repos to fix libtools
issues with -Wl,-as-needed. Now that ltmain is "generated" by autoreconf,
we manually patch it afterwards.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoUse autoreconf in autogen.sh
Allan McRae [Wed, 26 Jun 2013 04:21:53 +0000 (14:21 +1000)]
Use autoreconf in autogen.sh

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoUpdate gitignore files for use with autoreconf
Allan McRae [Wed, 26 Jun 2013 04:20:59 +0000 (14:20 +1000)]
Update gitignore files for use with autoreconf

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoRemove autotools files
Allan McRae [Wed, 26 Jun 2013 04:05:26 +0000 (14:05 +1000)]
Remove autotools files

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agobe_sync: avoid crashing on files in the root of a DB
Dave Reisner [Sun, 7 Jul 2013 23:52:13 +0000 (19:52 -0400)]
be_sync: avoid crashing on files in the root of a DB

If a sync DB is malformed and contains entries in the root of the
archive, load_pkg_for_entry will leave the 'filename' variable empty,
leading to a crash in the ensuing strcmp() calls which determine the DB
fragment being examined.

While this isn't a read error, this should be reported to the user so
that it can be addressed by the creator of the DB.

As seen: https://bbs.archlinux.org/viewtopic.php?pid=1297766

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
8 years agoHide unused parameter warnings when building without libcurl
Allan McRae [Wed, 10 Jul 2013 03:58:57 +0000 (13:58 +1000)]
Hide unused parameter warnings when building without libcurl

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoAdd missing header
Allan McRae [Wed, 10 Jul 2013 03:41:09 +0000 (13:41 +1000)]
Add missing header

Exposed when building with --without-libcurl

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agouse full path when checking for mountpoints
Andrew Gregory [Thu, 4 Jul 2013 10:36:20 +0000 (06:36 -0400)]
use full path when checking for mountpoints

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agodo not check error from close(2)
Dave Reisner [Thu, 4 Jul 2013 00:33:19 +0000 (20:33 -0400)]
do not check error from close(2)

On operating systems we support, the behavior is always such that the
kernel will do the right thing as far as invalidating the file
descriptor, regardless of the eventual return value. Therefore,
potentially looping and calling close multiple times is wrong.

At best, we call close again on an invalid FD and throw a spurious EBADF
error. At worst, we might close an FD which doesn't belong to us when a
multi-threaded application opens its own file descriptor between
iterations of the loop.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoConsolidate and improve table implementations
Simon Gomizelj [Thu, 4 Jul 2013 02:34:14 +0000 (22:34 -0400)]
Consolidate and improve table implementations

Implement both the VerbosePkgList and the summary message with the same
table.

Improve VerbosePkgList by caching attributes and cell's lengths instead
of recaculating them.

Right align every cell that containing a file size in both the
VerbosePkgList and the summary.

Simplify the printf statements and the alignment application.

Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoupdate to automake 1.14
Allan McRae [Fri, 21 Jun 2013 13:13:02 +0000 (23:13 +1000)]
update to automake 1.14

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoquery_fileowner: resolve trailing . or .. in paths
Andrew Gregory [Wed, 19 Jun 2013 05:23:20 +0000 (01:23 -0400)]
query_fileowner: resolve trailing . or .. in paths

The full path needs to resolved any time it ends with "." or "..", not
just when those are the entire path.  This allows strange-but-valid
paths such as: "/home/." to be queried.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoquery_fileowner: remove useless path variable
Andrew Gregory [Wed, 19 Jun 2013 05:23:19 +0000 (01:23 -0400)]
query_fileowner: remove useless path variable

We no longer need it for resolving package files and using it to
resolve root is unnecessary as alpm does that for us.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoquery_group: allow package filters
Andrew Gregory [Wed, 19 Jun 2013 05:23:18 +0000 (01:23 -0400)]
query_group: allow package filters

Relocated query_group() to allow calling filter().

Fixes FS#19716

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoskip unknown repo names for pacman -Sl
Andrew Gregory [Wed, 19 Jun 2013 05:15:02 +0000 (01:15 -0400)]
skip unknown repo names for pacman -Sl

Brings pacman -Sl behavior in line with other listing operations.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoEnable inverted patterns in NoExtract and NoUpgrade.
Patrick Steinhardt [Tue, 18 Jun 2013 15:44:15 +0000 (17:44 +0200)]
Enable inverted patterns in NoExtract and NoUpgrade.

It is now possible to invert patterns in NoExtract and NoUpgrade.
This feature allows users to whitelist certain files that were
previously blacklisted by another entry.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agodeps.c: check for indirect deps when ordering
Andrew Gregory [Sat, 18 May 2013 19:53:32 +0000 (15:53 -0400)]
deps.c: check for indirect deps when ordering

On upgrades, indirect dependencies were not being detected if there was
a dependency in between them that was not part of the transaction.  For
example, with the dependency chain: pkg1 -> pkg2 -> pkg3, if pkg1 and
pkg3 are being upgraded but not pkg2 pacman would not order pkg1 and
pkg3 properly.

This was particularly problematic when replacements were involved
because the replaced package(s) would be removed at the start of the
transaction.  If an install script required the replacer and lacked
a direct dependency, it could fail.

Fixes FS#32764.

Partially fixes FS#23011.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoMake --unrequired filter packages that are optdep as well
Olivier Brunel [Mon, 17 Jun 2013 08:46:38 +0000 (10:46 +0200)]
Make --unrequired filter packages that are optdep as well

Specify it twice to only filter direct dependencies.

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoInstall unchanged backup files to get correct timestamps.
Patrick Steinhardt [Tue, 4 Jun 2013 09:20:14 +0000 (11:20 +0200)]
Install unchanged backup files to get correct timestamps.

Fixes FS#35515.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoMerge branch 'maint'
Allan McRae [Wed, 26 Jun 2013 05:30:55 +0000 (15:30 +1000)]
Merge branch 'maint'

8 years agoRespect paths with spaces on --install
Andrea Scarpino [Wed, 19 Jun 2013 20:38:57 +0000 (22:38 +0200)]
Respect paths with spaces on --install

makepkg --install doesn't quote the absolute path, so if the path contains
spaces pacman -U fails.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoMerge branch 'maint'
Allan McRae [Tue, 18 Jun 2013 03:59:18 +0000 (13:59 +1000)]
Merge branch 'maint'

8 years ago4.1.2 release preparation
Allan McRae [Tue, 18 Jun 2013 03:38:11 +0000 (13:38 +1000)]
4.1.2 release preparation

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agocontrib: update .gitignore
Allan McRae [Tue, 18 Jun 2013 03:26:42 +0000 (13:26 +1000)]
contrib: update .gitignore

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agoPull translation updates
Allan McRae [Tue, 18 Jun 2013 03:17:30 +0000 (13:17 +1000)]
Pull translation updates

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacscripts: Update for pacman changes
Karol Blazewicz [Mon, 17 Jun 2013 21:48:39 +0000 (23:48 +0200)]
pacscripts: Update for pacman changes

Changes to pacman mean that -Sp can be called without root permissions
and '-d' needs passed twice to completely ignore dependencies.

Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agopacscripts: don't read the whole package from cache
Karol Blazewicz [Mon, 17 Jun 2013 21:48:38 +0000 (23:48 +0200)]
pacscripts: don't read the whole package from cache

'-q' means "Exit as soon as each specified pattern or filename has
been matched." There is no reason to keep reading the whole package
from the cache when the install script has already been printed to
stdout.

Signed-off-by: Karol Błażewicz <karol.blazewicz at gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agocheckupdates: Consistency in environmental variable name
Allan McRae [Tue, 18 Jun 2013 02:53:26 +0000 (12:53 +1000)]
checkupdates: Consistency in environmental variable name

Use CHECKUPDATES_DB rather than CHECKUPDATE_DB for consistency with the
script name.

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agocontrib/checkupdates: fix typo
Allan McRae [Sun, 16 Jun 2013 06:36:20 +0000 (16:36 +1000)]
contrib/checkupdates: fix typo

Signed-off-by: Allan McRae <allan@archlinux.org>
8 years agomakepkg: fix typo for distcc test
Allan McRae [Sun, 16 Jun 2013 06:33:39 +0000 (16:33 +1000)]
makepkg: fix typo for distcc test

Introduced in commit 9dd42dc0.  Fixes FS#35741.

Signed-off-by: Allan McRae <allan@archlinux.org>