1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00
Commit Graph

3224 Commits

Author SHA1 Message Date
Xavier Chantry
65a96e900d pactree: use variables for color and tree output
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>
2010-12-12 20:21:40 -06:00
Xavier Chantry
6b928fc0bf pactree: separate dependency and print logic
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>
2010-12-12 20:21:27 -06:00
Dave Reisner
7c06e66c24 pactree: rewrite in C
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>
2010-12-12 20:21:15 -06:00
Xavier Chantry
abefa23341 alpm/remove.c : respect --dbonly during remove-upgrade
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>
2010-12-12 20:19:24 -06:00
Xavier Chantry
3a9dec1048 pacman: sort --help output
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>
2010-12-12 20:17:38 -06:00
Xavier Chantry
c78f5fb99a CLI args: update --help and manpage
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>
2010-12-12 20:15:53 -06:00
Xavier Chantry
d0d8f605d5 alpm: don't expose alpm_depcmp
Either we expose all low levels function dealing with pmdepend_t
(splitdep and depfree come to mind), or we don't.

Since none of the tools use depcmp, I chose to remove it. In the future,
we might want to expose higher level functions such as
alpm_find_satisfier, or just lower level functions like splitdep and
depfree together with depcmp.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:08:54 -06:00
Xavier Chantry
d5a7dc67d9 alpm: kill alpm_deptest
This has been replaced by the more flexible alpm_find_satisfier
function, and alpm_deptest was completely unsused now.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:08:27 -06:00
Xavier Chantry
8791ae0fda pacman/deptest: reimplement with alpm_find_satisfier
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>
2010-12-12 20:08:16 -06:00
Xavier Chantry
a03daad073 alpm: add new alpm_find_satisfier function
whatprovides and splitdep were removed, so depcmp alone is quite useless
now without splitdep, and deptest is not flexible enough.

Introduce a new alpm_find_satisfier which is hopefully more flexible,
this should make implementation of deptest very easy, and also help alpm
tools such as pactree.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:07:58 -06:00
Xavier Chantry
c2cce1f46a Fix a few problems reported by clang-analyzer
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>
2010-12-12 20:07:15 -06:00
Dan McGee
0e39cf9275 Ensure stdin args are correctly terminated
And don't require pm_targets to be empty to read from stdin either.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 20:01:14 -06:00
Dan McGee
a35610beba Merge branch 'maint'
Conflicts:
	lib/libalpm/be_local.c
	lib/libalpm/trans.c
2010-12-12 19:53:20 -06:00
Xavier Chantry
5c8083baa4 be_files: write EPOCH instead of FORCE
This patch is only meant for 3.4.x. It prepares the place for the future
epoch-aware release.

All force packages that get reinstalled or upgraded will get an EPOCH
entry in the local database, and thus the new pacman with epoch won't
reinstall them by mistake on the first -Su.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-12 19:45:04 -06:00
Dan McGee
eedf4f4e63 Fix possible null pointer deref in check_arch
If we have a corrupted database, a package can come through without an arch,
causing the code to blow up when making strcmp() calls. It might even be
possible with perfectly valid database entries lacking an 'arch =' line.
This behavior was seen as at least one of the problems in FS#21668.

Ensure pkgarch is not null before doing anything further.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-12-10 19:45:14 -06:00
Sergey Tereschenko
bd08581d2e Small update to Russian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-11-08 06:56:04 -06:00
Dave Reisner
4fb3cfc48f Support reading package args from stdin
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>
2010-11-04 21:10:32 -05:00
Dan McGee
a91250b7bb Add initial 3.4.2 NEWS draft
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-28 10:13:18 -05:00
Tobias Eriksson
a08638edc8 Update Swedish translation
442 translated strings, no fuzzies, no untranslated.

	modified:   po/sv.po

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-28 10:13:18 -05:00
Xavier Chantry
592211b6dc PKGBUILD.vim: add special licenses BSD MIT ZLIB Python
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-28 09:31:22 -05:00
Ricardo Pérez
d901646f7a Small updates to Spanish translation
Also addresses FS#21373.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-28 09:13:24 -05:00
Dan McGee
0f3957ab48 Merge branch 'maint' 2010-10-18 16:52:57 -05:00
Xavier Chantry
ce96f39ac9 pactest: use valgrind.supp file
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:51:38 -05:00
Jakob Gruber
8f2eaa51c2 Tests: '-S repo/group' syntax
when calling '-S repo/group', only group members in <repo> should should
be installed (group members in other repos are ignored)

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:51:38 -05:00
Jakob Gruber
9d0b33fd33 Tests: Sync group which includes ignored pkgs
* FS#19854 (--ignore is ignored with groups)

* http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html
  (operation aborts when a package from a group is ignored/and user chooses
  not to install it)

If a group member is ignored, we expect
a) a question whether to install
b) after saying 'no' to a), the ignored member not to be installed
c) all other group members to be installed
d) pacman to execute successfully

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:51:38 -05:00
Xavier Chantry
30734c9a4a alpm/sync: very small memleak fix
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:50:32 -05:00
Xavier Chantry
a2d7f6f206 libalpm/remove: fix funny progress bar problem with empty packages
$ pacman -Rd kde-meta

