Age | Commit message (Collapse) | Author |
|
This function is used both for provision and group selection. Now the
database name will be displayed.
$ pacman -S base-devel
:: There are 11 members in group base-devel:
:: Repository testing
1) make
:: Repository core
2) autoconf 3) automake 4) bison 5) fakeroot 6) flex 7) gcc 8) libtool 9) m4 10) patch 11) pkg-config
Which ones do you want to install?
Enter a number (default=all):
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
Make use of parseindex like in multiselect, and loop until we get a
valid answer like in multiselect.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
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>
|
|
This uses the new public functions to handle targets from the frontend,
like it used to be :
1) alpm_find_dbs_satisfier to find (optionally versioned) package or
provision
2) alpm_find_grp_pkgs to find members for a groups
3) alpm_add_pkg to finally add the pmpkg_t from 1 or 2
Of course, this adds more code to the frontend, but it completely
deprecates sync_target and sync_dbtarget interfaces.
This all-in-one interfaces felt wrong and left no control to the
frontend. A good frontend should just use alpm_add_pkg, with pkg coming
from alpm_db_get_pkg (for normal targets), alpm_find_dbs_satisfier (for
versioned provisions) or alpm_find_grp_pkgs (for groups).
This also opens the way to provide a better group handling in pacman
without constraint from libalpm and callbacks.
In ignore006, only the retcode changes, because no package was found to
satisfy the target (the only possible package is ignored).
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
If there are multiple providers in one db, pacman used to just stop at
the first one (both during dependency resolution or for pacman -S
'provision' which uses the same code).
This adds a new conversation callback so that the user can choose which
provider to install. By default (user press enter or --noconfirm), the
first provider is still chosen, so for example the behavior of sync402
and 403 is preserved. But at least the user now has the possibility to
make the right choice in a manual run.
If one of the provider is already installed, it is picked for
reinstall/upgrade, so that provision 002/003 pactest now pass.
$ pacman -S community/smtp-server
:: There are 3 providers available for smtp-server:
1) courier-mta 2) esmtp 3) exim
Which one do you want to install?
Enter a number (default=1):
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
Perform the cheap struct and string setup of the local DB at handle
initialization time to match the teardown we do when releasing the handle.
If the local DB is not needed, all real initialization is done lazily after
DB paths and other things have been configured anyway.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Clean up some of the code by doing less string copying and printing. This is
accomplished by either doing it after we know we need it, or taking
advantage of the fact that some strings never change such as the root
directory prefix. Also, fix an issue where a file at the root level (e.g.
/foobar) could not be queried.
End result is a much faster user experience when combined with the
mbasename() changes. These timings are for looking up 113 files in /etc/,
some of which are owned and some which are not.
$ find /etc -maxdepth 1 -type f | xargs time pacman -Qo >/dev/null
6.10user 0.05system 0:06.17elapsed 99%CPU (0avgtext+0avgdata 131040maxresident)k
0inputs+0outputs (0major+9436minor)pagefaults 0swaps
$ find /etc -maxdepth 1 -type f | xargs time ./src/pacman/.libs/lt-pacman -Qo >/dev/null
0.86user 0.04system 0:00.92elapsed 99%CPU (0avgtext+0avgdata 131120maxresident)k
0inputs+0outputs (0major+9436minor)pagefaults 0swaps
I'll take a 600% increase in speed.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Rather than roll our own, use strrchr() instead, which glibc may have a
better implementation than the simple iteration method we were using.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Instead of always printing MISSING, we can switch on the errno value set by
access() and print a more useful string. In this case, handle files we can't
read by printing UNREADABLE, print MISSING on ENOENT, and print UNKNOWN for
anything else. Fixes FS#22546.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
And also change "Not Modified" -> "UNMODIFIED" for consistency. This makes
it a lot easier to machine-parse this and not worry about locale
differences.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This will make it a lot easier to use this stuff elsewhere.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
|
|
dirty indicates if the repo has uncommited changes or not when building,
so dont hardcode this info.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Adapting from RPM, follow the [epoch:]version[-release] syntax. We can also
borrow some of their parsing code for our purposes (thanks!). Add some new
tests to our vercmp shell script tester for epoch comparisons, and then make
the code work with these newfangled epoch specifiers.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Conflicts:
lib/libalpm/be_files.c
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This can take a while too, and it is really easy to add the necessary
callback stuff for adding a progressbar.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
These were just two small things I came across today and found could be
fixed or helpful, so I've added them and I'm not sure what else to bundle
them with. commit_count++
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
No real need to use the smaller floating point types here.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
* Remove a stale comment
* Fix a logic error- the conditional disagreed with the comments
* Remove some unnecessary floating point casts
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
None of these warn at the normal "-Wall -Werror" level, but casts do occur
that we are fine with. Make them explicit to silence some warnings when
using "-Wconversion".
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
There is a lot of swtiching between size_t and int for alpm_list sizes
in the codebase. Start converting these to all be size_t by adjusting
the return type of alpm_list_count and fixing all additional warnings
given by -Wconversion that are generated by this change.
Dan: a few more small changes to ensure things compile, adjusting some
printf format string characters to accommodate the larger size on x86_64.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
And change the wording slightly to indicate we *print* a value, not *return*
it. You can't return negative values (they get coerced to 255), so it isn't
worth it to try and cram the result into the return code.
Acked-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
All functions that are limited to the local translation unit are
declared static. This exposed that the _pkg_get_deltas declaration
in be_local.c was being satified by the function in packages.c which
when declared static caused linker failures.
Fixes all warnings with -Wmissing-{declarations,prototypes}.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
POSIX does not require PATH_MAX be defined when there is not actual
limit to its value. This affects HURD based systems. Work around
this by defining PATH_MAX to 4096 (as on Linux) when this is not
defined.
Also, clean up inclusions of limits.h and remove autoconf check for
this header as we do not use macro shields for its inclusion anyway.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Sync DB's no longer have an extracted directory, so remove the files check
for those. Local databases no longer have a 'depends' file, so kill that
check as well. Finally, do a little other cleanup and remove the need for
PATH_MAX.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Always declare a function with (void) rather than () when we expect
no arguements. Fixes all warnings with -Wstrict-prototypes.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We are comparing a floating point number so should use an inequality
rather than implicitly testing != 0.
Prevents warning given by -Wfloat-equal.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Checking disk space needed for a transaction can take a while so add
an informative progress bar.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Disk space checking is likely to be an unnecessary bottleneck to
people with reasonable partition sizes so add a configuration option
to allow it to be disabled/enabled as wanted.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This macro is deemed unnecessary by even the autoconf guys, so we really
don't need to use it.
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We were including the header in a lot of places it is no longer used.
Additionally, use the correct autoconf macro for determining whether
d_type is available as a member: HAVE_STRUCT_DIRENT_D_TYPE.
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Add pactree and sort entries.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This allows to very easily support non-color and linear mode, by just
setting the variables to an empty string, very much like it was done in
the bash script.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
The deps walking code simply calls print_start, print, print_end, and
all the printing logic is handled there.
The unresolvable printing is disabled for now because it does not handle
linear mode, and the linear and color output will be re-written.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
Use the bash script in contrib as the basis for a C rewrite using
libalpm. The speedup can go from dozens of seconds to less than one
second.
Colorized output is preserved.
The --graph option generates output that graphviz's `dot' utility will
understand to draw us a graph. Output is written to stdout and it is
left up to the user to pipe the data and determine the output
characteristics.
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
|
|
When a -Sk or -Uk operation induced a removal of an existing local
package, --dbonly was not in effect and the files were all removed.
Fixing this behavior was already marked as TODO in database012 pactest
------------
TODO: I honestly think the above should NOT delete the original les, it
hould upgrade the DB entry without touching anything on the file stem.
E.g. this test should be the same as:
pacman -R --dbonly dummy && pacman -U --dbonly dummy.pkg.tar.gz
------------
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
[Dan: small coding style touchup]
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Example with pacman -Uh :
$ pacman -Uh
options:
-b, --dbpath <path> set an alternate database location
-d, --nodeps skip dependency checks
-f, --force force install, overwrite conflicting files
-k, --dbonly only modify database entries, not package files
-r, --root <path> set an alternate installation root
-v, --verbose be verbose
--arch <arch> set an alternate architecture
--asdeps install packages as non-explicitly installed
--asexplicit install packages as explicitly installed
--cachedir <dir> set an alternate package cache location
--config <path> set an alternate configuration file
--debug display debug messages
--ignore <pkg> ignore a package upgrade (can be used more than once)
--ignoregroup <grp>
ignore a group upgrade (can be used more than once)
--logfile <path> set an alternate log file
--noconfirm do not ask for any confirmation
--noprogressbar do not show a progress bar when downloading files
--noscriptlet do not execute the install scriptlet if one exists
--print only print the targets instead of performing the operation
--print-format <string>
specify how the targets should be printed
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
[Dan: small coding style touchups]
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The three parts (help, manpage and code) are now organized in the same
way and much easier to compare :
- specific options
- install/upgrade options for -S and -U
- transaction options for -S -R and -U
- global options
After this re-organization, it was easy to update and sync the three
components together. Duplication is also avoided.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
It's very easy to re-implement the -T feature with the more generic
alpm_find_satisfier rather then the more specific and less useful
alpm_deptest.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
One missing NULL-check and 3 dead assignments.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
And don't require pm_targets to be empty to read from stdin either.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Only occurs if no arguments were provided directly. Arguments can be
separated by any amount of valid whitespace. This allows for piping into
pacman from other programs or from itself, e.g.:
pacman -Qdtq | pacman -Rs
This is better than using xargs, as xargs will not reconnect stdin to
the terminal. The above operation performed using xargs would require
the --noconfirm flag to be passed to pacman.
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
Clean-up the previous download location of the sync database and
any old extracted sync database directories which are unneeded
with the tar-db backend.
Signed-off-by: Allan McRae <allan@archlinux.org>
|
|
In the following, the letters SRUDQ refer to the corresponding pacman
operations.
Most of the work in this commit is about removing as many options as
possible from the global section and moving them to where they actually
belong.
Additionally, --ignore{,group} are added to U and --dbonly is added
to S.
--dbonly added to S
--asdeps moved to S/U/D
--asexplicit moved to S/U/D
--print-format moved to S/U/R
--noprogressbar moved to S/U/R
--noscriptlet moved to S/U/R
--ignorepkg added to U
--ignoregrp added to U
-d moved to S/U/R (--nodeps) and Q (--deps)
-p moved to S/U/R (--print) and Q (--file)
-f moved to S/U
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Split parsing of CLI arguments into separate functions:
parsearg_op (operations)
parsearg_global (global options)
parsearg_{database,query,remove,sync,deptest,upgrade}
Organization strictly follows the manpage (even where the manpage is
incorrect) - these cases will be fixed in the following commits.
Switch cases are copy/pasted and statements unrelated to chosen
operation are deleted.
Parsing logic adjusted as follows:
1) Parse operation
2) If we can bail out early (duplicate op, help/version requested) do so
3) Parse arguments again:
foreach arg:
if arg is operation:
continue
tryparse_args_specific_to_op
if unsuccessful tryparse_args_global
if unsuccessful print error message and exit
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
* Add a bunch of static declarations where possible
* Fix void functions to be proper syntax, e.g. void func(void)
* Consistency fixes (such as argv references)
* Remove dead str_cmp() function from testdb
* Remove unneeded config.h header includes
* vercmp: remove completely unnecessary string copying
Signed-off-by: Dan McGee <dan@archlinux.org>
|