| Commit message (Collapse) | Author | Age |
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
| |
Many bitfield variables are declared to be enums, because they are
generated using bitwise operations on enums such. However, their
actual values aren't necessary members of their parent enum, so
declaring them 'int' is more accurate.
Signed-off-by: Ivy Foster <ivy.foster@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
| |
make update-copyright OLD=2015 NEW=2016
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
| |
Make sure allocated memory is freed before returning.
Signed-off-by: Sören Brinkmann <soeren.brinkmann@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
| |
Refactor the upgrade routine to use an array that can be allocated in
one step instead of an alpm_list that is gradually extended in loops.
Signed-off-by: Sören Brinkmann <soeren.brinkmann@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
| |
Check the return value of malloc() before dereferencing the returned pointer.
Signed-off-by: Sören Brinkmann <soeren.brinkmann@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Forcing vim users to view files with a tabstop of 2 seems really
unnecessary when noet is set. I find it much easier to read code with
ts=4 and I dislike having to override the modeline by hand.
Command run:
find . -type f -exec sed -i '/vim.* noet/s# ts=2 sw=2##' {} +
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
| |
remote was being used to loop over itself, making the FREELIST
ineffective.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add LocalFileSigLevel and RemoteFileSigLevel to control the signature
checking for "pacman -U <file>" and "pacman -U <url>" operations
respectively. The starting value for both these options is SigLevel,
if it is specified in the [options] section, or the built-in system
default. The specified values override and/or supplement this initial
value. Note there is no distinction between setting "Required" and
"PackageRequired" as there are no database options for Upgrade
operations.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
| |
Add 2012 to the copyright range for all libalpm and pacman source files.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensures that config.h is always ordered correctly (first) in the
includes. Also means that new source files get this for free without
having to remember to add it.
We opt for -imacros over -include as its more portable, and the
added constraint by -imacros doesn't bother us for config.h.
This also touches the HACKING file to remove the explicit mention of
config.h as part of the includes.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an early target fails, we stopped processing the rest of the list. We
should continue all the way through and show relevant errors for each
target if possible, and error out only at the end.
We do process all targets to check for URLs first and will error out if
some could not be processed; we then do a second loop and try to load
each target specified on the command line.
This mirrors a patch by Allan to do the same for removal operations.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/pacman/package.c
Signed-off-by: Dan McGee <dan@archlinux.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that pm_printf() always prints to stderr, we don't need this second
function that was always used with stderr as the first argument. Thus,
this patch removes the function and makes the following sed replacement:
sed -i -e 's#pm_fprintf(stderr, #pm_printf(#g' src/pacman/*.c
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|/
|
|
|
|
|
| |
This one is pretty darn useless. Just derefence the ->data attribute
since the type is public anyway and save yourself the function call.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
| |
This allows us to sort the output list by showing all pulled
dependencies first, followed by the explicitly specified targets.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
| |
Do this outside the loop to prevent the message from being displayed
(and pluralized!) for each individual package.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This will be the first thing printed when doing an upgrade. Currently
there is no output at all until we start resolving dependencies, which
can be a while in if specifying very large targets on the command line,
in which case it is nice to let the user know we are doing something.
Addresses FS#25822 in the most KISS way possible.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
| |
Pacman did a great job of having almost (but not quite) duplicate code
paths through the sync and upgrade code. We can use the same logic in
both upgrade in sync once the targets are resolved, so extract a
function and delete a bunch of code.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
They are placeholders, but important for things like trying to re-sync a
database missing a signature. By using the alpm_db_validity() method at
the right time, a client can take the appropriate action with these
invalid databases as necessary.
In pacman's case, we disallow just about anything that involves looking
at a sync database outside of an '-Sy' operation (although we do check
the validity immediately after). A few operations are still permitted-
'-Q' ops that don't touch sync databases as well as '-R'.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This gives us more granularity than the former Never/Optional/Always
trifecta. The frontend still uses these values temporarily but that will
be changed in a future patch.
* Use 'siglevel' consistenly in method names, 'level' as variable name
* The level becomes an enum bitmask value for flexibility
* Signature check methods now return a array of status codes rather than
a simple integer success/failure value. This allows callers to
determine whether things such as an unknown signature are valid.
* Specific signature error codes mostly disappear in favor of the above
returned status code; pm_errno is now set only to PKG_INVALID_SIG or
DB_INVALID_SIG as appropriate.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
| |
Only one of these looked like a real red flag, in find_requiredby(), but
it doesn't hurt to fix several of them up anyway.
Unfortunately, we can't turn this on universally due to things like the
sync(), remove(), etc. builtins which we often use as variable names.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the need to write accessor methods for every type we have,
and simplifies the API. Any type that doesn't need magic* can be
converted in this fashion to make it easier for frontend applications to
use, as well as make it less of a pain to introduce new such structs in
the future.
* "magic" meaning something like pmpkg_t where values can be lazy loaded.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
| |
This involves some serious changes and a very messy diff, unfortunately.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
| |
This makes these functions consistent with the rest of the transaction
related API calls. We do an additional assert to ensure the handle
attached to the package is the same as the handle passed in.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
| |
Begin enforcing the need to pass a handle. This allows us to remove one
more extern handle declaration from the backend.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
| |
This requires a lot of line changes, but not many functional changes as
more often than not our handle variable is already available in some
fashion.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Both md5sum verification and PGP verification can and should be done at
package load time. This allows verification to happen as early as
possible for packages provided by filename and loaded in the frontend,
and moves more stuff out of sync_commit that doesn't really belong
there. This should also set the stage for simplified parallel loading of
packages later down the road.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was discussed and more or less agreed upon on the mailing list. A
huge checkin, but if we just do it and let people adjust the pain will
end soon enough. Rebasing should be relatively straighforward for anyone
that sees conflicts; just be sure you use the new return style if
possible.
The following semantic patch was used to do the change, along with some
hand-massaging in order to preserve parenthesis where appropriate:
The semantic match that finds this problem is as follows, although some
hand-massaging was done in order to keep parenthesis where appropriate:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression a;
@@
- return(a);
+ return a;
// </smpl>
A macros_file was also provided with the following content:
Additional steps taken, mainly for ASSERT() macros:
$ sed -i -e 's#return(NULL)#return NULL#' lib/libalpm/*.c
$ sed -i -e 's#return(-1)#return -1#' lib/libalpm/*.c
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note that there is a behavior change here : if the same package name
appeared several times in the target list, the alpm_add_target interface
chooses the new package, while alpm_add_pkg returns PKG_DUP.
I don't see why we cannot unify the behavior of -S and -U, and just
choose one behavior that applies to both.
Otherwise, it's always possible to handle these different behaviors in
the frontend, it just requires more work.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
|
|
|
| |
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
| |
Follow the HACKING guidelines and always use != 0 or == 0 rather
than negation within conditional statements to improve clarity.
Most of these are !strcmp usages which is the example of what not
to do in the HACKING document.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
|
|
| |
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
And a new --print-format option to configure the output.
This implements FS#14208
Example usage :
pacman -Sp --print-format "%r/%n-%v : %l [%s]" kdelibs
extra/kdelibs-4.3.2-4 : ftp://mir2.archlinuxfr.org/archlinux/extra/os/i686/kdelibs-4.3.2-4-i686.pkg.tar.gz [0,00]
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The "local database is up to date" message has been replaced with "there
is nothing to do" message. This used with "empty" -S, -R, -U operations too.
(Examples: pacman -S ignored_pkg, pacman -Ru needed_pkg.)
See FS#17859.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
|