Remove (15): kde-meta-kdewebdev-4.5-1 [0.00 MB]  kde-meta-kdeutils-4.5-1 [0.00 MB]
             kde-meta-kdetoys-4.5-1 [0.00 MB]  kde-meta-kdesdk-4.5-1 [0.00 MB]
             kde-meta-kdeplasma-addons-4.5-1 [0.00 MB]  kde-meta-kdepim-4.5-1 [0.00 MB]
             kde-meta-kdenetwork-4.5-1 [0.00 MB]  kde-meta-kdemultimedia-4.5-1 [0.00 MB]
             kde-meta-kdegraphics-4.5-1 [0.00 MB]  kde-meta-kdegames-4.5-1 [0.00 MB]
             kde-meta-kdeedu-4.5-1 [0.00 MB]  kde-meta-kdebase-4.5-1 [0.00 MB]
             kde-meta-kdeartwork-4.5-1 [0.00 MB]  kde-meta-kdeadmin-4.5-1 [0.00 MB]
             kde-meta-kdeaccessibility-4.5-1 [0.00 MB]

Total Removed Size:   0.06 MB

Do you want to remove these packages? [Y/n]
( 1/15) removing kde-meta-kdewebdev      [------------------------] 100%
$ it stopped here..

On one side, libalpm did not initialize the progress bar at 0 percent.
So with meta-packages that have 0 files, there was only one progress bar
call with percent == 100.

On the other side, pacman callback kept track of the last percent that
it received. When there are only meta-packages, we always received only
100, so pacman believed the progress bar needed not update. Thus only
the first package was actually displayed.

A proper fix for the callback would be to keep track of last package
name to make sure the recorded prev percent applies.

But since we now specify that both Add and Remove should at least send
percent=0 at beginning and percent=100 at the end, there is no need
for that.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-18 16:46:41 -05:00
Xavier Chantry
7237903c66 be_package: read force entry and convert to epoch
We still need to read force entry in epoch-aware pacman, so that when we
install an old force package, EPOCH gets written to the local db.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-14 20:23:13 -05:00
Carlos Diaz
f5059038f2 bash_completion: remove upstream deprecated functions
Populate $cur and $prev with the new bash-completion 1.2 function,
_get_comp_words_by_ref.

_get_cword and _get_pword have been deprecated.

Signed-off-by: Carlos Diaz <839273@gmail.com>
2010-10-14 06:53:12 -05:00
Dan McGee
de5f438aef Merge branch 'maint' 2010-10-13 23:42:35 -05:00
Dan McGee
73886504d7 Add several pactests for epoch code
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:27 -05:00
Dan McGee
93718046d7 Add epoch verification to makepkg
If defined, it must be an integer.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:27 -05:00
Dan McGee
0d5fa576b3 Update contrib/ for epoch
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:27 -05:00
Dan McGee
8aa7ed5a7e Add epoch support to pactest
This adds epoch support to pactest, while still producing packages and
database entries the same way makepkg and repo-add currently do in a
backward compatible fashion (still including the 'force' option).

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:26 -05:00
Dan McGee
6f37ba61ed Make repo-add and makepkg epoch-aware
Allow it to be a variable in the PKGBUILD as well as propagating it through
to the built package and the package database. We leave some backward
compatibility in place by placing the '%FORCE%' option in the database if
the package contains an epoch; this will be used by older versions of pacman
and more or less ignored by versions that use epoch.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:26 -05:00
Dan McGee
42893e7165 Update documentation to reflect new epoch package variable
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:26 -05:00
Dan McGee
feb9889f22 Add epoch support to pacman/libalpm
This will allow for better control of what was previously the 'force' option
in a PKGBUILD and transferred into the built package.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:29:26 -05:00
Dan McGee
ef32aa0219 Small tweaks after backend merge
Just a few small things I noticed looking through the code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-13 23:09:20 -05:00
Dan McGee
68b50c81c7 Merge remote branch 'allan/backend' 2010-10-13 22:46:04 -05:00
Allan McRae
24d77291da Only write to local repos
We do not write to sync repos so kill the code for that.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:40 +10:00
Allan McRae
5b17d8f27d Clean-up parsing sync database
Remove unnecessary parsing of fields not found in sync desc file.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:40 +10:00
Allan McRae
fbcadebcab Clean-up parsing local database
Remove unnecessary parsing of fields not found in local desc files.
Leave %FORCE% parsing as this likely will make an appearance in desc
files in the future.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:40 +10:00
Allan McRae
d39248120e Remove lazy loading of deltas
Local packages do not have deltas so remove lazy loading of delta
information.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:40 +10:00
Allan McRae
e464339e3b Move and rename splitname
The splitname function is a general utility function and so is better
suited to util.h.  Rename it to _alpm_splitname to indicate it is an
internal libalpm function as was the case prior to splitting local and
sync db handling.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:40 +10:00
Allan McRae
448f78c067 Restrict visibility of checkdbdir and get_pkgpath
These functions are only needed by be_local and were only promoted
to db.{h,c} as part of the splitting of handling the local and sync
dbs.  Move them into be_local.c and make them static again.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:39 +10:00
Allan McRae
5717c7d508 Clean up all old database files and directories
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>
2010-10-14 13:17:39 +10:00
Allan McRae
149ab6b272 Only download sync databases
As the sync databases are read directly from the tarball, we no
longer need to extract them.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:39 +10:00
Allan McRae
4a8e396a58 Parse sync database
Read in package information for a tar based sync database. Do not
use lazy loading for sync db.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:39 +10:00
Allan McRae
5e61f07735 Populate sync db from archive
Read in list of packages for sync db from tar archive.

Breaks reading in _alpm_sync_db_read and a lot of pactests (which
is expected as they do not handle sync db in archives...).

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:39 +10:00
Allan McRae
fc32faaa6a Completely separate local and sync db handling
Put the db_operations struct to use and completely split the handling
of the sync and local databases.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-10-14 13:17:39 +10:00