1
0
forked from mirrors/pacman

Compare commits

...

355 Commits

Author SHA1 Message Date
Roman Kyrylych
afac773d19 New Ukrainian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-26 20:00:10 -05:00
Dan McGee
8263bd0cc2 Updates in preparation for 3.2.1 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-25 18:23:57 -05:00
Xavier Chantry
d6f62ba22d makepkg : allow to specify a download filename
A source entry can now have the following form, to specify a different
filename :
"filename::http://path/to/file"

Of course, the old syntax is still supported :
"http://path/to/file"

And as before, in the second case, the filename used is simply "file".

This fixes FS#11292, because handling multiple source files with the same
name is now possible (just choose a different filename).

But it will also allow to deal much more nicely with funny url like this by
using a sane filename (and unfortunately, there are quite a few) :
http://www.vim.org/scripts/download_script.php?src_id=6992

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-25 18:23:05 -05:00
Xavier Chantry
24d7c6a372 Final updates on all translation for 3.2.1
* Update all .po files because of the last "-q,--quiet" fix.
Also for some strange reason, en_GB was missing a few c-format tags.

* Finally, delete all unused translations.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-25 17:54:22 -05:00
Roman Kyrylych
ece3d3606a Add missing comma to -S --help message
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-25 17:54:05 -05:00
Hugo Doria
81853893a5 Update Portuguese (Brazil) translation
Xav : alignment fixes
2008-08-25 19:55:45 +02:00
Samed Beyribey
eeb3c6868c Update Turkish translation 2008-08-25 19:36:01 +02:00
甘露(Lu.Gan)
cfc52dad98 Update Chinese Simplified translation 2008-08-25 08:34:16 +02:00
Vojtěch Gondžala
49c58ce9db Update Czech translation 2008-08-24 14:10:17 +02:00
Matthias Gorissen
08b0fb856d Update German translation 2008-08-24 14:10:16 +02:00
Sergey Tereschenko
6f38cedd8d Update Russian translation
[Xav: one minor fix to libalpm po file]
2008-08-24 02:04:39 +02:00
Xavier Chantry
68e59ecbaf Update British English translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-08-23 23:38:40 +02:00
Xavier Chantry
91eeee08de Update French translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-08-23 23:36:12 +02:00
Nagy Gabor
05d23059fd Update Hungarian translation 2008-08-23 23:36:12 +02:00
Juan Pablo González Tognarelli
f56d763547 Update Spanish translation
Xav : one minor fix (a missing %s in the downgrading message).
2008-08-23 23:35:21 +02:00
Mateusz Herych
8f99f75e6e Update Polish translation 2008-08-23 23:15:55 +02:00
Giovanni Scafora
4b4ad18348 Update Italian translation 2008-08-23 23:13:12 +02:00
Dan McGee
b0b5dabf1b Update translation files for pending 3.2.1 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 11:21:28 -05:00
Dan McGee
31c7e82a51 Fix 'None' text so we don't have to translate it twice
We had one "None" and one "None\n" string; we can let the program do the
addition of the newline so we don't have to.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 11:20:59 -05:00
Xavier Chantry
5b51dbb11e Cleanup of _alpm_pkg_compare_versions.
* Change the return values to be more informative.

It was previously boolean, only indicating if a sync package was newer than
a local package.

Now it is a simple wrapper to vercmp, handling the force flag.

* Remove the verbose output from _alpm_pkg_compare_versions.

The "force" message is not so useful.
The "package : local (v1) is newer than repo (v2)" message can be moved to
-Su operation.
For the -S operation, it is better to have something like :
"downgrading package from v1 to v2"

* Don't display the "up to date -- skipping" and "up to date -- reinstalling"
messages, when the local version is newer than the sync one.

* Fix the behavior of --needed option to not skip a target when the local
version is newer, and clarify its description.

* Add a new alpm_pkg_has_force function

This allows us to access the pkg->force field like any other package fields.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:47:07 -05:00
Xavier Chantry
e760c4f478 download : disable progressbar when total is unknown.
This is a work around for FS#8725.

There are some bad combination of proxies and mirrors where the Content
Length is not returned, and thus the progress bar can't be displayed
correctly.

Dan: Note that this patch also adds a "downloading" message when the
progress bar is disabled, which was formerly not indicated at all in the
output.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:51 -05:00
Xavier Chantry
081f64aea3 fix HACKING asciidoc file.
The HACKING file seemed to be broken :
http://archlinux.org/pacman/HACKING.html

And indeed, running asciidoc HACKING issued a number of warnings :

WARNING: HACKING: line 27: missing [paradef-default] C-style entry
type:  numbered : expected  1  got  3
WARNING: HACKING: line 44: list item 3 out of sequence
WARNING: HACKING: line 49: missing [paradef-default] C-style entry
type:  numbered : expected  2  got  4
WARNING: HACKING: line 62: list item 4 out of sequence
type:  numbered : expected  3  got  5
WARNING: HACKING: line 69: list item 5 out of sequence
type:  numbered : expected  4  got  6
WARNING: HACKING: line 75: list item 6 out of sequence
type:  numbered : expected  5  got  7
WARNING: HACKING: line 83: list item 7 out of sequence
WARNING: HACKING: line 104: missing [paradef-default] C-style entry
WARNING: HACKING: line 116: missing [paradef-default] C-style entry
WARNING: HACKING: line 126: missing [paradef-default] C-style entry

I just followed the syntax example there :
http://www.methods.co.nz/asciidoc/userguide.html#X56
And all is fine now :)

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:43 -05:00
Xavier Chantry
0969c2e700 pacman : clarify help message.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:36 -05:00
Xavier Chantry
56f0cf9d15 makepkg : localize the Y/n part of the question.
pacman already localizes the yesno stuff, so doing the same in makepkg is
more consistent.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:31 -05:00
Xavier Chantry
96e023c7bd pacman: print optdepends on install and upgrade.
This implements FS#10630.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:25 -05:00
Nagy Gabor
e27a8c9ae3 Add new list_display_linebreak function
list_display puts several members on the same line, which is not appropriate
for optdepends:

Optdepends: foo: feature1  bar: feature2  baz: feature3

The new list_display_linebreak function puts every member on its own line,
which is much better with optdepends:

Optdepends: foo: feature1
            bar: feature2
            baz: feature3

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Xav: implement this new behavior as a new function rather than as a
parameter of list_display]
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:18 -05:00
Nagy Gabor
9451b2e4f2 Move the the description parsing logic to string_display()
So dump_pkg_full will indent all strings correctly.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Xav: add string_length function]
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:11 -05:00
Xavier Chantry
901e4aa5c2 makepkg: do insensitive comparisons of checksums.
This fixes FS#11283 , which was originally reported on the forums :
http://bbs.archlinux.org/viewtopic.php?id=53794

Insensitive comparisons were implicitly made before since md5sum --status was
used for checking. Now that we use openssl and compare checksums manually in
bash, we lost that feature.
This can be easily reintroduced using tr '[A-F]' '[a-f]'

What convinced me to fix it is that the md5 command line tool generates md5sums
in upper case by default :
http://www.fourmilab.ch/md5/

And finally, A-F and a-f are the same in hex and both are used.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:37:19 -05:00
Dan McGee
282eeadc68 Factor shell script size command into configure script
Commit 149839c539 introduced a small behavior regression as a drawback
for a better portability. repo-add now includes the approximate size (to the
nearest KB) rather than an exact size due to the switching of the du command
to a more portable form. Instead of sacrificing the exact size, use
configure to help us determine a valid command to acquire our filesize and
place it in the sync database.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-19 23:29:56 -05:00
Xavier Chantry
9609c0f135 repo-add: add optdepends to the sync database.
See FS#10630.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-19 19:24:56 -05:00
Nagy Gabor
6417ac129d repo-add: Fix whitespaces handling in variables.
repo-add didn't handle whitespaces nicely in fields value, and this has hurt
us several times, first with provision version (FS#9171) and then with
optdepends (FS#10630), so it is time to fix it.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-19 19:24:48 -05:00
Nagy Gabor
729651a554 Remove an usused variable from alpm/util.c/_alpm_lckmk()
Probably a tweakable "lockdb-retry" option was planned which is not
implemented. (Now it should be implemented in front-end.)

So now this variable was unused and caused a small memleak.
(FREE(dir) was not reached in case of error.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-19 18:43:46 -05:00
Xavier Chantry
232b838a54 libalpm/add.c : ensure the old pkg was fully loaded.
This fixes FS#11218.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-19 18:42:51 -05:00
Xavier Chantry
fb5c5086e1 pacman.c: fix typo s/NoPassiveFTP/NoPassiveFtp
This fixes FS#11203.

The doc has always mentioned NoPassiveFtp, but an inconsistency was
introduced with commit 76f816b9f7 when case
sensitive comparision was introduced, and was only found after commit
b3e6cf652c which dropped the case insensitive
comparison.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-19 18:42:42 -05:00
Xavier Chantry
a28b8e187f pacman.conf : add curl example for XferCommand.
curl is likely to be available on the majority of systems and supports the
file:// protocol.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-13 21:13:16 -05:00
Xavier Chantry
89c2c51964 pacman/callback.c : fix detection of totaldownload
This fixes FS#11180.

The usage of the total percent was detected like this :
/* use disp_percent if it is not 0, else show bar_percent */

However, it is very possible that the total percent is 0 at the beginning,
if the first packages downloaded are very small compared to the total
download.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-13 21:13:10 -05:00
Allan McRae
a23fc08758 Fix error when sourcing profile script
With the "set -e" property set, a failure when sourcing /etc/profile
can cause makepkg to exit without error message.  The bash-completion
package activates this bug.  Fixes FS#11179.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-13 21:09:38 -05:00
Allan McRae
57bd8974c7 Fix creation of source package with local source files
Fixes FS#11149.

Signed-off-by: Allan McRae <allan@archlinux.org>
2008-08-09 07:23:37 -05:00
Dan McGee
d8f8a12665 Fix segfault on x86_64 when using UseSyslog
Due to differences in handling va_list between i686 and x86_64, this bug
can only be seen on x86_64. va_list usage is not allowed but we had been
getting away with it. See
http://lists.opensuse.org/opensuse-programming/2008-02/msg00005.html
for details and explanation.

This fixes FS#11096.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-08 22:18:00 -05:00
Dan McGee
57393eb730 Fix variable naming issues in _alpm_db_cmp
When this function got a rewrite in commit f43805d875, argument and variable
names got a bit mixed up when separating the casts from the strcmp
operation. Fix the mixup which also fixes a possible segfault when this
function is called.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-08 13:45:46 -05:00
Dan McGee
f201f107db doc: allow asciidoc to format the note
By doing the bolding manually, it doesn't look as cool in the HTML generated
manpages. Let asciidoc do the work.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-07 13:11:20 -05:00
Xavier Chantry
72c5a298a3 Avoid double slashes in URLs given to libdownload.
If a Server specified in pacman.conf had a trailing slash, libalpm ended up
building URLs with double slashes, and this broke libdownload with errors
like the following one :

error: failed retrieving file 'redland-1.0.8-1-i686.pkg.tar.gz'
from 192.168.0.90 : Command okay

So the public function alpm_db_set_server will make sure to remove the
trailing slash of servers.  For the private function
_alpm_download_single_file, I only added a comment.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-05 19:30:29 -05:00
Xavier Chantry
4476598e4e dload.c : drop the specific handling of file: url.
Before commit fc48dc31, file:/// urls forced the use of the internal
downloader (libdownload), because the default XferCommand, wget, does not
handle them.  We tried to move away from forcing usage of libdownload, so
this commit implemented the handling of file:/// urls manually. However,
this implementation is way too basic. It does not handle the progress bar,
thus nothing at all appears in pacman's output when a file: repo is
synchronized, or when a file is downloaded from a sync repo. Also, it is not
able to detect when the repo is already up-to-date. When libdownload was
used, both were handled.

It seems better to just drop this implementation for now. All users who use
libdownload will get the much better file:// handling back. For the users of
XferCommand, it will be more problematic, but they have several options:

1) Switch to a downloader handling file:// (wget doesn't, but curl does for
example).
2) Drop the file:// repo, and set up light http or ftp servers instead.
Consider that going that way would make this repo available for the whole
local network, which can be useful.
3) Switch back to libdownload, which works perfectly for many users.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-05 09:58:52 -05:00
Xavier Chantry
9bc799ec7b makepkg: fix download functions with weird urls.
This fixes FS#11076.

1) quote the url in get_downloadclient
2) only enable nullglob where it is needed
You can see in 7fc306cd41 that nullglob was only enabled for one part, and
that it already caused other problems, which were fixed in 7ff5a917fd.
Thanks to Henning Garus for pointing out that nullglob was problematic with
urls containing expansion char like '?'.
3) change get_downloadcmd which displayed the download command line to
download_file which actually executes the download. It seems nicer that way.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-04 13:11:18 -05:00
Dan McGee
692ea72822 makepkg: Clarify usage instructions for --allsource/--source
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-04 13:02:58 -05:00
Dan McGee
fabf7ad6c4 Version bumps to configure for 3.2.0 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-30 19:28:07 -05:00
Xavier Chantry
8485b7b3a4 NEWS: updates from ML
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-30 07:25:23 -05:00
Xavier Chantry
115dcf0911 Final update of all translations.
Two recent commits slightly broke the translations, so this fixes all of
them.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-30 07:24:32 -05:00
Xavier Chantry
5949936777 Update README file.
Several pieces of information were outdated for the 3.2 release.  Add a
section for the API changes between 3.1 and 3.2.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
[Dan: small updates/grammar corrections]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 22:33:26 -05:00
Dan McGee
a7244e6ab2 Further updates to submitting-patches
Xavier started the job, this should clean it up and get it up to date that
final bit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 22:25:02 -05:00
Xavier Chantry
5d6788b36e Update submitting-patches file.
The submitting patches page needed a bit of updating. It was currently a
mash-up between the pre and post git eras.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 22:24:42 -05:00
Xavier Chantry
6ede1a5af0 makepkg: Fix STRIP_DIRS test.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 21:57:17 -05:00
Xavier Chantry
0e0a846135 makepkg : use /etc/profile
This fixes FS#9486.
source /etc/profile instead of all individual files in /etc/profile.d/*
(which is done by /etc/profile anyway).

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 21:48:20 -05:00
Nagy Gabor
428b2fd8cc Put CleanMethod to pacman.conf (commented out)
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 21:46:55 -05:00
Nagy Gabor
9a6fd1b021 Remove UseColor from front-end
This option wasn't used.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 21:46:42 -05:00
Nagy Gabor
e4b1a97ff2 New fileconflict005.py pactest
This makes the fileconflict004.py test complete.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 21:46:36 -05:00
Robson Roberto Souza Peixoto
85f5279ec0 Small fix to pt_BR translation.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-29 21:46:08 -05:00
Giovanni Scafora
20a0b8e201 Small fix to Italian translation
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-25 07:14:55 -05:00
Dan McGee
3bf9448943 vercmptest: fix binary existence check
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-25 07:12:04 -05:00
Dan McGee
cf25884e99 pactest: exit with a non-zero error code on unexpected failure
This will allow the return code of pactest to be useful, for such things as
use in a git-bisect test script.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:29 -05:00
Dan McGee
9f57921467 pactest: add test.expectfailure option for tests
This will enable us to mark tests we know currently fail to differentiate
them from those that we know should pass. Regressions should be easier to
spot this way.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:29 -05:00
Allan McRae
7bc34ccde3 Update NEWS file for 3.2.0 release
Signed-off-by: Allan McRae <allan@archlinux.org>
[Dan: updates of my own + some from ML]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:29 -05:00
Xavier Chantry
b8e306b73e Implement AND based package searching.
This fixes FS#2334.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
[Dan: add some comments to the code]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:29 -05:00
Xavier Chantry
8877c88def Show number of packages to be installed / removed.
This fixes FS#7794.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:29 -05:00
Xavier Chantry
dfae7bdd52 src/pacman : rework the display_targets function.
We had a lot of duplicated code here. The code handling the showsize option
needed to be there three times :
1) for install part of -S
2) for remove part of -S (conflict removal)
3) for -R

This patch introduce a new display_targets(pkglist, install) function which
can handle the 3 cases above. We pass install == 1 for case 1), and install
== 0 for case 2) and 3).

Now we can finally get the benefit of an old patch which handled the
ShowSize option consistently in the 3 cases above, without an awful lot of
duplicated code :
http://www.archlinux.org/pipermail/pacman-dev/2008-January/011029.html

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:29 -05:00
Dan McGee
e6fb229534 Remove unused strverscmp substitute
Our internal vercmp function was the only user of this, and it no longer
relies on it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:28 -05:00
Dan McGee
5078ca580e pacsearch: quote args passed to pacman
Something such as "pacsearch foo|bar" would cause problems due to the
quoting being dropped. Adding quotes solves the problem.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:28 -05:00
Xavier Chantry
310b13a4b7 libalpm/package.c : fix infolevel bug in pkg_dup
The pkg_dup function shouldn't call any alpm_pkg_get_ accessors because
this can fill the old package with all INFRQ_DESC fields for example, and
this won't necessarily be reproduced in the new package (for all the fields
that were copied before).

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:28 -05:00
Carlo Bersani
c317222d71 contrib: add pactree script
Pactree is a dependency tree viewer for installed packages.
It features both textual and graphic (through graphviz) output.

Script by: Carlo Bersani <carlocci@gmail.com>
[Allan: removed whitespace errors]
Signed-off-by: Allan McRae <allan@archlinux.org>
[Dan: killed some unnecessary lines, moved license header]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:28 -05:00
Allan McRae
67f388c3fc makepkg: add packages to pkgdeps list only after successful install
This fixed FS#9403.  With this you can use "makepkg -sr", install the
dependencies, Ctrl+c during the makedepends installation and have
makepkg remove the installed packages on the exit.  Previously makepkg
tried to also remove the makedepends which were not installed.

The deplist="" line in remove_deps is due to an obscure bug where local
varaibles from the handle_deps function seem stay in scope because we
never formally exited it.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:28 -05:00
Dan McGee
5e4882dfe8 Fix vercmp and add additional tests
This vercmp issue has been a sticking point but this should resolve many of
the issues that have come up. Only a few minor code changes were necessary
to get the behavior we desired, and this version appears to beat any other
vercmp rendition on a few more cases added in this commit.

This commit passes all 58 vercmp tests currently out there. Other 'fixes'
still fail on a few tests, namely these ones:

test: ver1: 1.5.a ver2: 1.5 ret: -1 expected: 1
  ==> FAILURE
test: ver1: 1.5 ver2: 1.5.a ret: 1 expected: -1
  ==> FAILURE
test: ver1: 1.5-1 ver2: 1.5.b ret: 1 expected: -1
  ==> FAILURE
test: ver1: 1.5.b ver2: 1.5-1 ret: -1 expected: 1
  ==> FAILURE
4 of 58 tests failed

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:28 -05:00
Nagy Gabor
075b244be2 -Sqg and -Qqg
With --quiet, "pacman -Sg grp" and "pacman -Qg grp" don't list group names.

Note that "pacman -Qgq" and "pacman -Sggq" (without targets) still list
group names becuase their output would not be very useful without them.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:50:35 -05:00
Nagy Gabor
69f00385a9 Update pactest README
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:50:10 -05:00
Nagy Gabor
06a4a5bd68 Re-enable --debug with -Sw and -Sp
Commit 8741908276 disabled --debug in these
cases. We just clear PM_LOG_WARNING flag now.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:49:30 -05:00
Nagy Gabor
22722261cc New fileconflict004.py pactest
Thread: http://www.archlinux.org/pipermail/pacman-dev/2008-July/012465.html

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2008-07-22 19:47:35 -05:00
Hugo Doria
24783e6b6b Update Portuguese (Brazil) translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-07-22 19:47:01 -05:00
Mateusz Herych
c9550e9655 Update Polish translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-07-22 19:47:01 -05:00
Sergey Tereschenko
a7ee8f90f9 Update Russian translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-07-22 19:47:01 -05:00
Vojtěch Gondžala
12e804511a Update Czech translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-07-22 19:47:01 -05:00
Jeff Bailes
6d4f235af9 Update British English translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-07-22 19:47:01 -05:00
Samed Beyribey
441c2dd550 Update Turkish translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-07-22 19:47:00 -05:00
甘露(Lu.Gan)
27f56304d6 Update Chinese Simplified translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:46:56 -05:00
Nagy Gabor
501ce943e6 Update Hungarian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:46:12 -05:00
Juan Pablo González Tognarelli
b169925c1e Update Spanish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:46:11 -05:00
Giovanni Scafora
c1a648137e Update Italian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:46:11 -05:00
Matthias Gorissen
4ebad47ae7 Update German translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:46:11 -05:00
Xavier Chantry
ad697d2fd5 Update French translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-22 19:46:11 -05:00
Xavier Chantry
991dfca90e Update pot files.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-07-22 19:46:11 -05:00
Allan McRae
ae9e33ed88 Make strip paths configurable
This patch introduces a new STRIP_DIRS makepkg.conf option
to change makepkg's search path when stripping binaries.

Original work by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-20 19:06:14 -05:00
Nagy Gabor
b4f2cb53ef Rephrase some debug messages in alpm/sync.c
Debug messages were removed from _alpm_sync_find, because it is a general
purpose function; debug messages should be placed in the caller function.

I inserted "adding package foo-1.0-1 to the transaction targets" debug
message to find_replacements and sync_sysupgrade.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-19 11:05:17 -05:00
Nagy Gabor
2b73d45127 Use NULL instead of "" as no causingpkg
Our STRDUP macro (used in _alpm_depmiss_new) is NULL safe.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-19 11:04:38 -05:00
Allan McRae
a8405847e6 Strip *.a libraries in makepkg
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-19 11:03:10 -05:00
Allan McRae
99be5ab8d1 Use LC_ALL=C everywhere
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-19 11:03:03 -05:00
Nagy Gabor
471ed04790 alpm_list_remove treat NULL needle as "nothing"
So if you want to remove NULL needle from a list, alpm_list_remove will
return with "not found".

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-17 20:20:13 -05:00
Nagy Gabor
5929508198 Fix a possible segfault in alpm/remove.c
Before removing a package from target list (in remove_prepare_keep_needed),
we should check whether we have already removed it.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-17 20:20:06 -05:00
Nagy Gabor
03021713e5 _alpm_db_add_pkgincache rework
Commit 8240da6cb3 broke some alpm hierarchy
and introduced a new memleak (trans->packages was never freed in case of add
transaction, even if the transaction wasn't committed), so it is reverted
now.

We follow a different approach to reduce memory usage:
_alpm_db_add_pkgincache doesn't duplicate the whole package before adding
it to the cache, only the package name and version (INFRQ_BASE).
This method needs very small extra memory (compared to the reverted method),
and after transaction commit we use less memory than before (since the
big 'files' fields are not copied to cache), this is useful in GUIs.

Note: The old add_pkgincache was a bit broken, since pkg->origin wasn't
filled in correctly.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Acked-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:16:42 -05:00
Nagy Gabor
ffa3056010 Use "pacman -S $dep" in makepkg's dependency resolving
This method is equivalent with pacman's resolvedeps.
$dep can be any (versioned) dependency.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:14:23 -05:00
Nagy Gabor
37b5972212 Fix some memleaks in alpm/add.c
In case of error some allocated memory wasn't freed in commit_single_pkg.
Note: The return value of this function is not used.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:13:30 -05:00
Nagy Gabor
17e9c9d9ff Fix a wrong FREELIST usage in add.c
The dynamic pmconflict_t must be freed with _alpm_conflict_free.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:12:22 -05:00
Dan McGee
0bf66b097f makepkg: speed up svn revision check for large repositories
Using the suggestion from FS#10905, use 'svn info' rather than 'svn log' to
get the current revision number, which is much quicker for large Subversion
repositories. Eventually git will rule the world. :)

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:09:15 -05:00
Dan McGee
95995ae93f Remove pacman.static build from build files
This presents plenty of problems on OSes besides Linux, and even on Linux
when the libtool file for libarchive isn't present. The static build isn't
all that useful anyway as missing something such as glibc will still leave
you unable to run the pacman.static binary. Remove it from the formal build
process.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-15 19:05:24 -05:00
Xavier Chantry
8741908276 src/pacman/sync.c : Display only errors with -Sp and -Sw operations.
In particular, this avoids warnings cluttering the output of these
operations.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-13 09:19:24 -05:00
Nagy Gabor
fd8969f678 sync_addtarget rework
Now '-S provision' handling is done in the back-end.

In case of multiple providers, the first one is selected (behavior change:
deleted provision002.py). The old processing order was: literal, group,
provision; the new one: literal, provision, group. This is more rational,
but "pacman -S group" will be slower now. "pacman -S repo/provision" also
works. Provision was generalized to dependencies, so you can resolve deps by
hand: "pacman -S 'bash>2.0'" or "pacman -S 'core/bash>2.0'" etc. This can be
useful in makepkg dependency resolving. The changes were documented in
pacman manual.

alpm_find_pkg_satisfiers and _alpm_find_dep_satisfiers functions were
removed, since they are no longer needed.

I added some verbosity to "select provider instead of literal" and
"fallback to group".

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-13 09:16:55 -05:00
Nagy Gabor
f724fb2702 remove_addtarget rework (in front-end)
Now "pacman -R foo" first searches for literal, and then for group.
This is faster in most cases, see:
http://www.archlinux.org/pipermail/pacman-dev/2008-July/012311.html

"-R group" implementation was broken, since alpm_grp_get_pkgs returns with
an pmpkg_t list, not a string list.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-13 09:15:07 -05:00
Nagy Gabor
1d9d47d62c New remove060.py pactest
This is a group removal test.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-13 09:14:36 -05:00
Dan McGee
b196cc43a5 Merge branch 'maint' 2008-07-07 21:39:42 -05:00
Nagy Gabor
d92b0e674d Fix a bogus message in Hungarian translation
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:30:42 -05:00
Nagy Gabor
30702350fa Remove requiredby from pactests
Also remove some meaningless pactests (broken requiredby, requiredby*.py
tests). requiredby001.py was renamed to upgrade076.py.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:14:13 -05:00
Nagy Gabor
72c0ab5c51 Resolvedeps rework
I divided resolvedeps into 2 functions. The new _alpm_resolvedep function
will resolve one dependency, for example the 'foo>=1.0-1' dependency.  It
can be useful in sync_addtarget refactoring.

The resolvedeps parameters were changed, to be coherent with recursedeps:
* the target-list is an alpm_list* instead of alpm_list**. This is OK,
  because alpm_list_add == alpm_list_add_last
* syncpkg param was removed. list contains the to-be-installed packages,
  resolvedeps will add the required dependencies into this list
* trans param was removed, it was used in QUESTION() only, which can be used
  on the main (handle->trans) transaction only (because the front-end cannot
  access our pseudo-transactions at all!).

The patch fixes some wrong dynamic pmdepmissing_t usage.

I did a behavior change (and sync1003.py was modified accordingly), which
needs some explanation: The old resolvedeps didn't elect packages from
'remove' list. I've dropped this because I don't want that 2nd excluding
list param. In fact, in real life, we ~never need this rule. Resolvedeps is
called before checkconflicts, so only -Su's %REPLACES% packages are sitting
in 'remove' list. This means, that we have the replacement packages in our
target list. Usually "foo replaces bar" means, that bar isn't in our repos
any more, so resolvedeps *cannot* elect it; but usually it won't try it at
all, because foo is in the target list, and it is expected to satisfy
'bar>=1.0-1'-like dependencies too. Since checkdeps and checkconflicts is
done after resolvedeps, this cannot cause any harm.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:12:55 -05:00
Nagy Gabor
8856146d71 Swap parameters on PM_TRANS_CONV_INSTALL_IGNOREPKG callback function
PM_TRANS_CONV_INSTALL_IGNOREPKG callback function can get 2 params: foo, bar
in this order (packages), bar can be NULL.

Old API:
foo, NULL: Do you want to install foo from IgnorePkg?
foo, bar: foo requires bar from IgnorePkg. Do you want to install bar?
New API:
foo, bar: Do you want to install foo from IgnorePkg? (If bar!=NULL:) bar
requires it.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:12:30 -05:00
Nagy Gabor
616b5967b8 New _alpm_find_dep_satisfier function
This function finds the first satisfier package in a pkglist. Using it
instead of _alpm_find_dep_satisfiers eliminates some memleaks and it is
faster. (_alpm_find_dep_satisfiers and _alpm_find_pkg_satisfiers will be
removed soon.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:04:37 -05:00
Nagy Gabor
f7199f36ba New _alpm_dep_edge function
The function is introduced to kill some code duplication. The function name
uses the 'dependency graph' terminology.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:04:16 -05:00
Nagy Gabor
2122eb1428 Don't duplicate packages in requiredby list
This is a "fix" for FS#10226. I think that multiple versioned dependencies
are quite common now, and the old behavior is quite annoying there. This
patch won't cause any slow-down.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-07 21:03:52 -05:00
Nagy Gabor
5f701005ed Use $PKGEXT (from /etc/makepkg.conf) in bacman
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-01 21:08:50 -05:00
Xavier Chantry
11695bd0d7 repo-add cleanup.
* change ln -s to ln -sf in the Makefile to prevent a failure when the link
already exists.
* make test_repo_db_file simpler and more natural, move the complexity out
of it.
* remove one $cmd = repo-remove check that wasn't needed

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-29 17:37:45 -05:00
Allan McRae
d534488f2d Remove symlinks to libtool files
This prevents dangling symlinks to removed libtool files when
the !libtool option is used.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-27 09:07:39 -05:00
Carlo Bersani
b15fb504a1 bacman: fix issue with symlink early copy
test -e tries to resolve the link before testing, so if the link is copied
before the actual file, the script exited. This fixes the issue.

[Dan: also add some improved quoting in the script]

Signed-off-by: Carlo Bersani <carlocci@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-22 21:21:05 -05:00
Allan McRae
74eb2f5c61 Additional path quoting and srcdir/pkgdir usage
Removes the remaining $startdir/{src,pkg} usage and adds quoting
around (hopefully) all remaining path variables

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-22 21:12:39 -05:00
Dan McGee
7edb2e5b0d Add information on version comparison to manpages
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-19 19:28:56 -05:00
Dan McGee
d594b6e797 Merge branch 'maint' 2008-06-19 08:51:36 -05:00
Dan McGee
5c6809987e makepkg.conf: make keeping docs the default
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-19 08:50:17 -05:00
Dan McGee
deec3c8d00 autoclean.sh: Fix paths to po/ dir
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-19 08:47:44 -05:00
Alper KANAT
d88524ea0e Add libalpm Türkçe (Turkish) translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-19 08:46:56 -05:00
Dan McGee
29bf6814f7 Use access() instead of stat() when possible
We were using the stat() system call in quite a few places when we didn't
actually need anything the stat struct returned- we were simply checking for
file existence. access() will be more efficient in those cases.

Before (strace pacman -Ss pacman):
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 33.16    0.005987           0     19016           stat64

After:
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 34.85    0.003863           0     12633         1 access
  7.95    0.000881           0      6391         7 stat64

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15 22:52:27 -05:00
Xavier Chantry
7ff5a917fd makepkg: add several quotes needed after nullglob.
After the "shopt -s nullglob" change, all regular expressions should be
properly quoted.
This commit only fixes the ones I found, there are probably others left, so
this should be kept in mind for easier future fixing.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15 13:53:15 -05:00
Xavier Chantry
b9445c12cf makepkg: Add missing quotes for the source array.
Now makepkg can handle filenames with whitespaces in the source array.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15 13:52:54 -05:00
Sebastian Nowicki
b8a66d6859 Use openssl for checksum verification instead of *sum utilities
md5sum, sha1sum, etc, do not exist on BSD systems by default. Openssl is a
good portable alternative. This also brings in a dependency for openssl.

Closes FS#10530.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-15 13:52:03 -05:00
Dan McGee
2158b8e298 Expand PKGBUILD documentation
Add documentation for $startdir, $srcdir, and $pkgdir variables, as well as
general information about the build() function and about custom variables
in PKGBUILDs. This addresses FS#10634.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 12:00:43 -05:00
Dan McGee
fff746052c Document pacman -q/--quiet operation
Fixes FS#10644.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 12:00:40 -05:00
Dan McGee
a1dfa8e61f Combine repo-add and repo-remove into one script
They shared about 75% of their code, so there is no real reason we should
maintain them separately. Merge the differences accordingly and add a check
based on the basename of the command used to decide what behavior to follow.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 11:31:18 -05:00
Dan McGee
89819b3f92 repo-*: allow use of readlink or realpath
Linux coreutils provides readlink, and BSD systems tend to have realpath
available. Both commands provide similar functionality but of course have
different names. Add a check for either and use what is available.

While doing this, also unify some of the differences that have cropped up
between repo-add and repo-remove.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 10:48:28 -05:00
Allan McRae
c11bdf19b1 Move geninteg block in makepkg before error checking
This patch moves the generating of integrity checks to before any
error checking takes place in the PKGBUILD file.  This allows integrity
generation to complete when unrelated errors exist in a PKGBUILD file
and allows the removal of multiple checks of the GENINTEG variable that
would otherwise be needed.

In addition a minor fix is made to a comment.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14 08:35:40 -05:00
Dan McGee
7313c8546a Merge branch 'maint' 2008-06-12 19:21:06 -05:00
Xavier Chantry
331891ceb1 fr.po : fix one minor alignment problem.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-06-12 19:20:39 -05:00
Alper KANAT
6d737254fc Add pacman Türkçe (Turkish) translation
No libalpm translation yet.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-12 19:14:16 -05:00
Juan Pablo González Tognarelli
0077bfa3a0 Spanish translation updates
Fixes to old translations and new strings for upcoming 3.2 release.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-12 19:10:43 -05:00
Dan McGee
7fc306cd41 Use shell builtin to list files for package inclusion
On BSD systems, as super user, the 'ls' command displays all dot files by
default, causing these to get included when not intended. If we use the bash
glob operator, we can avoid issues with ls on different platforms; however,
we need to turn the nullglob shell option on first to ensure we don't have
problems in empty directories.

Originally-noticed-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-12 19:06:14 -05:00
Dan McGee
1824bc6ee6 Allow use of GIT_VERSION in documentation dir
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-08 17:26:02 -05:00
Dan McGee
f827c9572e makepkg: remove deprecated --usesudo code
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-08 17:25:28 -05:00
Allan McRae
4979157cba makepkg: add --allsource option
This supplements the --source option and does nearly the same thing, except
downloaded source files are included in the archive as well. The sources are
now packages with a pkgname/ prefix.

Original-work-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-08 17:16:40 -05:00
Dan McGee
0fc538fcdb Various updates needed prior to a new release
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-08 13:50:01 -05:00
Thomas Bächler
512282ca54 Minor fix to German translation
Signed-off-by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-07 15:30:55 -05:00
Allan McRae
fcac23763b bacman - regenerate package from system
Original work by Carlo "carlocci" Bersani with additions by
Xavier Chantry and Allan McRae

This script rebuilds an already installed package using metadata
stored into the pacman database and system files.  Replaces the
outdated re-pacman script

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-06 07:01:22 -05:00
Dan McGee
b04d6e751a Reformat -Sg output to look like -Qg
We used list_display() on -Sg output, which might have been slightly nicer
looking but made it much harder to parse in something like a shell script.
Reformat it in the 'grpname pkgname' format that -Qg is already using.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-05 14:36:35 -05:00
Xavier Chantry
5ae02e6ae7 Don't display filename on -Qip operation.
Some previous commits apparently broke the get_filename function for package
loaded with pkg_load (on a -Qip operation) because this field was no longer
filled. Now pkg_load fills it.
But the -Qip operation needs to be run like this : -Qip <filename>, so the
filename is already known. There is no need to display it again.
Besides, on a normal -Qi operation, the filename is not displayed either
because this information is not stored in the local database.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04 16:25:31 -05:00
Xavier Chantry
d030d12542 src/pacman/sync.c : cleanup of pacman_sync
By putting the search / group / info / list operations just after the -Sy
op, we can simplify several checks :
1) the check for "missing targets". Since we took care of the above
operations, we now have less cases to consider :
* -Syu or -Su : we can proceed
* -Sy : we can end now (this is actually a bugfix)
* -S : this op requires targets, so exit with an error
2) the check to see if a transaction is needed. If we arrive at the end of
the function, it is either because we have -Su or -S <targets> so we already
know a transaction is needed there.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04 16:25:31 -05:00
Xavier Chantry
0966c33a72 Get rid of double / in database paths.
Errors like the following one happen regularly (for unknown reasons...) :
error: could not open file /var/lib/pacman/local//glibc-2.7-9/depends: No
such file or directory

Anyway, every time an user reported an error like that, it always seemed
like he thought the error was caused by the double /, which is obviously
wrong.

Since db->path always include a trailing /, there is no need to add one when
concatenating paths in be_files.c or add.c.
Additionally, some static strings were switched to dynamic.
And the computation of the "dbpath"/"pkgname"-"pkgversion" was refactored
in db_read, db_write and db_remove with a get_pkgpath static function.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04 16:25:27 -05:00
Dan McGee
fe781e4ce4 Reimplement TotalDownload functionality
Add a new totaldlcb callback function to libalpm and make pacman utilize it
when the TotalDownload option is enabled. This callback function is pretty
simple- it is meant to be called once at the beginning of a "list download"
action, and once at the end (with value 0 to indicate the list has been
finished). The frontend is responsible for keeping track of adding
individual file download amounts to the total xfered amount in order to
display some sort of overall progress.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04 15:38:53 -05:00
Dan McGee
0669c9bfac Use correct C type for file sizes
We have been using unsigned long as a file size type for a while, which
works but isn't quite correct and could easily break. Worse was probably our
use of int in the download callback functions, which could be restrictive
for packages > 2GB in size.

Switch all file size variables to use off_t, which is the preferred type for
file sizes. Note that at least on Linux, all applications compiled against
libalpm must now be sure to use large file support, where _FILE_OFFSET_BITS
is defined to be 64 or there will be some weird issues that crop up.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04 15:38:47 -05:00
Dan McGee
62b4195c76 libalpm/md5: Fix license header
This was mistakenly referencing the LGPL even after the XySSL code bump, so
fix the license clause to be correct.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-03 21:31:31 -05:00
Anton Fiuman
4a802838cb Don't require --force when using the --nobuild option
makepkg should not abort with error when a user uses the --nobuild option to
extract sources if a package has already been built.

Signed-off-by: Anton Fiuman <llexiw@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-01 23:49:38 -05:00
Dan McGee
5f0692def8 makepkg: remove some dead TODO code
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-31 12:06:45 -05:00
Dan McGee
636610432a Allow GIT version to be used in pacman builds
Add a new configure flag, --enable-git-version, that allows the output of
'git describe' to be used in the version string associated with this
package. This could aid in debugging for users that are using a development
version of pacman and we should be able to figure out which cut of code they
are using.

Sample output:
$ pacman --version
Pacman v3.1.4-190-g4cfa-dirty - libalpm v2.3.1

$ makepkg --version
makepkg (pacman) 3.1.4-190-g5861-dirty

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-31 12:06:34 -05:00
Dan McGee
54e1e3e642 Fix versioncmp regression after update
Commit 8428367285 introduced the regression,
and a previous commit introduced the vercmptest.sh test script to track down
these issues. This commit solves the problem by removing the previous
attempt at locating the pkgrel portions and replacing it with something that
performs the correct logic.

While tracking down everything I needed to, I also found a mistake in one of
the pactests which is fixed here as well as increased the functionality and
verbosity of the vercmptest script to both print out each test it is running
as well as automatically run the mirror of each test case.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-30 16:54:15 -05:00
Dan McGee
2cd0a87b3f Add simple vercmp test script
Commit 8428367285 updated the versioncmp code
in libalpm. Unfortunately for us, it also introduced the regression that
becomes apparant with the following upgrade:

warning: sonata: local (1.5-2) is newer than extra (1.5.1-2)

Add a vercmptest.sh test script that is run during the make check phase
which now points out three regressions in the version comparison function
that will need fixing. All current tests in this script pass with the old
versioncmp code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 17:25:37 -05:00
Dan McGee
b48f703aa6 Add missing NULL set in group printing
If we don't set the pkgname var to NULL, we run into all sorts of beautiful
segfault behavior when a group spans multiple repositories and we try to
print out the location of the former list. Easy fix.

This regression was introduced in bf86700369.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 17:25:07 -05:00
Dan McGee
009f89c4d2 Merge branch 'maint' 2008-05-29 06:39:38 -05:00
Geoffroy Carrier
b32aa81b5e Add trailing / to DESTDIR for stupid Makefiles.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:21 -05:00
Allan McRae
62ee1bfff0 Tidy up of the handle struct in libalpm
Removed unused handle->uid from pmhandle_t. The need to check permissions
should be determined by the frontend (and is in pacman).

Fixed comment on noextract in pmhandle_t.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:21 -05:00
Xavier Chantry
1cca4ef764 Remove PM_TRANS_EVT_EXTRACT_START.
This event was unused, was missing the equivalent EXTRACT_DONE event, and
was useless because we already have ADD / UPGRADE START and DONE events.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:21 -05:00
Xavier Chantry
b262ddb2ed be_files : stores REPLACES and FORCE in desc.
repo-add and db_read both assume that REPLACES and FORCE fields are in the
desc file, so do that for db_write as well (instead of depends file).

Note that db_write is currently only used on the local database. And the
only purpose of replaces and force in local database is for information
purpose (available on -Qi operations). So this is not a big problem.

Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-May/011859.html

Acked-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:20 -05:00
Allan McRae
f30dab4b5a Pactests for sync operations with NoUpgrade and NoExtract
This adds the sync equivalents of upgrade010.py and upgrade070.py.
Both additional test pass.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Acked-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:20 -05:00
Allan McRae
c1a5616c26 makepkg - add check for valid options in PKGBUILD
This patch removes the code block in makepkg that checked for depreciated
options in a PKGBUILD and provided a workaround.  Unknown and depreciated
options are upgraded to error conditions.

Also, removed TODO regarding including install script if exists and $install
is unset.  That should never happen.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:20 -05:00
Nagy Gabor
da1c11cc30 Add some verbosity to _alpm_db_read.
Name and version are computed from "/var/lib/pacman/..." pathname. And the
%NAME% and %VERSION% fields from the desc file were not even read. So now,
when we read the desc file, we make sure the %NAME% and %VERSION% fields are
consistent.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:20 -05:00
Nagy Gabor
ad54b28680 Fix for remove052.py by moving recursedeps before checkdeps.
In the case of -Rs operation, first pulling the dependencies with
recursedeps before calling checkdeps takes care of the dependency chain of
remove052 pactest.

In the case of -Rcs, we can keep the old behavior because we have no problem
there (any dependency returned by checkdeps will be added to the remove list
because of -Rc) and we have to run recursedeps on the final remove list
anyway to catch all orphans.

Ref.: http://www.archlinux.org/pipermail/pacman-dev/2008-April/011569.html

Signed-off-by: Nagy Gabor <ngaba at bibl.u-szeged.hu>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:20 -05:00
Allan McRae
ae40d1c05b Pactest for removing multiple items in a dependency chain.
This adds a test for when removing multilpe packages recursively from a
chain of dependent packages. This situation can occur when removing
installed dependencies with makepkg if a "makedepend" recursively depends on
a "depend" or if redundant dependancies are included.

Signed-off-by: Allan McRae <mcrae_allan at hotmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:19 -05:00
Allan McRae
9577c07d86 No error in makepkg when removing deps fails
Catches error from when pacman is unable to remove dependencies after
successfully building package and prints warning.  Fixes FS#10039.

Signed-off-by: Allan McRae <mcrae_allan at hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:19 -05:00
Sebastian Nowicki
c33cabd675 Use chown 0:0 instead of root.root
On BSD systems using a dot as a separator is not allowed. On Mac OSX it
is deprecated. A colon should be used instead. BSD systems also use the
"wheel" group instead of "root" to indicate the "super user" group. Both
groups use the id of 0.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Acked-by: Aaron Griffin <aaronmgriffin@gmail.com>
Acked-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:14 -05:00
Sebastian Nowicki
20ae871940 Use "legacy mode" on Mac OSX (for file command)
For some reason `file` on Mac OSX has different arguments than BSD and
Linux; -i no longer prints out the mime strings. With the environment
variable COMMAND_MODE set to "legacy", `file` behaves more like it does
on Linux and BSD, i.e., `file -i` prints the mime type.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Acked-by: Dan McGee <dan@archlinux.org>
Acked-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:14 -05:00
Sebastian Nowicki
b9369a747d Allow an unprivileged user to create packages without fakeroot
When fakeroot was not in BUILDENV and the user was not root, makepkg still
tried to use fakeroot for building packages.
BUILDENV is now checked to see if fakeroot is enabled. If it is not enabled the
package can still be built, but root will not have ownership of files. This is
useful when users want to make packages for personal use and don't care about
ownership.

Closes FS#10450.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:14 -05:00
Xavier Chantry
149839c539 du -b is not available on BSD, use du -k instead.
This fixes FS#10459.

There is apparently no portable ways to get the apparent size of a file,
like du -b does. So the best compromise seems to get the block size in kB,
and then convert that to byte so that we keep compatibility.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:14 -05:00
Sebastian Nowicki
1d71079c5b Replace usage of "cp -s" with the more portable "ln -s"
The "-s" argument does not exist on BSD, and neither does
"--remove-destination". This patch replaces the calls to "cp -s
--remove-destination" with the equivalent "rm -f" and "ln -s" calls, in
order to increase portability.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 06:37:13 -05:00
甘露(Lu.Gan)
398d4aff2d Update of Chinese simplified pacman translation.
Some small adjustements according to feedback from users of chinese forum.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-05-17 12:17:53 +02:00
Dan McGee
bf2964dc58 Fix compilation warning on x86_64
Glad we have so many developers using this as their native architecture.
int/size_t issue here.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14 19:38:58 -05:00
Xavier Chantry
fb09d35e6a Disable geteuid in cygwin.
This is one of those rare cases where we actually want to code in a
platform-specific #ifdef. Because you don't need to be the root user on a
Windows box, and fakeroot doesn't exist so we can do easy testing, lets
disable any checking of the UID.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14 09:17:02 -05:00
Xavier Chantry
33e3182dbd pactest: only use fakeroot when it is found.
Only use fakeroot and fakechroot when they are found AND required.
fakechroot only had the first condition, and fakeroot only the second.

When they are required (user != root) but not found, display a warning.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14 09:15:14 -05:00
Dan McGee
a8ee185413 Remove wrapper call around versioncmp
Actually, just rename _alpm_versioncmp to alpm_pkg_vercmp and get rid of the
need for a wrapper since it did nothing anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14 00:37:51 -05:00
Dan McGee
8428367285 Update _alpm_versioncmp
This code hasn't been looked at in some time. I grabbed a more recent
version of the RPM source (4.4.2.3) and attempted to sync up any changes
they have made, as well as make the libalpm additional code much cleaner and
limited to only a few added lines of code.

The size of this patch might make you think we added code, but bloat-o-meter
actually tells us otherwise:
<function>                                 <old>   <new>  <diff>
_alpm_versioncmp                            1485    1021    -464

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14 00:30:04 -05:00
Dan McGee
dd98aa8564 Simplify _alpm_pkg_new()
Any real call of this function doesn't specify a name or version ahead of
time, so just kill that functionality off. Now to remove those dummy
packages...

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 19:03:54 -05:00
Dan McGee
a422f6e39c Remove lazy init code from pkg name and version functions
If we have a package without name and/or version, we are really out of luck.
Speed these functions up by removing unnecessary code. Note that both the
splitname and pkg_load functions, where the name and version of packages are
initially populated for databases and pkg.tar.gz files respectively, enforce
that every new package struct created has a name and version.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 18:56:55 -05:00
Xavier Chantry
f671147282 Fix rewinddir regression by cleaning up db_scan
Commit 0460038447 caused a regression when
rereading the pkgcache after updating the on-disk databases. A rewinddir
call was errantly removed.

Instead of replacing the call to rewindir, clean up this whole mess.
db_scan is used only once and with target == NULL so there was actually half
the code of db_scan which was unused. This is gone now and replaced by a
single new db_populate function.

Dan: add_sorted ended up being 3x slower than one msort at the end, so I
changed back to that. I also made one pointer variable const and merged this
whole patch with my original fix for the rewinddir issue.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 18:44:13 -05:00
Dan McGee
ae5ef3b90f Remove --builddeps from makepkg
This really should be in an external script, as it is not makepkg's job to
rebuild your system.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 16:01:34 -05:00
Dan McGee
584ffa6aef Remove an outdated exception check in file conflict code
This has been around since at least pacman 2.9.8. Frugalware just dumped it
in commit 113ec73bfcfdc, and deleting it here and running pactest shows that
nothing that we have actually tested changes. If someone can pactest the
edge case where this is needed, then show me the money.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 15:49:02 -05:00
Chantry Xavier
d5278ebb3b Add SyncFirst option.
This patch offers a way to fix FS#9228.
By putting "SyncFirst = pacman" in pacman.conf, the version check will
happen before the transaction really starts, and before any replacements is
made.
Otherwise, no version check is done.

The sync301 pactest was updated to use this SyncFirst option.

Example session with SyncFirst = pacman, and a newer pacman version
available :
$ pacman -Su (or pacman -S <any targets>)
:: the following packages should be upgraded first :
    pacman
:: Do you want to cancel the current operation
:: and upgrade these packages now? [Y/n]

resolving dependencies...
looking for inter-conflicts...

Targets: pacman-x.y.z-t

Total Download Size:    x.xx MB
Total Installed Size:   x.xx MB

Proceed with installation? [Y/n] n

As Nagy previously noted, doing this check on any -S operations might look
intrusive, but it can be required.
For example, the case where you want to install a package with versioned
provisions, using a pacman version which didn't support that feature yet
(and there is already a newer pacman in sync db supporting it).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 15:49:02 -05:00
Chantry Xavier
f43805d875 Cleanup usages of alpm_list_find and alpm_list_remove.
* remove obsolete and unused *_cmp helper functions like deppkg_cmp and
_alpm_grp_cmp

* new alpm_list_remove_str function, used 6 times in handle.c

* remove _alpm_prov_cmp / _alpm_db_whatprovides and replace them by
a more general alpm_find_pkg_satisfiers with a cleaner implementation.
before: alpm_db_whatprovides(db, targ)
after: alpm_find_pkg_satisfiers(alpm_db_getpkgcache(db), targ)

* remove satisfycmp and replace alpm_list_find + satisfycmp usage by
_alpm_find_dep_satisfiers.
before : alpm_list_find(_alpm_db_get_pkgcache(db), dep, satisfycmp)
after : _alpm_find_dep_satisfiers(_alpm_db_get_pkgcache(db), dep)

* remove _alpm_pkgname_pkg_cmp, which was used with alpm_list_remove, and
use _alpm_pkg_find + alpm_list_remove with _alpm_pkg_cmp instead.

This commit actually get rids of all complicated and asymmetric _cmp
functions. I first thought these functions were worth it, be caused it
allowed us to reuse list_find and list_remove. But this was at the detriment
of the clarity and also the ease of use of these functions, dangerous
because of their asymmetricity.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 15:49:02 -05:00
Nagy Gabor
8248b4bfb1 Swap the parameters of alpm_pkg_find
Now the syntax is coherent with alpm_list_find and alpm_sync_find.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 15:49:02 -05:00
Dan McGee
e80232f24c Remove errant include of error.h
This doesn't exist anymore, the header file was removed a while back in
commit 4c872594da.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 15:49:02 -05:00
Dan McGee
663408532a Merge branch 'maint'
Conflicts:

	lib/libalpm/package.c - comment location moved to be_package.c
2008-05-11 20:14:30 -05:00
Dan McGee
13f24a5bda Refactor pkg_load/parse_descfile into a new backend file
alpm_pkg_load() and parse_descfile() are specific to getting information
from package files, just as other code is specific to getting information
into or out of a package database. Move this code out of package.c, which
should eventually only contain operators on the pmpkg_t struct that do not
depend at all on where the data came from.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-11 20:07:55 -05:00
Dan McGee
0460038447 Remove some useless abstraction and start db cleanup
We have some useless abstractions like an alpm_db_rewind function. I've read
somewhere that readdir() was the worst filesystem function call invented,
and what do we do? Add a wrapper around it. Kill this abstraction and move
some other things into be_files that should be there anyway because they
are so tied to how a files backend works.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-11 20:05:59 -05:00
Allan McRae
3c3cb001a4 Make all error messages use pm_fprintf
Tested using many easily generated error conditions.  Also added "malloc
failure" (conf.c) and "segmentation fault" (pacman.c) error messages for
translation.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
[Dan: fix trailing whitespace errors, other compilation issues]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-11 20:05:28 -05:00
Dan McGee
3175faace4 pactest: fix --gdb option
A libtool upgrade broke the gdb option as we need a MODE specified; add the
execute mode to the call.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-11 20:05:14 -05:00
Sebastian Nowicki
e3d35b3274 Add detailed description to alpm_pkg_load
It was unclear what "loading the full package" actually did. The
detailed description should clear that up, without having to look at the
code.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10 15:10:51 -05:00
Chantry Xavier
0bfc8adf37 contrib/paclist: list packages installed from given repo.
The paclist script provides a simple method for monitoring which packages
are installed from a given repo. This is particularly useful when using a
testing or unstable repository.

Thanks to Allan McRae for the idea and an initial bash script. As suggested
by Dan, I tried to rewrite in perl, and this resulted in much better
performance. Then Dan further cleaned up the script.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: add to Makefile & README, minor script cleanups]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10 11:13:24 -05:00
Dan McGee
1ba0d84da2 pacsearch: rewrite in perl
This rewrite in perl blows the socks off the old shell script version for
large searches:

$ time ./pacsearch.perl ^.*$ >/dev/null
real    0m0.836s
user    0m0.593s
sys     0m0.217s

$ time pacsearch.sh ^.*$ >/dev/null
real    1m53.818s
user    1m16.818s
sys     0m33.694s

Functionality and output is identical to the old version with the exception
of the old version's missing EOL after all the output.  It should be a lot
easier to add new things like the --color flag that has been a TODO at the
top of the script for a long time.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10 11:04:17 -05:00
Dan McGee
b49fc504ac Update makepath to remove PATH_MAX usage
The start of a few commits to remove some PATH_MAX usage from our code. Use
a dynamically allocated string instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10 00:51:04 -05:00
Dan McGee
2edd01a973 scripts: add -q/--quiet option to repo-add and repo-remove
They are pretty noisy scripts in their normal course of operations, so allow
all messages to be squashed except for warning and error messages with this
new flag.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10 00:48:55 -05:00
Dan McGee
502645c0e3 makepkg: Unify start and end messages
I've always found it odd why the package version is shown at the start but
not the end of the package build. Fix it, and while we are at it, add the
$CARCH variable to the display too.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10 00:48:47 -05:00
Dan McGee
df5024fd64 Use strdup() instead of a static buffer
We only need a copy of this string once we know we are going to extract it,
and we don't need a static buffer to copy it into since it is coming from a
known-length string.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-08 20:59:59 -05:00
Dan McGee
081ba4816e Update md5 routines
XySSL 0.9 was released; sync our code with the upstream source. Note that
there weren't any real changes besides renaming of macros, so nothing much
to see here.

The biggest change may be the licence- it is now GPL/BSD software rather
than LGPL/BSD. The license header is changed to reflect this.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-08 20:59:18 -05:00
Dan McGee
7fccfc7819 be_files.c: PATH_MAX cleanup
Most of these are not easy to remove, but I could kill the ones in the two
lastupdate functions.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-08 20:59:02 -05:00
Dan McGee
a13bf74979 pacman-side code cleanups
When taking a look at PATH_MAX usage, I found a few small things we can
clean up or fix.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-08 20:58:33 -05:00
Dan McGee
5389cdf654 Merge branch 'maint' 2008-04-29 19:52:06 -05:00
Chantry Xavier
6b31183576 Doxyfile : enable JAVADOC_AUTOBRIEF.
From http://www.stack.nl/~dimitri/doxygen/config.html#cfg_javadoc_autobrief

JAVADOC_AUTOBRIEF
    If the JAVADOC_AUTOBRIEF is set to YES then doxygen will interpret the
first line (until the first dot) of a JavaDoc-style comment as the brief
description. If set to NO (the default), the Javadoc-style will behave just
like regular Qt-style comments (thus requiring an explicit @brief command
for a brief description.)

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-29 15:51:48 -05:00
Sebastian Nowicki
8f902865d9 Add documentation for transaction events
It is hard to decipher what the transaction events actually notify you
of, and what parameters are passed to the callback function, without
looking at the code. This patch adds documentation for the _pmtransevt_t
enum in order to clarify what the event is for and what data is passed
when the callback is called.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-29 15:51:45 -05:00
Dan McGee
010279e449 Updates to _alpm_copyfile()
Rework to use a single #define for the buffsize, and in the process clean up
some other code and double the default buffer size.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-28 22:24:40 -05:00
Dan McGee
4e6361642e Rework extract_single_file() temp file creation
We were a bit juryrigged using one call to mkstemp() before rather than
extracting the new files side-by-side and doing our comparisons there. We
were also facing some permissions issues. Instead, make our life easier by
extracting all temp files to a '.paccheck' extension, doing our md5
comparisons, and then taking the correct actions.

Still to be done here- a cleanup of the use of PATH_MAX which should not be
necessary if we use dynamic allocation on the heap.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-28 22:24:40 -05:00
Dan McGee
1201c8ce3a Update pactest to allow setting modes on created files
This should allow some future tests to set modes and ensure they are set
after installation. It is also in anticipation of a test for checking
permissions on pacnew files.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-28 22:24:40 -05:00
Dan McGee
245efca759 Remove unnecessary archive_entry_set_pathname() calls
I'm not sure why these were ever here, as by this point we have already
extracted the file meaning a call to this function is basically a no-op.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-27 17:27:05 -05:00
Daenyth Blank
27943a04d6 makepkg: fix strip section to allow spaces in paths
Inside tidy_install, change the section which strips libraries to use find |
while read rather than for foo in `find`. This should allow whitespaces in
filenames to still be processed correctly.

This fixes FS#10294.

Signed-off-by: Daenyth Blank <Daenyth+git@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-27 14:18:43 -05:00
Dan McGee
6d79ba2db0 Fix some fallout from the delta/download changes
We removed one too many FREELIST() calls when trying to fix some memleaks,
and add a safety/sanity check to ensure filename is set, as packages in old
DBs are likely to not have this field.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-26 13:03:53 -05:00
Chantry Xavier
481c3edc89 get_filename : use the FILENAME db field only.
Reference : FS#9547.

The get_filename function first tries to get the filename field from the
database, and if it doesn't find it, it tries to guess it based on the name,
version and arch.

This field was introduced in 3.0, but there are still many old entries in
the official databases without it. So the databases need to be regenerated
first before this patch can be applied.
There is a second problem with the delta code, which needs the filename for
locally installed packages too, but this field is not present in the local
db. So the delta code needs to be fixed first.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-26 11:54:47 -05:00
Chantry Xavier
8fdf08ef78 libalpm/sync.c : memleak fixes.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-04-26 11:54:46 -05:00
Chantry Xavier
670fadf041 Get rid of the delta patches list
As Nathan noticed, the new informations in the delta struct allows us to
get rid of this list :
http://www.archlinux.org/pipermail/pacman-dev/2008-February/011163.html

So I rewrote apply_deltas for that. The previous apply_deltas also had a
limitation: it assumed that the initial package and the deltas were in the
first cache dir, which is not necessarily the case. That situation is
supported now.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-26 11:54:38 -05:00
Chantry Xavier
701a03dcdb Completely rework delta algorithm
Using the graph structures that Nagy set up for dependency sorting, we now
do a similar process for deltas. Load up all of the deltas into a graph
object on which we can then apply Dijkstra's algorithm, using the new weight
field of graph struct.
We initialize the nodes weight using the base files that we can use in our
filecache (both filename and md5sum must match). The algorithm then picks
the best path among those that can be resolved.

Note that this algorithm has a few advantages over the old one:
1. It is completely file agnostic. These delta chains do not have to consist
   of package files- this could be adopted to do delta-fied DBs.
2. It does not use the local_db anymore, or even care if a package or file
   is currently installed. Instead, it only looks in the filecache for files
   and packages that match delta chain entries.

Original-work-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-04-26 11:36:01 -05:00
Dan McGee
30bdf94c2b Rework delta struct and modify code accordingly
Start to move the delta struct away from an assumed package name scheme and
towards something that is package (or even filename) agnostic. This will
allow us much greater flexibility in the usage of deltas (maybe even sync
DBs some day) as well as allowing code outside of delta.h/delta.c to be much
cleaner with less of a need for snprintf() calls.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-26 11:30:12 -05:00
Chantry Xavier
ff9744aa1f Refactor the trans init and release code.
The calls to alpm_trans_init and alpm_trans_release (+ error checking) were
duplicated between remove.c, sync.c and upgrade.c
This patch introduces trans_init and trans_release functions in util.c to
have this code just once.

So instead of having to do the same change 3 times for fixing FS#10273, I
just had to do it once (so I did it too :))

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-26 11:15:09 -05:00
Nagy Gabor
1b5a851851 Kill compute_requiredby usage in can_remove_package()
In the can_remove_package function, we don't need to compute the whole
requiredby list, we just need to find one member of it that doesn't belong
to the targets list.
That way we get a small speedup and remove the only usage of
alpm_pkg_compute_requiredby in the backend, so that it can be tweaked for
frontend usage.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-25 18:51:47 -05:00
Dan McGee
423820b34c Merge branch 'maint'
Conflicts:

	pactest/pmtest.py
2008-04-19 16:18:40 -05:00
Dan McGee
7a873a8f12 Give libalpm native support for both libdownload and libfetch
This should remove the need for any additional patching to run on platforms
that have libfetch available but not libdownload. It isn't the prettiest,
but we have kept our libdownload impact down to just a few files, so it can
be easily done.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-19 16:18:17 -05:00
Dan McGee
64e1dd64a4 Remove unnecessary NULL check in FREE() macro
free() is designed to do nothing if it is passed a NULL pointer, so there is
no need to check for it on our end. Change/fix the macro.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-19 15:59:40 -05:00
Chantry Xavier
c465d9e848 pactest : Use tarfile module.
Previously, tar was called manually with os.system. This caused one fork per
package/db creation, which is costly, especially on cygwin. Besides, it also
caused some problems with directory with whitespaces (that could also be
fixed with quotes, but well..)
Using tarfile module is cleaner and more efficient, and still easy enough.

Benchmark (time make check) :
- windows / cygwin
prepatch:
real    6m36.360s
user    2m28.914s
sys     2m35.866s
postpatch:
real    5m25.428s
user    1m26.029s
sys     2m0.006s

- linux
prepatch:
real    1m22.629s
user    0m31.498s
sys     0m18.899s
postpatch:
real    1m11.465s
user    0m26.382s
sys     0m12.986s

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-04-17 14:29:08 -05:00
Chantry Xavier
5e375aa9d3 pactest: Add quotes for directory with whitespaces
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-17 14:28:08 -05:00
Dan McGee
bf84c23266 Merge branch 'maint' 2008-04-15 19:07:51 -05:00
Dan McGee
0d8affeac0 Slight changes to fix warnings from autoconf 2.62
Two variables needed the _cv_ or warnings were spit out saying they were not
cache vars.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-15 19:07:13 -05:00
Dan McGee
c7a81c0b54 More non-Linux build updates, mostly Darwin
Darwin's binary format does support symbols with differing visibilities, but
it does not support the protected or internal visibilities- only hidden. For
Darwin only, we should fall back to this visibility to prevent warnings from
the compiler and because it is close enough for our library purposes.

See http://gcc.gnu.org/viewcvs/*checkout*/trunk/gcc/config/darwin.c, search
for the "darwin_assemble_visibility" function for more details.

Also add pacman.static.exe to gitignore.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-15 15:57:36 -05:00
Dan McGee
d685d0220f Fix gettext on non-Linux platforms
Linux includes all the gettext stuff in glibc, so there is no need for the
libintl links which we failed to include in our linker variables. Update the
makefiles which should enable NLS support on all platforms, including OS X
and Cygwin.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-14 21:01:30 -05:00
Dan McGee
ba70c52945 Fix compilation errors on x86_64
Things must have gotten stricter with GCC 4.3 on the '%zd' printf string and
this is the first I've tried to compile there. Fix the problem by using
size_t instead of int.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-14 18:24:45 -05:00
K. Piche
2d991a25ae remove.c: refactor into functions
Pulled two loops out of _alpm_remove_prepare and gave them their own
functions.

Signed-off-by: K. Piche <kevin@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-14 17:36:33 -05:00
K. Piche
db4258c1fd Some comments for _alpm_unpack.
Signed-off-by: K. Piche <kevin@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-14 17:19:32 -05:00
K. Piche
9f56137034 add.c: added some tracing and improved some variable locality
Signed-off-by: K. Piche <kevin@archlinux.org>
[Dan: removed one logger]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-14 17:17:22 -05:00
Dan McGee
ee2bbb39b5 Memory allocation and other small cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-10 20:54:48 -05:00
Dan McGee
4bd0a85095 Merge branch 'maint' 2008-04-10 20:54:34 -05:00
Dan McGee
e9a0d35d08 Remove unnecessary import in dload.h
We no longer expose any of libdownload in our public functions, so no need
to include this header anymore.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-10 20:53:28 -05:00
Dan McGee
4b7f7e2a59 Correctly use the fd returned my mkstemp()
There were a few issues with this code:
1. We already had an open fd to a file, but never used it to our benefit.
   Use the libarchive convienence method to write the current file contents
   straight to a file descriptor.
2. The real problem cropped up on Windows where the locking semantics caused
   the old way of extraction to fail because we had an open file descriptor.
   By using the file descriptor and closing it ASAP, we prevent these
   failures.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-08 18:55:22 -05:00
Dan McGee
57acfced0d Update configure.ac to current code
Remove a few functions and things that were unnecessary, update the help
line calls to the current function name, and make the small change to
pacman.c for the signal handler return type that is defined in config.h.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-07 19:27:35 -05:00
Dan McGee
83c4b2aebb Merge branch 'maint' 2008-04-07 19:19:34 -05:00
Dan McGee
bec2ba5b40 Add check for swprintf() and a workaround when it is missing
We use this function once in our codebase, but fortunately the workaround is
relatively easy. swprintf() is not available on Cygwin so the compile failed
there, but we can do a series of mbstowcs() calls that produce the same end
result as the swprintf() call.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-07 19:09:46 -05:00
Dan McGee
9441fba124 Add *.exe ignores for certain other platforms
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-07 19:09:20 -05:00
Dan McGee
a708c6eadc Allow disabling of internal (libdownload) code
Add a new --disable-internal-download flag to configure allowing the
internal download code to be skipped. This will be helpful on platforms that
currently don't support either libdownload or libfetch (such as Cygwin) and
for just compiling a lighter weight pacman binary.

This was made really easy by our recent refactoring of the download code
into separate internal and external functions, as well as some error code
cleanup.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 21:00:11 -05:00
Dan McGee
9c7ebe6872 Remove a bit more download.h pollution
Kill it where it isn't absolutely necessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:28:43 -05:00
Dan McGee
4c872594da Remove unnecessary header file, move one macro to util.c
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:20:20 -05:00
Dan McGee
e4a4cf7ce5 libalpm error cleanup, step 1
Remove unused error codes, begin refactoring some of the others.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:16:57 -05:00
Dan McGee
4004bf9caf Remove libdownload reference from pacman frontend
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:02:39 -05:00
Dan McGee
404e0a0e10 Add quiet printout to --owns functionality
If we specify -q/--quiet on an --owns operation, only print a matching
package name rather than the verbose human-readable message.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 19:49:41 -05:00
Allan McRae
b3f4bd9750 Quote filenames in find expression in pacdiff
From 41cc28f560bf9843d81ce5fb62b884b6325d06a0 Mon Sep 17 00:00:00 2001
From: Allan McRae <mcrae_allan@hotmail.com>
Date: Sun, 6 Apr 2008 22:18:06 +1000
Subject: [PATCH] Quote filenames in find expression in pacdiff

Small patch to allow pacdiff to run in /etc.  See FS#10090.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 10:44:44 -05:00
Dan McGee
073bac794d Merge branch 'maint'
Conflicts:

	configure.ac
	contrib/Makefile.am
2008-04-01 22:14:58 -05:00
Dan McGee
0b8abf376f Update NEWS and configure.ac for 3.1.4 release
Also fix a broken contrib/ Makefile, found with make distcheck. I also let
the little translation linebreak update slip in here as it was small enough
not to be a big deal, and this should just prevent it from happening again
later anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-01 22:04:56 -05:00
Dan McGee
ab9187d07d Set handle->logstream to null after fclose()
We correctly closed the logfile stream when recalling set_logfile, but did
not NULL out the dead pointer once we did this. Fix the problem which was
the cause of FS#10056.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-01 18:08:58 -05:00
Dan McGee
0bd6fb3bc2 Update -Ss and -Qs pactests to include groups
This update causes query003 to fail before commit
4b8ada818e. Hopefully the issue doesn't crop
up again but we might as well test for it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 16:47:27 -05:00
Dan McGee
5f17ac8150 Enable display of multiple groups in -Ss and -Qs output
Not too complicated of a fix, but just adds some code to loop over the
entire group list and space it out.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 16:41:13 -05:00
Dan McGee
4b8ada818e Fix segfault on -Qs usage
This segfault creeped in as a result of commit bf867003. We were incorrectly
assuming the group member of our package was a pmgrp_t list when in fact it
is just a string list, which caused a segfault on any -Qs operation.

Also slightly cleanup the -Ss code (which was originally correct unlike the
-Qs code).

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 16:36:55 -05:00
Dan McGee
0d1263af26 Merge branch 'maint' 2008-03-30 13:42:24 -05:00
Dan McGee
41c1295559 doc/pacman.8: fix manpage typo
Fix a misspelling and make a clarification while we are at it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 13:41:19 -05:00
Dan McGee
d9b9e60d7d Fix manpage typo
Noticed in FS#10025.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 11:00:53 -05:00
Chantry Xavier
3fe43ffa04 Duplicate the result of archive_entry_pathname.
After the libarchive upgrade from 2.4.12 to 2.4.14, our usage of
archive_entry_pathname became dangerous. We were using the result of that
function even after calls to archive_entry_set_pathname.
With 2.4.14, the entryname becomes wrong after these calls, and so all the
future use of entryname are bogus. entryname is used quite a lot for
logging, so that's not so bad. But it's also used for the backup handling,
so that's not very cool. For example, reinstalling a package with backup
entries will erase all the md5 entries from the DB, because they won't be
found back.

entryname is now a static string so that we can easily keep the result of
archive_entry_pathname.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: fixed version numbers in commit message]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-28 18:32:04 -05:00
Nagy Gabor
562442633a Use pkgcache instead of db_scan in remove.c
This should be a notable speed-up (apart from kernel cache).

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-28 17:53:04 -05:00
Dan McGee
d140b440a8 Read .PKGINFO directly from package file
With the addition of the archive_fgets() function, we can now skip the temp
file usage in pkg_load/parse_descfile that was not needed. This has a nice
benefit of probably being both faster, reducing code, and getting rid of
"expensive" file operations.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-27 12:07:32 -05:00
Dan McGee
f8c737d3b6 Add an archive_fgets() function
This crude function allows reading from an archive on a line-by-line basis
similar to the familiar fgets() call on a FILE stream. This is the first
step in being able to read DB entries straight from an archive.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-27 12:07:26 -05:00
Dan McGee
1dfd841e40 Make db->treename a pointer
I really don't think we need statically allocated strings here.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-26 20:19:44 -05:00
Dan McGee
5f1ccdbc27 Merge branch 'maint' 2008-03-23 16:58:53 -05:00
Nagy Gabor
d1ea16dfd0 Avoid duplicated target names.
This patch should avoid duplicated target names in the backend.
1. sync_loadtarget will return with PM_ERR_TRANS_DUP_TARGET when trying to
add a duplicated target
2. sysupgrade never pulls duplicated targets
3. resolvedeps won't pull duplicated targets anymore

A pulled list was introduced in sync_prepare to improve the
pmsyncpkg_t<->pmpkg_t list conversion by making it more direct.

Also replace sync1005 and sync1006 by the sync1008 pactest, which is
similar but more interesting (the provisions are dependencies instead of
explicit targets).
sync1005 didn't work as expected anyway. It was expecting that pacman
failed, and pacman indeed failed, but not for the good reason. It didn't
fail during the preparation step because of conflicting targets, but during
the commit step, because of a md5 error...
And sync1006 didn't pass and was not really worth fixing. We have already
enough failing pactests more important than these two.
sync1008 pass with this patch.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-23 16:57:14 -05:00
Dan McGee
6104f2e1fb memleak fix: ensure we free result of get_destfile()
In the file:// download case, we didn't free the return from get_destfile()
after we were done with it. Fix it. (Found with xfercommand001.py)

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 16:57:14 -05:00
Dan McGee
1086950c82 memleak fix: ensure backup fname isn't lost if unused
The _alpm_backup_split function always alloced memory for the fname, and we
let it disappear in a specific case (upgrade026.py). Fix the issue.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 16:55:52 -05:00
Dan McGee
7995a25d0e strsplit(): memleak fix
We dup-ed the string but then duped it again. Fix it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 16:55:03 -05:00
Dan McGee
bf86700369 Switch pmgrp_t to dynamic allocation, general group cleanup
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 14:51:51 -05:00
Dan McGee
90a48c771d Add -q (quiet) option to valgrind call in pactest
This gets rid of a lot of the unnecessary verbosity in the --valgrind output
when running all the tests. It should also make diff-ing output between test
runs a lot easier.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 14:25:38 -05:00
Dan McGee
f7f43dbb48 Update database mtime after it has been extracted
This will reduce the need for running an -Syy if the DB was only
half-extracted, as the mtime won't get updated until the new database is
completely in place.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 14:08:31 -05:00
Chantry Xavier
3d10d460df Add new CleanMethod option.
As it was already mentioned several times, the new -Sc behavior in 3.1 is
great, but only when the package cache is not shared.

This option has two possible values : KeepInstalled and KeepCurrent
With KeepCurrent, -Sc will clean packages that are no longer available in
any sync db, rather than packages that are no longer in the local db. The
resulting behavior should be better for shared cache.

Ref :
http://www.archlinux.org/pipermail/pacman-dev/2008-February/011140.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 13:38:23 -05:00
Chantry Xavier
5af076f09f Kill the dependsonly option.
From the man page :
"This is pretty useless and we're not sure why it even exists."

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-22 18:39:15 +01:00
Dan McGee
2f8fb80ee6 Merge branch 'maint' 2008-03-22 11:11:22 -05:00
Chantry Xavier
7d451b6e6b PKGBUILD.vim: add keepend keyword for sha1/md5 fields
in PKGBUILD.proto, we have the following line
md5sums=() #generate with 'makepkg -g'

if we add a md5sum inside quotes, or even just the quotes :
md5sums=('') #generate with 'makepkg -g'
the highlighting will be totally messed up.

Adding the keepend keyword fixes this.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-22 11:08:23 -05:00
甘露(Lu.Gan)
d07001f3ab Updates to Simplified Chinese translation
A little fine tuning, delete some unnecessary space before or after
English word.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-22 11:07:14 -05:00
Chantry Xavier
e7a2232934 Kill PM_TRANS_TYPE_ADD.
This was totally useless.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-17 21:01:22 -05:00
Chantry Xavier
73ab153c44 Kill some obsolete references to -A option.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-17 21:00:09 -05:00
Chantry Xavier
b3e6cf652c Drop case insensitive comparisons in the config parsing.
These case insensitive comparisons didn't work in some locales, like tr_TR
where upper(i) != I. So a second case sensitive comparison had to be made
for each directive.
Only keeping case sensitive comparisons make the code cleaner and treat all
locales equally.

Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011445.html

Also fix pactests to use the correct case.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-17 20:58:28 -05:00
Chantry Xavier
dae3f9deef Add zipman makepkg option.
All other steps in tidy_install function were already controlled by an
option in makepkg.conf, so this patch adds an option for the man page
compression step too.
This will allow to keep man pages uncompressed, which is required for some
special meta man page, like the zshall one (see FS#4580).

Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011472.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-16 23:22:17 +01:00
Nagy Gabor
1f30845e41 Show options in pacman.conf (commented out)
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2008-03-10 19:39:48 -05:00
Nagy Gabor
35135c0a0c Add -Rss option
* -Rss removes all dependencies (including explicitly installed ones).
* updated documentation
* two pactest files added to test the difference between -Rs and -Rss

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2008-03-10 19:16:01 -05:00
甘露(Lu.Gan)
6e4b020654 po/zh_CN.po: Chinese Simplified translation update
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-10 19:13:13 -05:00
Chantry Xavier
6820be9ba1 PKGBUILD.vim: improve invalid arch/license detection.
If we had :
arch=(fake)
The fake string would be highlighted because it's invalid.
But if we had :
arch=('fake')
it didn't work.

Fix this for both arch and license arrays.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-10 19:12:20 -05:00
Chantry Xavier
804ab37ea6 Clarify the NoUpgrade and NoExtract behavior.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-10 19:11:38 -05:00
Nagy Gabor
d060e31be3 Remove trans->targets
Its implementation was quite broken:
* add_loadtarget() might have silently filtered out some targets when
  replacing an older version.
* This was used in sync.c to determine whether a target is implicit or not,
  which is incorrect behavior. Before this patch we silently removed user
  confirmed replacements; now we always warn on a replacement.
* remove001.py behavior was quite odd in adding same target 5 times to the
  target list, we can change this behavior to be a failure.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Xav: changed remove001 pactest accordingly]
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: rewrote commit message]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-10 18:57:36 -05:00
Roman Kyrylych
f56f7ff391 makepkg: Support for resuming source downloads
Download to *.part and remove the suffix if successful, thus md5sums will be
checked only for complete files, and next time makepkg will resume
downloading of partial file instead of complaining about invalid md5sums.

Old DLAGENTS format is still supported.

Late fix: Do not try to download %u first

The output of grep was not suppressed, thus the output of get_downloadcmd
was wrong because of extra line at the beginning that contained an
unsubstituted (with %o and %u) entry from DLAGENTS.

Signed-off-by: Roman Kyrylych <roman@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-10 18:45:58 -05:00
Dan McGee
91b7f288fe Merge branch 'maint'
Conflicts:

	configure.ac
2008-03-09 12:03:54 -05:00
Chantry Xavier
fc48dc3118 Refactoring of the download code.
This should be the main step in the download refactoring initiated by commit
81a2a06818.
The stub functions introduced by that commit were implemented.

The big download code was mostly composed of two steps, and so it has been
naturally splitted in two functions :  download_external and download_internal

file:/// urls are now handled manually, instead of forcing the use of the
internal downloader.

Thanks to Dan for fixing the remaining issues and cleaning up the patch :)

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-09 12:03:22 -05:00
Chantry Xavier
51e0303e84 Use sigaction instead of signal.
From signal man page :
"The behavior of signal() varies across Unix versions, and has also varied
historically across different versions of Linux. Avoid its use: use
sigaction(2) instead. See Portability below."

The code was taken from there :
http://www.gnu.org/software/libtool/manual/libc/Sigaction-Function-Example.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-09 11:35:01 -05:00
Chantry Xavier
2f9f48eddd src/pacman/pacman.c : split cleanup function.
This function was used in two different ways :
- as a signal handler : the argument was the signal number
- called manually for freeing the resources : the argument was the return
  value
So the first part is now handler(int), and the second cleanup(int).
Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011388.html

Remaining problems :
- the return values are messy. for example, 2 can mean both that it was
  interrupted (SIGINT == 2), or that --help or -V was used (returned by
  parseargs).
- apparently signal is not portable and sigaction should be used instead

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-09 11:30:59 -05:00
Nagy Gabor
1dfcf1495b Remove a bogus comment from libalpm/remove.c
We do the opposite.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2008-03-09 11:30:01 -05:00
Chantry Xavier
724ed34ac5 rename vimproject to vimprojects and update it.
There is no need to put the list of files in there, which will get outdated
sooner or later. It's possible to generate the filelist in the plugin itself
using \r.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: add scripts/ directory]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 21:00:56 -06:00
Dan McGee
74c5bd70cf Remove useless TESTS file
This hasn't been updated in forever, and a simple python program could
regenerate it anyway. Or even grep.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 14:37:19 -06:00
Dan McGee
797c190f93 Remove frontend add code that is no longer necessary
Change the pacman_upgrade stub function to do what pacman_add used to do so
we can eliminate pacman_add. Move the code to the more-descriptive name of
upgrade.c.

Note that we have made no changes to the backend libalpm, where an ADD type
transaction could still be supported.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 14:13:34 -06:00
Dan McGee
3ec45486ff Remove the Add option from the command line
There is still a lot of code that could be cleaned up internally.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 14:13:34 -06:00
Dan McGee
266f06866b Move -A pactests that are relevant to -U, clean the rest out
This is in anticipation of removing the -A/--add option from the pacman
frontend. I've went through each of the pacman pactests that used the -A
operation and decided whether they were worth keeping, whether there was
already an upgrade test doing the same thing, or whether it should be moved
over.

The GIT rename log should make several of the moves obvious, but for those
that were deleted:
add001: handled by upgrade004
add002: worthless
add004: worthless
add010: handled by upgrade011
add050: handled by upgrade010

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 14:13:22 -06:00
Sergey Tereschenko
69eb0c8014 Updates to Russian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-08 10:40:04 -06:00
Nagy Gabor
49197b7492 New alpm_version function
Now pacman frontend uses this function instead of the compile-time libalpm
version number.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Dan: fix one more spot where LIB_VERSION was used]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-01 17:02:05 -06:00
Dan McGee
73ac9f7b27 Merge branch 'maint' 2008-03-01 16:24:42 -06:00
Chantry Xavier
d734ebdde2 libalpm: clean up of md5sum functions.
test_delta_md5sum and test_pkg_md5sum were simple wrappers to test_md5sum,
and only used once, so not very useful. I removed them.
Also, test_md5sum and alpm_pkg_checkmd5sum functions were a bit duplicated,
so I refactored them with a new _alpm_test_md5sum function in libalpm/util.c

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-27 19:02:17 -06:00
Dan McGee
c2dbbd60bc Start removing some junk from the function template
I screwed up originally when I accepted the TotalDownload patch,
8ec27835f4. I didn't realize how deeply it
modified libalpm and I probably shouldn't have let it do what it did. This
commit reverts much of what that patch added in order to clean up our
internal function calls. We can find another way to do it right down the
road here but for now it has to go.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-27 18:58:24 -06:00
Chantry Xavier
4fe7eb66eb libalpm/dload.c : memleak fixes.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-27 18:55:26 -06:00
Chantry Xavier
79945ef7ff clean up dltotal leftover from 81a2a06818.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-27 18:53:18 -06:00
Dan McGee
d75f693155 Merge branch 'maint'
Also bump the devel version on the master branch to 3.2.0devel.
2008-02-25 20:49:59 -06:00
Dan McGee
f159203f6f Remove pmserver_t abstraction
Remove what was a pretty weird abstraction in the libalpm backend. Instead
of parsing server URLs as we get them (of which we don't usually use more
than a handful anyway), wait until they are actually used, which allows us
to store them as a simple string list instead. This allows us to remove a
lot of code, and will greatly simplify the continuing refactoring of the
download code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 20:21:58 -06:00
Dan McGee
81a2a06818 Add new stub download functions for use throughout the code
Add new stub functions that work by calling the existing (terrible) download
forreal function, which needs a serious overhaul. Hide the existing
functions and switch all former users to the new functions.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 20:21:58 -06:00
Dan McGee
3e8ae774bd Move download code out of server.c
This is the first in what will be a series of patches to clean up the
current download code in libalpm. Start by moving download code out of
server.c and into download.c.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 20:21:58 -06:00
Chantry Xavier
143135e666 Improve yesno function.
Add a preset paramater to yesno function saying which answer should be the
default. Ref:
http://www.archlinux.org/pipermail/pacman-dev/2007-June/008470.html

This allows us to answer no by default to some questions, like the -Scc one
mentioned in the above thread, and implemented by this patch.

Another advantage is that we don't have to repeat the [Y/n] in every
questions. It's only put once in yesno function. This highly reduces the
chances that YES and NO strings are translated, but not some questions,
which lead to obvious confusions.

Finally, the noconfirm variable only needs to be used in that yesno
function. So all other usages of it were removed.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-24 18:17:49 -06:00
Dan McGee
ca1a187131 More cleanup to alpm_list
* Remove some #include statements that are not strictly necessary
* Remove node_new function that is really just a one-liner

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 18:07:44 -06:00
Nagy Gabor
8cfccf68c1 alpm_list.c clean-up
* Introduces 'list == NULL' convention for empty list. That means
alpm_list_new isn't needed anymore, so kill it

* Small straightforward fixes in alpm_list.c

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-25 00:52:58 +01:00
Dan McGee
3ad3077d8d Merge branch 'maint'
Conflicts:

	src/pacman/callback.c
2008-02-24 01:22:07 -06:00
Dan McGee
3a6f62d4c7 Remove all unnecessary snprintf usage
Both alpm_logaction() and yesno() are vararg functions, so we might as well
use this functionality and take advantage of it. Remove all of the
snprintf() calls and the LOG_STR_LEN constant that never seemed quite right.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 00:54:11 -06:00
Chantry Xavier
a3e6a6b822 Move -Sy operation into its own transaction
This allows us to remove the sync_only flag, and also do the following
steps in the future :
1) refresh the database (if asked)
2) do other stuff (eg checking if a newer pacman version is available)
3) start the actual transaction

Currently when we detect a newer pacman version, we have to release the
current transaction and start a new one.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-20 18:58:43 -06:00
Dan McGee
4bd52f3fe4 Merge branch 'maint'
Remove gettext() function addition from gensync and updatesync in master as
gettext is no longer used in them anyway.
2008-02-20 18:58:04 -06:00
Dan McGee
92ab7c33fb Move pmgraph_t struct and functions to their own header file
This will allow us to utilize this helpful type and functions in places
besides dependency calculations. In addition, remove the public declaration
of pmgraph_t in alpm.h- there is zero need to expose this internal type.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-16 11:58:49 -06:00
Dan McGee
6b07b5d345 Merge branch 'maint'
Conflicts:

	lib/libalpm/be_files.c
	lib/libalpm/package.c
2008-02-15 19:40:22 -06:00
Dan McGee
a16608c610 Update Doxyfile with some new options in new version
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-15 19:29:17 -06:00
Dan McGee
bfc024eab3 Merge branch 'maint' 2008-02-07 20:16:16 -06:00
Nagy Gabor
77c3cf9790 Remove alpm_sync_get_newversion function
sync->newversion shouldn't be public at all, and internally we access it directly.
(Before pmsyncpkg_t clean-up the analogue of this field [type] was needed in replaces computation.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-07 20:15:30 -06:00
Nagy Gabor
7dc37109b0 alpm_sync_sysupgrade split
This patch indroduces a new public alpm_sync_newversion, which scans for new
version of a package in sync repos.
Hopefully this will reduce code duplication in the future:
* check-for-pacman-new-version from front-end can be easier
* -Qu refactoring

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-07 20:15:23 -06:00
Nagy Gabor
05d5634958 libalpm/package.c : add _alpm_pkgname_pkg_cmp function.
_alpm_pkgname_pkg_cmp(pkgname, pkg) returns true iff pkg's name is pkgname.
This is useful if you want to remove a package from pmpkg_t* list, and you
want to search for package name.

This allows cleaning the -Ru code a bit, by removing the need of a dummy
pkg.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-06 08:46:15 +01:00
Nagy Gabor
e63366ae5e New remove option : -u / --unneeded (FS#6505).
With --unneeded option 'pacman -R' doesn't stop in case of dependency error;
it removes the needed-dependency targets from the target-list instead.  See
also: http://archlinux.org/pipermail/pacman-dev/2007-October/009653.html .

The patch also adds a new causingpkg field to pmdepmissing_t which indicates
the to-be-removed package which would cause a dependency break. This is
needed, because miss->depend.name may be a provision. miss->causingpkg will
be useful in -R dependency error messages too.

[Xavier: renamed inducer to causingpkg, removed the _alpm_pkgname_pkg_cmp
helper function as requested by Aaron. This might be added by a further
commit.  Other small cleanups, updated manpage and bash completion.]

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-06 08:46:15 +01:00
Chantry Xavier
e81dec9b8c remove --force option from repo-add.
The force option should only be specified in the PKGBUILD with
options=(force).  This information should be handled like any other meta
info, and there is no need to have a special repo-add option for it.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: fix up a few more references in contrib/ scripts, etc]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-05 19:35:41 -06:00
Dan McGee
eca30ed66a Merge branch 'maint'
Conflicts:

	contrib/gensync
	contrib/updatesync
2008-02-05 19:31:23 -06:00
Dan McGee
93a3050ed9 Remove "Installed Size" hackeration
Keeping this hack around where installed size is only shown if it is
greater than total download size encourages broken repository databases.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-05 18:34:03 -06:00
Dan McGee
5d03a6fd94 Remove gettext calls from gensync/updatesync
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-02 14:16:47 -06:00
Dan McGee
4fad7855fa Remove gensync and updatesync from normal distribution
Move these two scripts into contrib/, and start the process of de-automaking
them by removing the @sysconfdir@ references and the gettext initialization.
The removal of all gettext will soon follow.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-02 14:12:34 -06:00
Dan McGee
c492ca840c Merge branch 'maint' 2008-02-02 13:39:50 -06:00
Dan McGee
5647f7f512 Update libtool version (1.5.24 -> 1.5.26)
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-02 09:53:18 -06:00
Nagy Gabor
1fc83f4af6 pmsyncpkg_t cleanup
Fix for sync044.py and reason001.py.
Rename sync->data to sync->removes (alpm_list_t *)
Replace pmsynctype_t sync->type by pmpkgreason_t sync->newreason

The type field was set to UPGRADE or DEPEND or REPLACE.
Instead of using type = UPGRADE or DEPEND, we now rather use a
"pmpkgreason_t newreason" field directly (= explicit or depend) which allows
a better handling of the install reason.
And the REPLACE type is now deduced implicitly when the sync->removes list
is not empty.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27 12:05:33 -06:00
Dan McGee
9fbb77c91b Merge branch 'maint' 2008-01-27 11:54:52 -06:00
Nagy Gabor
9bfbd73917 Fix PM_ERR_CONFLICTING_DEPS handling in sync.c
* eliminate asymmetry (innerconflict vs. outerconflict)
* fix a memleak (in case of PM_ERR_MEMORY deps wasn't freed)
* fix wrong pmconflict_t duplication (*retconflict = *conflict)

Note: the new code introduces some code duplication which shall disappear by
fixing FS#7524.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27 11:54:35 -06:00
Nagy Gabor
ea828b5693 New _alpm_conflict_dup function
Added function to cleanly duplicate a conflict.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-27 11:54:25 -06:00
Nagy Gabor
f432ce41e0 small sync.c code clean-up
Remove unnecessary synclist_free function, and use our standard way
(alpm_list_free_inner + alpm_list_free) instead.
This slightly reduces code duplication.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27 11:52:46 -06:00
Chantry Xavier
88cbee3c24 libalpm/sync.c : conflicts resolving cleanup.
The original patch from Nagy tried to resolve target vs target conflicts,
and so broke the following pactests : sync040, sync041 and sync990

Nagy's proposal to solve this situation was to choose the interactive way,
ask the user how to deal with it: either remove pkg1 or remove pkg2 or stop
here.  So he left this as a TODO.

But instead of trying to resolve these conflicts or asking the user, I
tried to find a more conservative way, looking at what the current pactests
expected:
If between the two conflicting packages, one provides the other, pacman
will keep that one and remove the other from the target list.  That breaks
sync893 and sync897. But Dan agreed these two looked weird and should be
changed.

This commit should close FS#8897, FS#8899 and FS#9024.

Reference:
http://www.archlinux.org/pipermail/pacman-dev/2007-October/009745.html
http://www.archlinux.org/pipermail/pacman-dev/2007-December/010393.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:13:01 -06:00
Dan McGee
69c6d59bb6 Fix flip-flopped parameters to CALLOC macro
The mixup causes a fail in the build using --enable-debug on x86_64 but not
i686, so none of us caught this right away. Fix it. FS#9297.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:13:01 -06:00
Chantry Xavier
8240da6cb3 libalpm/cache.c : don't duplicate packages in pkgcache.
Edit _alpm_db_add_pkgincache to not duplicate packages, because this is not
needed, is slower, and uses more memory. This made the max memory usage
during base reinstall go from 10.4MB to 9.7MB.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:13:01 -06:00
Chantry Xavier
bd43a7f155 testdb : add conflicts checking.
Testdb will now scan the local database to check there are no conflicts.
I'm not sure how it's possible to get this situation. At least pacman
doesn't allow installing a package that conflicts with a local one, without
removing the local one. But maybe in a very weird situation, or because of
a bug, it could be possible.  But anyway, this only requires 5 lines of
code.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:12:50 -06:00
Chantry Xavier
22c900e7d5 Add new public alpm_checkdbconflicts function.
This function has a limited purpose, but might be interesting to do a
sanity check from a frontend (eg testdb).

Also removed the private _alpm_checkconflicts function to avoid confusion.
This function was used only once in libalpm, in sync.c, and was just a
single line anyway. Having to do it manually makes it explicit that we are
looking for two kind of conflicts (targ vs targ and db vs targ).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-23 20:12:41 -06:00
Chantry Xavier
6b8f404a33 small memleak fix in sync.c.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-23 19:52:16 -06:00
Dan McGee
8ca6501ee1 pactest: remove check for root permissions message
Pacman isn't designed to fail when under fakeroot anymore, so kill this
check off which fails anyway if the logfile is missing (such as when the
--valgrind flag is used).

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:47:03 -06:00
Dan McGee
9247ddbe8a conflict.c: move debug message out of inner loop
We have a debug message in the target vs. target file conflict check, and
this is a bit rediculous when it comes to watching output from something
like smoke001.py. Instead, put the output outside this inner loop so we only
see it at most once per target, which is much more reasonable.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:44:10 -06:00
Dan McGee
36264a3ab9 Fix memleak found by add004.py
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:44:02 -06:00
Dan McGee
cbcf542ad2 Merge branch 'maint' 2008-01-21 19:42:08 -06:00
Nagy Gabor
2a7101c049 New --asexplicit option
This is the symmetric of --asdeps, install packages explicitly.
Documentation and completion files were updated accordingly.
Added sync301.py and upgrade032.py pactest files to test this.

I also made a little modification in ALLDEPS handling too.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-21 19:39:26 -06:00
Chantry Xavier
b2914bf0af Move the deptest code from frontend to backend.
The deptest code (pacman -T) used by makepkg was mostly in the frontend.
There were 2 drawbacks:
1) the public splitdep function returns a pmdepend_t struct, but the
_alpm_dep_free function for freeing it is private. So there was a memleak.
2) there is a helper in the backend (satisfycmp in deps.c) which makes this
function much easier.

So this adds a new public alpm_deptest in libalpm/deps.c, which cleans
pacman_deptest in pacman/deptest.c a lot.
Besides, alpm_splitdep was made private, because the frontend no longer
requires it, and _alpm_dep_free is also private.
Finally the deptest001 pactest was extended.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:35:43 -06:00
Dan McGee
927af790ee Convert deltas to dynamic allocation
Another elimination of a static length structure in libalpm. Should result
in a little more memory saved during execution of packages with lots of
deltas attached.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-21 19:33:32 -06:00
Dan McGee
f6785dcb89 Merge branch 'maint' 2008-01-18 19:33:25 -06:00
Dan McGee
38e981fab3 Merge branch 'maint' 2008-01-14 22:58:44 -06:00
Dan McGee
521de7ceed Merge branch 'maint' 2008-01-13 12:27:17 -06:00
Dan McGee
4f26701793 memleak fix with new dynamic depend structure
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12 20:18:20 -06:00
Chantry Xavier
435ec29bc7 libalpm/sync.c: don't duplicate packages for the sync->data field.
Packages put in the sync->data field were always duplicated with pkg_dup,
and then freed, This is not needed.
Killing this duplication of packages made the memory usage during base
reinstall go from 10.4 MB to 8.1 MB.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-12 17:51:29 -06:00
Aaron Griffin
26f4993e1d Store replaces in the local DB too
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
[Dan: might as well store 'force' too]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12 01:33:57 -06:00
Dan McGee
2630556bde Merge branch 'maint' 2008-01-11 23:19:52 -06:00
Nagy Gabor
112caad838 New reason001.py pactest
This pactest demonstrates that we should copy the reason between the
to-be-replaced and replaced packages

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11 23:19:08 -06:00
Dan McGee
3e133524a5 Add functions to manipulate pmdepend_t objects
We didn't have a free function before, causing some memory leaks. We also
need a dup function now that strings are not in the structure but are
dynamically allocated.

Also adapt pmdepmissing_t to use a pointer to a depend struct instead of an
inclusive one so we can use the functions we created here.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11 22:58:05 -06:00
Dan McGee
ccc1c73152 Use dynamic string allocation in package structures
This also affects all structures with static strings, such as depmiss,
conflict, etc. This should help a lot with memory usage, and hopefully make
things a bit more "idiot proof".

Currently our pactest pass/fail rate is identical before and after this
patch. This is not to say it is a perfect patch- I have yet to pull valgrind
out. However, this should be quite safe to use in all situations from here
on out, and we can start plugging the memleaks.

Original-work-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-11 00:01:58 -06:00
242 changed files with 16752 additions and 13470 deletions

36
HACKING
View File

@@ -12,10 +12,10 @@ Coding style
1. All code should be indented with tabs. (Ignore the use of only spaces in
this file) By default, source files contain the following VIM modeline:
+
[C]
code~~~~~~~~~~
[code,C]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* vim: set ts=2 sw=2 noet: */
code~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2. When opening new blocks such as 'while', 'if', or 'for', leave the opening
brace on the same line as the beginning of the codeblock. The closing brace
@@ -24,8 +24,8 @@ code~~~~~~~~~~
braces, even if it's just a one-line block. This reduces future error when
blocks are expanded beyond one line.
+
[C]
code~~~~~~~~~~
[code,C]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for(lp = list; lp; lp = lp->next) {
newlist = _alpm_list_add(newlist, strdup(lp->data));
}
@@ -40,14 +40,14 @@ while(it) {
free(it);
it = ptr;
}
code~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. When declaring a new function, put the opening and closing braces on their
own line. Also, when declaring a pointer, do not put a space between the
asterisk and the variable name.
+
[C]
code~~~~~~~~~~
[code,C]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alpm_list_t *alpm_list_add(alpm_list_t *list, void *data)
{
alpm_list_t *ptr, *lp;
@@ -58,7 +58,7 @@ alpm_list_t *alpm_list_add(alpm_list_t *list, void *data)
}
...
}
code~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. Comments should be ANSI-C89 compliant. That means no `// Comment` style;
use only `/* Comment */` style.
@@ -101,37 +101,37 @@ Currently our #include usage is in messy shape, but this is no reason to
continue down this messy path. When adding an include to a file, follow this
general pattern, including blank lines:
[C]
code~~~~~~~~~~
[code,C]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "config.h"
#include <standardheader.h>
#include <another.h>
#include <...>
code~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Follow this with some more headers, depending on whether the file is in libalpm
or pacman proper. For libalpm:
[C]
code~~~~~~~~~~
[code,C]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* libalpm */
#include "yourfile.h"
#include "alpm_list.h"
#include "anythingelse.h"
code~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For pacman:
[C]
code~~~~~~~~~~
[code,C]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <alpm.h>
#include <alpm_list.h>
/* pacman */
#include "yourfile.h"
#include "anythingelse.h"
code~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/////
vim: set ts=2 sw=2 syntax=asciidoc et:

View File

@@ -11,12 +11,14 @@ EXTRA_DIST = HACKING
pkgdatadir = ${datadir}/${PACKAGE}
dist_pkgdata_DATA = PKGBUILD.proto proto.install ChangeLog.proto
# run the pactest test suite
check-local: src/pacman
# run the pactest test suite and vercmp tests
check-local: pactest src/pacman src/util
$(PYTHON) $(top_srcdir)/pactest/pactest.py --debug=1 \
--test $(top_srcdir)/pactest/tests/*.py \
-p $(top_builddir)/src/pacman/pacman
rm -rf $(top_builddir)/root
$(SH) $(top_srcdir)/pactest/vercmptest.sh \
$(top_builddir)/src/util/vercmp
# create the pacman DB and cache directories upon install
install-data-local:

92
NEWS
View File

@@ -1,5 +1,97 @@
VERSION DESCRIPTION
-----------------------------------------------------------------------------
3.2.1 - drop special handling of file:// URLs
- display optdepends on install and upgrade
- fix segfault on x86_64 when using UseSyslog (FS#11096)
- fix detection of TotalDownload (FS#11180)
- fix "No such file" error during --force installs (FS#11218)
- better handling of progressbar when behind a proxy (FS#8725)
- repo-add: fix whitespace handling (FS#9171, FS#10630)
- repo-add: add optdepends to the sync DB (FS#10630)
- makepkg:
- allow specifying a download filename (related to FS#11292)
- fix download functions with weird URLs (FS#11076)
- fix creation of source package with local files (FS#11149)
- fix error when sourcing profile scripts (FS#11179)
- perform case-insensitive checksum comparison (FS#11283)
- documentation and help updates (including fix for FS#11203)
- new Ukrainian translation
- existing translation updates
3.2.0 - removed -A/--add option from pacman frontend
- added --asexplicit option
- new remove option --unneeded
- add -Rss option to remove all dependencies
- removed useless -e/--dependsonly option
- config options are now case sensitive
- added CleanMethod option for variety in cache cleaning
- new Turkish translation, all others updated and revised
- handle multiple groups in -Ss and -Qs operations
- allow -q/--quiet option with -o/--own and -g/--groups options
- removed hack for packages with unknown installed size
- add SyncFirst option to pacman.conf
- support installation of versioned deps : pacman -S "dep>=2.0"
- add --enable-git-version configure flag to identify
developmental build version
- do not duplicate packages in required by list
- pacman.static is no longer built
- all error messages use pm_fprintf
- disable geteuid in cygwin
- use off_t type for large file support
- add vercmp test script
- moved gensync and updatesync to contrib/
- rewrote pacsearch script in perl
- paclist script to list installed packages from a repo
- bacman script to make backup of package from filesystem
- combined repo-add and repo-remove into one script
- removed --force option from repo-add
- add --quiet option to repo-add/repo-remove
- update libtool version to 1.5.26
- allow disabling of internal download with new configure
flag --disable-internal-download
- pactest can now check file permissions
- add the possibility to mark the pactests known to fail,
which allows more informative results of make check
- libalpm-specific changes:
- use dynamic string allocation in package structure
- new functions for manipulating pmdepend_t objects
- store replaces and force in local database
- moved deptest functionality to backend
- add alpm_checkdbconflicts function
- fix PM_ERR_CONFLICTING_DEPS handling
- cleanup of pmsyncpkg_t
- add alpm_sync_newversion function
- cleanup of alpm_list code
- refactor of download code
- download callback API changes
- removed test_delta_md5sum and test_pkg_md5sum functions
- add _alpm_archive_fgets function to read line-by-line from
an archive
- read .PKGINFO directly from package file with no temp file
- native support for both libdownload and libfetch
- rework delta algorithm (we still need script updates)
- swap parameters of alpm_pkg_find for consistency with
other find functions
- swap parameters of PM_TRANS_CONV_INSTALL_IGNOREPKG to make
more sense
- fix -Rs when removing multiple items in dependency chain
- makepkg-specific changes:
- support for resuming source downloads
- added zipman option
- removed -b/--builddeps
- various portability fixes for BSD and Mac OS X
- check for valid options in PKGBUILD
- add --allsource option
- remove deprecated --usesudo option
- handle spaces in build directory
- made keeping docs the default option
- use pacman version dep resolving
- fix regression in library stripping
- make strip paths configurable
- MANY other bug fixes and small improvements
3.1.4 - various small code cleanups and fixes
- small documentation updates
- improvements to PKGBUILD.vim
- translation updates - ru, zh_CN
3.1.3 - major updates to i18n output in frontend (all UTF-8 characters
should now work with varying byte and char widths)
- new Simplified Chinese translation

View File

@@ -29,7 +29,7 @@ build() {
./configure --prefix=/usr
make || return 1
make DESTDIR="$pkgdir" install
make DESTDIR="$pkgdir/" install
}
# vim:set ts=2 sw=2 et:

165
README
View File

@@ -2,7 +2,7 @@ ALPM library overview & internals
=================================
Here is a list of the main objects and files from the ALPM (i.e. Arch Linux
Package Management) library. This document, whilst not exhaustive, also
Package Management) library. This document, while not exhaustive, also
indicates some limitations (on purpose, or sometimes due to its poor design) of
the library at the present time.
@@ -13,9 +13,8 @@ the frontend. Lots of structures are of an opaque type and their fields are
only accessible in read-only mode, through some clearly defined functions.
In addition to "alpm.h", the interfaces of "alpm_list.h" have also been made
available to the frontend. It is not a requirement for the frontend to use
these list functions; however, it prevents frontends from having to reimplement
a list data structure.
available to the frontend, for allowing it to manipulate the lists returned by
the backend.
Several structures and functions have been renamed compared to pacman 2.9 code.
This was done at first for the sake of naming scheme consistency, and then
@@ -25,7 +24,7 @@ same name declared in both spaces. To avoid such conflicts, internal function
names have been prepended with "_alpm_".
In a general manner, public library functions are named "alpm_<type>_<action>"
(examples: alpm_trans_commit(), alpm_release(), alpm_pkg_getinfo(), ...).
(examples: alpm_trans_commit(), alpm_release(), alpm_pkg_get_name(), ...).
Internal (and thus private) functions should be named "_alpm_XXX" for instance
(examples: _alpm_needbackup(), _alpm_runscriplet(), ...). Functions defined and
used inside a single file should be defined as "static".
@@ -33,59 +32,63 @@ used inside a single file should be defined as "static".
[Initialization]
alpm_init() is used to initialize library internals and to create
alpm_initialize() is used to initialize library internals and to create
a transparent handle object. Before its call, the library can't be used.
alpm_lib_release() just does the opposite (memory used by the library, and the
handle is freed). After its call, the library is no longer available.
alpm_release() just does the opposite (memory used by the library, and the
handle is freed). After its call, the library is no longer available.
[Options]
In the future, the library will not use any configuration file. It will be up
to the front end to The handle holds a
number of configuration options instead (IGNOREPKG, SYSLOG usage,
log file name, registered databases, ...).
The library does not use any configuration file. It is up to the front end to
configure the library as needed; the handle holds a number of configuration
options instead.
All of the following options have a alpm_option_get_* and alpm_option_set_*
function for getting and setting the value. The cannot be set before the
function for getting and setting the value. They cannot be set before the
library is initialized.
* logcb: The callback function for "log" operations.
* dlcb: The callback function for download progress.
* logmask: The logging mask for which level of output is sent to the logcb.
* root: The root directory on which pacman operates (Default: /)
* dbpath: The base path to pacman's databases (Default: var/lib/pacman)
* cachedir: The base path to pacman's download cache (Default: var/cache/pacman)
* logfile: The base path to pacman's log file (Default: var/log/pacman.log)
* dlcb: The callback function for download progress of each package.
* totaldlcb: The callback function for overall download progress.
* root: The root directory for pacman to install to (Default: /)
* dbpath: The toplevel database directory (Default: /var/lib/pacman)
* logfile: The base path to pacman's log file (Default: /var/log/pacman.log)
* usesyslog: Log to syslog instead of `logfile` for file-base logging.
* xfercommand: The command to use for downloading instead of pacman's internal
downloading functionality.
downloading functionality.
* nopassiveftp: Do not use passive FTP commands for ftp connections.
* chomp: No way, easter eggs are secret!
* usecolor: Unimplemented, but for the future. You can assume what it means.
The following options also have a `alpm_option_add_*` function, as the values
are list structures (NOTE: The add functions are NOT plural, as they're in
english: alpm_option_get_noupgrades -> alpm_option_add_noupgrade).
The following options also have `alpm_option_{add,remove}_*` functions, as the
values are list structures.
NOTE: The add and remove functions are NOT plural, as they are in English:
alpm_option_{get,set}_noupgrades -> alpm_option_{add,remove}_noupgrade.
* cachedirs: Paths to pacman's download caches (Default: /var/cache/pacman/pkg)
* noupgrades: Files which will never be touched by pacman (extracted as .pacnew)
* noextracts: Files which will never be extracted at all (no .pacnew file)
* ignorepkgs: Packages to ignore when upgrading.
* holdpkgs: Packages which must be upgraded before continuing.
* ignoregrps: Groups to ignore when upgrading.
* holdpkgs: Important packages which need a confirmation before being removed.
The following options are read-only, having ONLY alpm_option_get_* functions:
* lockfile: The file used for locking the database
(Default: <dbpath>/db.lck)
* localdb: A pmdb_t structure for the local (installed) database
* syncdbs: A list of pmdb_t structures to which pacman can sync from.
The following options are write-only, having ONLY alpm_option_set_* functions:
* usedelta: Download delta files instead of complete packages if possible.
[Transactions]
The transaction sturcture permits easy manipulations of several packages
The transaction structure permits easy manipulations of several packages
at a time (i.e. adding, upgrade and removal operations).
A transaction can be initiated with a type (ADD, UPGRADE or REMOVE),
A transaction can be initiated with a type (SYNC, UPGRADE or REMOVE),
and some flags (NODEPS, FORCE, CASCADE, ...).
Note: there can only be one type at a time: a transaction is either
@@ -105,7 +108,7 @@ These targets represent the list of packages to be handled.
Then, a transaction needs to be prepared (alpm_trans_prepare()). It
means that the various targets added, will be inspected and challenged
against the set of already installed packages (dependency checkings,
against the set of already installed packages (dependency checking, etc...)
Last, a callback is associated with each transaction. During the
transaction resolution, each time a new step is started or done (i.e
@@ -116,27 +119,27 @@ the resolution. Can be useful to implement a progress bar.
[Package Cache]
libalpm maintains two caches for each DB. One is a general package cache, the
other is a group cache (for package groups). These caches are loaded on demand,
and freed when the libary is.
It is important to note tha, as a general rule, package structures should NOT be
freed manually, as they SHOULD be part of the cache.
The cache of a database is always updated by the library after
an operation changing the database content (adding and/or removal of
packages). Beware frontends ;)
libalpm maintains two caches for each DB. One is a general package cache, the
other is a group cache (for package groups). These caches are loaded on demand,
and freed when the library is.
It is important to note that, as a general rule, package structures should NOT
be freed manually, as they SHOULD be part of the cache. The cache of a
database is always updated by the library after an operation changing the
database content (adding and/or removal of packages). Beware frontends ;)
[Package]
The package structure maintains all information for a package. In general,
packages should never be freed from front-ends, as they should always be part of
the package cache.
The package structure maintains all information for a package. In general,
packages should never be freed from front-ends, as they should always be part
of the package cache.
The 'origin' data member indicates whether the package is from a file
(i.e. -U operations) or from the package cache. In the case of a file, all data
members available are present in the structure. Packages indicated as being
from the cache have data members filled on demand. For this reason, the
alpm_pkg_get_* functions will load the data from the DB as needed.
The 'origin' data member indicates whether the package is from a file (i.e. -U
operations) or from the package cache. In the case of a file, all data members
available are present in the structure. Packages indicated as being from the
cache have data members filled on demand. For this reason, the alpm_pkg_get_*
functions will load the data from the DB as needed.
[Errors]
@@ -149,13 +152,15 @@ indicating success, -1 indicating a failure.
If -1 is returned, the variable pm_errno is set to a meaningful value
Wise frontends should always care for these returned values.
Note: the helper function alpm_strerror() can also be used to translate
the error code into a more friendly sentence.
Note: the helper function alpm_strerror() can also be used to translate one
specified error code into a more friendly sentence, and alpm_strerrorlast()
does the same for the last error encountered (represented by pm_errno).
[List - alpm_list_t]
The alpm_list_t structure is a doubly-linked list for use with the libalpm
routines. This type is provided publicly so that frontends are free to use it
routines. This type is provided publicly so that frontends are free to use it
if they have no native list type (C++, glib, python, etc all have list types).
See the proper man pages for alpm_list_t references.
@@ -179,41 +184,65 @@ perform a special action.
[MAIN] (see pacman.c)
Calls for alpm_lib_init(), and alpm_lib_release().
Calls for alpm_initialize(), and alpm_release().
Read the configuration file, and parse command line arguments.
Based on the action requested, it initiates the appropriate transactions
(see pacman_add(), pacman_remove(), pacman_sync() in files add.c,
(see pacman_upgrade(), pacman_remove(), pacman_sync() in files upgrade.c,
remove.c and sync.c).
[CONFIGURATION] (see conf.c)
[CONFIGURATION] (see conf.h)
The frontend is using a configuration file, usually "/etc/pacman.conf".
Part of these options are only useful for the frontend only (mainly,
the download stuffs, and some options like HOLDPKG).
The rest is used to configure the library.
The frontend is using a configuration file, usually "/etc/pacman.conf". Some
of these options are only useful for the frontend only (mainly the ones used to
control the output like showsize or totaldownload, or the behavior with
cleanmethod and syncfirst). The rest is used to configure the library.
[ADD/UPGRADE/REMOVE/SYNC]
Nothing new here, excepted some reorganization.
[UPGRADE/REMOVE/SYNC]
The file pacman.c has been divided into several smaller files, namely
add.c, remove.c, sync.c and query.c, to hold the big parts: pacman_add,
upgrade.c, remove.c, sync.c and query.c, to hold the big parts: pacman_upgrade,
pacman_remove, pacman_sync.
These 3 functions have been split to ease the code reading.
LIMITATIONS/BEHAVIOR CHANGES COMPARED TO PACMAN 2.9
===================================================
Excepted missing features still needing to be implemented, one can
notice the following limitations:
API CHANGES BETWEEN 3.1 AND 3.2
===============================
- If pacman is out of date, the frontend displays a warning and recommends
to give up the on-going transanction. The frontend does not allow to
upgrade pacman itself on-the-fly, and thus it should be restarted with
only "pacman" as a target.
[REMOVED]
- alpm_db_whatprovides()
- alpm_splitdep (no longer public)
- trans->targets was removed, so alpm_trans_get_targets() as well
- error codes:
PM_ERR_OPT_*, PM_ERR_PKG_INSTALLED, PM_ERR_DLT_CORRUPTED,
PM_ERR_LIBARCHIVE_ERROR
- event: PM_TRANS_EVT_EXTRACT_DONE
- PM_TRANS_TYPE_ADD pmtranstype_t (add transaction)
- PM_TRANS_FLAG_DEPENDSONLY pmtransflag_t
- ...
[CHANGED]
- alpm_grp_get_pkgs returns with pmpkg_t list, not package-name list
- Swap parameters on PM_TRANS_CONV_INSTALL_IGNOREPKG callback function
- download callback API changed: alpm_cb_download, alpm_cb_totaldl split
(+ new alpm_option_get_totaldlcb(), alpm_option_set_totaldlcb() functions)
- unsigned long->off_t changes where size is used
- pmsyncpkg_t struct changes:
- pmsynctype_t and alpm_sync_get_type() were removed
- alpm_sync_get_data() was removed
- alpm_sync_get_removes() was added
[ADDED]
- alpm_delta_get_from_md5sum(), alpm_delta_get_to_md5sum()
- alpm_miss_get_causingpkg() (new causingpkg field in pmdepmissing_t)
- alpm_checkdbconflicts()
- alpm_sync_newversion()
- alpm_deptest()
- error codes :
PM_ERR_DLT_INVALID, PM_ERR_LIBARCHIVE, PM_ERR_LIBDOWNLOAD and
PM_ERR_EXTERNAL_DOWNLOAD
- flags:
PM_TRANS_FLAG_ALLEXPLICIT, PM_TRANS_FLAG_UNNEEDED and
PM_TRANS_FLAG_RECURSEALL

View File

@@ -18,8 +18,8 @@ German (de):
British English (en_GB):
Jeff Bailes <thepizzaking@gmail.com>
Spanish (es):
Juan Pablo González Tognarelli <jotapesan@gmail.com>
Fernando Lagos <fernando@zerial.org>
Juan Pablo Gonzalez <jotapesan@gmail.com>
French (fr):
Chantry Xavier <shiningxc@gmail.com>
Hungarian (hu):
@@ -31,12 +31,19 @@ Polish (pl):
Jaroslaw Swierczynski <swiergot@gmail.com>
Mateusz Jędrasik <m.jedrasik@gmail.com>
Brazilian Portuguese (pt_BR):
<none>
Hugo Doria <hugo@archlinux.org>
Armando M. Baratti <ambaratti@archlinux-br.org>
Leandro Inacio <leandro@archlinux-br.org>
Russian (ru):
Sergey Tereschenko <serg.partizan@gmail.com>
Vitaly Dolgov <ferhiord@gmail.com>
Oleg Finkelshteyn <olegfink@gmail.com>
Vladimir Bayrakovskiy <4rayven@gmail.com>
Turkish (tr):
Samed Beyribey <ras0ir@eventualis.org>
Alper KANAT <alperkanat@gmail.com>
Ukrainian (uk):
Roman Kyrylych (Роман Кирилич) <roman.kyrylych@gmail.com>
Ivan Kovnatsky (Іван Ковнацький) <sevenfourk@gmail.com>
Simplified Chinese (zh_CN):
甘露(Lu.Gan) <rhythm.gan@gmail.com>

View File

@@ -3770,7 +3770,7 @@ AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
#
if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
_LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
_LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
[$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC])], [],
[case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
"" | " "*) ;;
@@ -3794,7 +3794,7 @@ esac
#
wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
_LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
_LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
$lt_tmp_static_flag,
[],
[_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])

View File

@@ -23,10 +23,10 @@ rm -rf doc/{Makefile.in,Makefile}
rm -rf doc/html/*.html
rm -rf doc/man3/*.3
rm -rf src/pacman/po/{Makefile.in,Makefile}
rm -rf src/pacman/po/POTFILES
rm -rf src/pacman/po/stamp-po
rm -rf src/pacman/po/*.gmo
rm -rf po/{Makefile.in,Makefile}
rm -rf po/POTFILES
rm -rf po/stamp-po
rm -rf po/*.gmo
rm -rf lib/libalpm/po/{Makefile.in,Makefile}
rm -rf lib/libalpm/po/POTFILES

36
config.guess vendored
View File

@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2007-05-17'
timestamp='2008-01-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -56,8 +56,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -330,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
@@ -532,7 +532,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[45])
*:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -793,12 +793,15 @@ EOF
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
@@ -833,7 +836,14 @@ EOF
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -954,8 +964,8 @@ EOF
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa:Linux:*:*)
echo xtensa-unknown-linux-gnu
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
@@ -1474,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be

48
config.sub vendored
View File

@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2007-04-29'
timestamp='2008-01-16'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -72,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -369,10 +369,14 @@ case $basic_machine in
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
@@ -443,6 +447,14 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
c90)
basic_machine=c90-cray
os=-unicos
@@ -475,8 +487,8 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
cr16c)
basic_machine=cr16c-unknown
cr16)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
@@ -668,6 +680,14 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
@@ -813,6 +833,14 @@ case $basic_machine in
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
@@ -1021,6 +1049,10 @@ case $basic_machine in
basic_machine=tic6x-unknown
os=-coff
;;
tile*)
basic_machine=tile-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;

View File

@@ -40,29 +40,19 @@ AC_PREREQ(2.60)
#
# Bugfix releases:
# pacman_version_micro += 1
#
# pacman_version_suffix should be similar to one of the following:
# For beta releases: [beta2]
# For code under development: [devel]
# For production releases: []
m4_define([lib_current], [5])
m4_define([lib_current], [4])
m4_define([lib_revision], [0])
m4_define([lib_age], [3])
m4_define([lib_age], [1])
m4_define([pacman_version_major], [3])
m4_define([pacman_version_minor], [1])
m4_define([pacman_version_micro], [3])
m4_define([pacman_version_suffix], [])
m4_define([pacman_version_minor], [2])
m4_define([pacman_version_micro], [1])
m4_define([pacman_version],
[pacman_version_major.pacman_version_minor.pacman_version_micro])
m4_define([pacman_display_version],
pacman_version[]m4_ifdef([pacman_version_suffix],[pacman_version_suffix]))
# Autoconf initialization
# AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
AC_INIT([Pacman Package Manager], [pacman_display_version],
[pacman-dev@archlinux.org], [pacman])
AC_INIT([pacman], [pacman_version], [pacman-dev@archlinux.org])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
@@ -80,48 +70,54 @@ AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
# Help line for root directory
AC_ARG_WITH(root-dir,
AC_HELP_STRING([--with-root-dir=path], [set the location of pacman's root operating directory]),
AS_HELP_STRING([--with-root-dir=path], [set the location of pacman's root operating directory]),
[ROOTDIR=$withval], [ROOTDIR=/])
# Help line for package extension
AC_ARG_WITH(pkg-ext,
AC_HELP_STRING([--with-pkg-ext=ext], [set the file extension used by packages]),
AS_HELP_STRING([--with-pkg-ext=ext], [set the file extension used by packages]),
[PKGEXT=$withval], [PKGEXT=.pkg.tar.gz])
# Help line for source package directory
AC_ARG_WITH(src-ext,
AC_HELP_STRING([--with-src-ext=ext], [set the file extension used by source packages]),
AS_HELP_STRING([--with-src-ext=ext], [set the file extension used by source packages]),
[SRCEXT=$withval], [SRCEXT=.src.tar.gz])
# Help line for database extension
AC_ARG_WITH(db-ext,
AC_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]),
AS_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]),
[DBEXT=$withval], [DBEXT=.db.tar.gz])
# Help line for libdownload/libfetch
AC_ARG_ENABLE(internal-download,
AS_HELP_STRING([--disable-internal-download], [do not build with libdownload/libfetch support]),
[internaldownload=$enableval], [internaldownload=yes])
# Help line for documentation
AC_ARG_ENABLE(doc,
AC_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
AS_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
[wantdoc=$enableval], [wantdoc=yes])
# Help line for doxygen
AC_ARG_ENABLE(doxygen,
AC_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
AS_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
[wantdoxygen=$enableval], [wantdoxygen=no])
# Help line for asciidoc
AC_ARG_ENABLE(asciidoc,
AC_HELP_STRING([--enable-asciidoc], [build your own manpages with Asciidoc]),
AS_HELP_STRING([--enable-asciidoc], [build your own manpages with Asciidoc]),
[wantasciidoc=$enableval], [wantasciidoc=no])
# Help line for debug
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [enable debugging support]),
AS_HELP_STRING([--enable-debug], [enable debugging support]),
[debug=$enableval], [debug=no])
# Help line for pacman.static
AC_ARG_ENABLE(pacman-static,
AC_HELP_STRING([--disable-pacman-static], [do not build static version of pacman]),
[pacmanstatic=$enableval], [pacmanstatic=yes])
# Help line for using git version in pacman version string
AC_ARG_ENABLE(git-version,
AS_HELP_STRING([--enable-git-version],
[enable use of git version in version string if available]),
[wantgitver=$enableval], [wantgitver=no])
# Checks for programs.
AC_PROG_AWK
@@ -129,7 +125,6 @@ AC_PROG_CC_C99
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_LIBTOOL
AC_CHECK_PROGS([PYTHON], [python2.5 python2.4 python], [false])
@@ -138,13 +133,27 @@ AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.13.1)
# Check for libarchive
AC_CHECK_LIB([archive], [archive_read_data], , AC_MSG_ERROR([libarchive is needed to compile pacman!]))
AC_CHECK_LIB([archive], [archive_read_data], ,
AC_MSG_ERROR([libarchive is needed to compile pacman!]))
# Check for libdownload
AC_CHECK_LIB([download], [downloadParseURL], , AC_MSG_ERROR([libdownload is needed to compile pacman!]))
# Enable or disable usage of libdownload/libfetch
# - this is a nested check- first see if we need a library, if we do then
# check for libdownload first, then fallback to libfetch, then die
AC_MSG_CHECKING(whether to link with download library)
if test "x$internaldownload" = "xyes" ; then
AC_MSG_RESULT(yes)
AC_DEFINE([INTERNAL_DOWNLOAD], , [Use internal download library])
# Check for a download library if it was actually requested
AC_CHECK_LIB([download], [downloadParseURL], ,
AC_CHECK_LIB([fetch], [fetchParseURL], ,
AC_MSG_ERROR([libdownload or libfetch are needed to compile with internal download support])) )
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(INTERNAL_DOWNLOAD, test "x$internaldownload" = "xyes")
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/statvfs.h sys/time.h syslog.h wchar.h])
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/param.h sys/statvfs.h sys/syslimits.h sys/time.h syslog.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
@@ -156,13 +165,13 @@ AC_STRUCT_TM
AC_TYPE_UID_T
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MKTIME
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([realpath regcomp strcasecmp strdup strerror strnlen \
strndup strrchr strsep strstr strverscmp uname geteuid])
AC_CHECK_FUNCS([geteuid realpath regcomp strcasecmp \
strndup strrchr strsep swprintf \
wcwidth uname])
# Enable large file support if available
AC_SYS_LARGEFILE
@@ -172,13 +181,26 @@ GCC_VISIBILITY_CC
# Check if we have -fgnu89-inline flag
GCC_GNU89_INLINE_CC
# Host-dependant flags
case "${host}" in
*-*-cygwin*)
# Host-dependant definitions
SIZECMD="stat -c %s"
case "${host_os}" in
*bsd*)
SIZECMD="stat -f %z"
;;
cygwin*)
host_os_cygwin=yes
CFLAGS="$CFLAGS -DCYGWIN"
;;
darwin*)
host_os_darwin=yes
SIZECMD="stat -f %z"
;;
esac
AM_CONDITIONAL([CYGWIN], test "x$host_os_cygwin" = "xyes")
AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes")
AC_SUBST(SIZECMD)
# Check for architecture, used in default makepkg.conf
# (Note single space left after CARCHFLAGS)
case "${host}" in
@@ -235,9 +257,9 @@ fi
AM_CONDITIONAL(WANT_DOC, test "x$wantdoc" = "xyes")
# Check for doxygen support and status
AC_CHECK_PROGS([DOXYGEN], [doxygen])
AC_MSG_CHECKING([for doxygen])
if test "x$wantdoxygen" = "xyes" ; then
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test $DOXYGEN ; then
AC_MSG_RESULT([yes])
usedoxygen=yes
@@ -252,9 +274,9 @@ fi
AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes")
# Check for asciidoc support and status
AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
AC_MSG_CHECKING([for asciidoc])
if test "x$wantasciidoc" = "xyes" ; then
AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
if test $ASCIIDOC ; then
AC_MSG_RESULT([yes])
useasciidoc=yes
@@ -284,15 +306,24 @@ else
CFLAGS="$CFLAGS -Wall"
fi
# Enable or disable inclusion of pacman.static
AC_MSG_CHECKING(whether to build pacman.static)
if test "x$pacmanstatic" = "xyes" ; then
AC_MSG_RESULT(yes)
AC_DEFINE([INCLUDE_PACMAN_STATIC], , [Build pacman.static])
# Enable or disable use of git version in pacman version string
AC_CHECK_PROGS([GIT], [git])
AC_CHECK_FILE([.git/], hasgitdir=yes)
AC_MSG_CHECKING(whether to use git version if available)
if test "x$wantgitver" = "xyes" ; then
if test $GIT -a "x$hasgitdir" = "xyes"; then
AC_MSG_RESULT([yes])
usegitver=yes
AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string])
else
AC_MSG_RESULT([no, git or .git dir missing])
usegitver=no
fi
else
AC_MSG_RESULT(no)
AC_MSG_RESULT([no, disabled by configure])
usegitver=no
fi
AM_CONDITIONAL(INCLUDE_PACMAN_STATIC, test "x$pacmanstatic" = "xyes")
AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes")
# Set root directory
AC_SUBST(ROOTDIR)
@@ -323,7 +354,7 @@ Makefile
AC_OUTPUT
echo "
pacman_display_version:
${PACKAGE_NAME}:
Build information:
source code location : ${srcdir}
@@ -340,10 +371,12 @@ pacman_display_version:
Architecture : ${CARCH}
Architecture flags : ${CARCHFLAGS}
Host Type : ${CHOST}
Filesize command : ${SIZECMD}
libalpm version : ${LIB_VERSION}
libalpm version info : ${LIB_VERSION_INFO}
pacman version : ${PACKAGE_VERSION}
using git version : ${usegitver}
Directory and file information:
root working directory : ${ROOTDIR}
@@ -353,10 +386,10 @@ pacman_display_version:
Compilation options:
Run make in doc/ dir : ${wantdoc}
Use download library : ${internaldownload}
Doxygen support : ${usedoxygen}
Asciidoc support : ${useasciidoc}
debug support : ${debug}
build pacman.static : ${pacmanstatic}
"
# vim:set ts=2 sw=2 noet:

0
contrib/.gitignore vendored
View File

View File

@@ -1,10 +1,14 @@
EXTRA_DIST = \
PKGBUILD.vim \
bacman \
bash_completion \
gensync \
pacdiff \
paclist \
pacsearch \
re-pacman \
vimproject \
pactree \
updatesync \
vimprojects \
wget-xdelta.sh \
zsh_completion \
README

View File

@@ -57,7 +57,7 @@ syn keyword pb_k_license license contained
syn keyword pbLicense APACHE CDDL EPL FDL GPL LGPL MPL PHP RUBY ZLIB ISC MIT BSD contained
syn match pbLicenseCustom /custom\(:[[:alnum:]]*\)*/ contained
syn match pbIllegalLicense /[^='"() ]/ contained contains=pbLicenseCustom,pbLicense
syn region pbLicenseGroup start=/^license=(/ end=/)/ contains=pb_k_license,pbLicenseCustom,pbLicense,pbIllegalLicense,shDoubleQuote,shSingleQuote
syn region pbLicenseGroup start=/^license=(/ end=/)/ contains=pb_k_license,pbLicenseCustom,pbLicense,pbIllegalLicense
" backup
syn keyword pb_k_backup backup contained
@@ -67,8 +67,8 @@ syn region pbBackupGroup start=/^backup=(/ end=/)/ contains=pb_k_backup,pbValidB
" arch
syn keyword pb_k_arch arch contained
syn keyword pbArch i686 x86_64 ppc contained
syn match pbIllegalArch /[^='() ]/ contained contains=pbArch
syn region pbArchGroup start=/^arch=(/ end=/)/ contains=pb_k_arch,pbArch,pbIllegalArch,shDoubleQuote,shSingleQuote
syn match pbIllegalArch /[^='"() ]/ contained contains=pbArch
syn region pbArchGroup start=/^arch=(/ end=/)/ contains=pb_k_arch,pbArch,pbIllegalArch
" groups
syn keyword pb_k_groups groups contained
@@ -131,7 +131,7 @@ hi def link pbDerefEmulation PreProc
syn keyword pb_k_md5sums md5sums contained
syn match pbIllegalMd5sums /[^='"()\/ ]/ contained contains=pbValidMd5sums
syn match pbValidMd5sums /[[:alnum:]]\{32\}/ contained
syn region pbMd5sumsGroup start=/^md5sums/ end=/)/ contains=pb_k_md5sums,pbMd5Quotes,pbMd5Hash,pbIllegalMd5sums
syn region pbMd5sumsGroup start=/^md5sums/ end=/)/ contains=pb_k_md5sums,pbMd5Quotes,pbMd5Hash,pbIllegalMd5sums keepend
syn match pbMd5Quotes /'.*'\|".*"/ contained contains=pbMd5Hash,pbIllegalMd5sums
syn match pbMd5Hash /[[:alnum:]]\+/ contained contains=pbValidMd5sums
hi def link pbMd5Quotes Keyword
@@ -142,7 +142,7 @@ hi def link pbValidMd5sums Number
syn keyword pb_k_sha1sums sha1sums contained
syn match pbIllegalSha1sums /[^='"()\/ ]/ contained contains=pbValidSha1sums
syn match pbValidSha1sums /[[:alnum:]]\{40\}/ contained
syn region pbSha1sumsGroup start=/^sha1sums/ end=/)/ contains=pb_k_sha1sums,pbSha1Quotes,pbSha1Hash,pbIllegalSha1sums
syn region pbSha1sumsGroup start=/^sha1sums/ end=/)/ contains=pb_k_sha1sums,pbSha1Quotes,pbSha1Hash,pbIllegalSha1sums keepend
syn match pbSha1Quotes /'.*'\|".*"/ contained contains=pbSha1Hash,pbIllegalSha1sums
syn match pbSha1Hash /[[:alnum:]]\+/ contained contains=pbValidSha1sums
hi def link pbSha1Quotes Keyword
@@ -151,7 +151,7 @@ hi def link pbValidSha1sums Number
" options
syn keyword pb_k_options options contained
syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|ccache\|distcc\|makeflags\|force\)/ contained
syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|zipman\|ccache\|distcc\|makeflags\|force\)/ contained
syn match pbOptionsNeg /\!/ contained
syn match pbOptionsDeprec /no/ contained
syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQuote

View File

@@ -12,16 +12,26 @@ zsh_completion - a zsh completion script, install (with a rename) to
pacdiff - a simple pacnew/pacorig/pacsave updater for /etc/.
paclist - list all packages installed from a given repository. Useful for
seeing which packages you may have installed from the testing repository,
for instance.
pacsearch - a colorized search combining both -Ss and -Qs output. Installed
packages are easily identified with a *** and local-only packages are also
listed.
re-pacman - regenerate a pacman package based on installed files and the pacman
pactree - generate a dependency tree of an installed package in textual or
graphical form (using graphviz).
bacman - regenerate a pacman package based on installed files and the pacman
database entries. Useful for reuse, or possible config file extension.
vimproject - a project file for the vim project plugin (some files listed
may need to be updated).
vimprojects - a project file for the vim project plugin.
wget-xdelta.sh - A download script for pacman which allows binary deltas
generated with makepkg to be used instead of downloading full binary packages.
This should cut download sizes for some package upgrades significantly.
gensync, updatesync - The former repository management scripts that have since
been superseded by repo-add and repo-remove. They are here for posterity's
sake, and to show how repo-add and repo-remove can be wrapped in other scripts.

284
contrib/bacman Executable file
View File

@@ -0,0 +1,284 @@
#!/bin/bash
#
# bacman: recreate a package from a running system
# This script rebuilds an already installed package using metadata
# stored into the pacman database and system files
#
# (c) 2008 - locci <carlocci_at_gmail_dot_com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
readonly progname="bacman"
readonly progver="0.2.0"
#
# User Friendliness
#
function usage(){
echo "This program recreates a package using pacman's db and system files"
echo "Usage: $progname <installed package name>"
echo "Example: $progname kernel26"
}
if [ $# -ne 1 ] ; then
usage
exit 1
fi
if [ "$1" = "--help" -o "$1" = "-h" ] ; then
usage
exit 0
fi
if [ "$1" = "--version" -o "$1" = "-v" ]; then
echo "$progname version $progver"
echo "Copyright (C) 2008 locci"
exit 0
fi
#
# Fakeroot support
#
if [ $EUID -gt 0 ]; then
if [ -f /usr/bin/fakeroot ]; then
echo "Entering fakeroot environment"
export INFAKEROOT="1"
/usr/bin/fakeroot -u -- $0 $1
exit $?
else
echo "WARNING: installing fakeroot or running ${progname} as root is required to"
echo " preserve the ownership permissions of files in some packages"
echo ""
fi
fi
#
# Setting environmental variables
#
if [ ! -r /etc/pacman.conf ]; then
echo "ERROR: unable to read /etc/pacman.conf"
exit 1
fi
eval $(awk '/DBPath/ {print $1$2$3}' /etc/pacman.conf)
pac_db="${DBPath:-/var/lib/pacman/}/local"
if [ ! -r /etc/makepkg.conf ]; then
echo "ERROR: unable to read /etc/makepkg.conf"
exit 1
fi
source "/etc/makepkg.conf"
if [ -r ~/.makepkg.conf ]; then
source ~/.makepkg.conf
fi
pkg_arch=${CARCH:-'unknown'}
pkg_dest="${PKGDEST:-$PWD}"
pkg_ext=${PKGEXT:-'.pkg.tar.gz'}
pkg_pkger=${PACKAGER:-'Unknown Packager'}
pkg_name="$1"
pkg_dir="$(echo $pac_db/$pkg_name-[0-9]*)"
pkg_namver="${pkg_dir##*/}"
#
# Checks everything is in place
#
if [ ! -d "$pac_db" ] ; then
echo "ERROR: pacman database directory ${pac_db} not found"
exit 1
fi
if [ ! -d "$pkg_dir" ] ; then
echo "ERROR: package ${pkg_name} not found in pacman database"
exit 1
fi
#
# Begin
#
echo Package: ${pkg_namver}
work_dir=$(mktemp -d -p /tmp)
cd "$work_dir" || exit 1
#
# File copying
#
echo "Copying package files..."
cat "$pkg_dir"/files |
while read i; do
if [ -z "$i" ] ; then
continue
fi
if [[ "$i" =~ %[A-Z]*% ]] ; then
current=$i
continue
fi
case $current in
%FILES%)
ret=0
if [ -e "/$i" ]; then
bsdtar -cnf - "/$i" 2> /dev/null | bsdtar -xpf -
# Workaround to bsdtar not reporting a missing file as an error
if [ ! -e "$work_dir/$i" ] && [ -L "$work_dir/$i"]; then
echo ""
echo "ERROR: unable to add /$i to the package"
echo " If your user does not have permssion to read this file then"
echo " you will need to run $progname as root"
rm -rf "$work_dir"
exit 1
fi
else
echo ""
echo "WARNING: package file /$i is missing"
echo ""
fi
;;
esac
done
ret=$?
if [ $ret -ne 0 ]; then
rm -rf "$work_dir"
exit 1
fi
pkg_size=$(du -sk | awk '{print $1 * 1024}')
if [ -f "$pkg_dir/install" ] ; then
cp "$pkg_dir/install" "$work_dir/.INSTALL"
fi
if [ -f $pkg_dir/changelog ] ; then
cp "$pkg_dir/changelog" "$work_dir/.CHANGELOG"
fi
#
# .PKGINFO stuff
#
echo Generating .PKGINFO metadata...
echo "# Generated by $progname $progver" > .PKGINFO
if [ "$INFAKEROOT" = "1" ]; then
echo "# Using $(fakeroot -v)" >> .PKGINFO
fi
echo "# $(LC_ALL=C date)" >> .PKGINFO
echo "#" >> .PKGINFO
cat "$pkg_dir"/{desc,files,depends} |
while read i; do
if [[ -z "$i" ]]; then
continue;
fi
if [[ "$i" =~ %[A-Z]*% ]] ; then
current=$i
continue
fi
case "$current" in
# desc
%NAME%)
echo "pkgname = $i" >> .PKGINFO
;;
%VERSION%)
echo "pkgver = $i" >> .PKGINFO
;;
%DESC%)
echo "pkgdesc = $i" >> .PKGINFO
;;
%URL%)
echo "url = $i" >> .PKGINFO
;;
%LICENSE%)
echo "license = $i" >> .PKGINFO
;;
%ARCH%)
echo "arch = $i" >> .PKGINFO
;;
%BUILDDATE%)
echo "builddate = $(date -u "+%s")" >> .PKGINFO
;;
%PACKAGER%)
echo "packager = $pkg_pkger" >> .PKGINFO
;;
%SIZE%)
echo "size = $pkg_size" >> .PKGINFO
;;
%GROUPS%)
echo "group = $i" >> .PKGINFO
;;
%REPLACES%)
echo "replaces = $i" >> .PKGINFO
;;
%FORCE%)
echo "force = true" >> .PKGINFO
;;
# files
%BACKUP%)
# strip the md5sum after the tab
echo "backup = ${i%%$'\t'*}" >> .PKGINFO
;;
# depends
%DEPENDS%)
echo "depend = $i" >> .PKGINFO
;;
%OPTDEPENDS%)
echo "optdepend = $i" >> .PKGINFO
;;
%CONFLICTS%)
echo "conflict = $i" >> .PKGINFO
;;
%PROVIDES%)
echo "provides = $i" >> .PKGINFO
;;
esac
done
#
# Fixes owner:group and permissions for .PKGINFO, .CHANGELOG, .INSTALL
#
chown root:root "$work_dir"/{.PKGINFO,.CHANGELOG,.INSTALL} 2> /dev/null
chmod 644 "$work_dir"/{.PKGINFO,.CHANGELOG,.INSTALL} 2> /dev/null
#
# Generate the package
#
echo "Generating the package..."
ret=0
bsdtar -czf "$pkg_dest/$pkg_namver-$pkg_arch$pkg_ext" $(ls -A) || ret=$?
if [ $ret -ne 0 ]; then
echo "ERROR: unable to write package to $pkg_dest"
echo " Maybe the disk is full or you do not have write access"
rm -rf "$work_dir"
exit 1
fi
rm -rf "$work_dir"
echo Done
exit 0
# vim: set ts=2 sw=2 noet:

View File

@@ -146,14 +146,13 @@ _pacman ()
toparse="${a:2}"
case "${arg}" in
-@(A|U|R|S|Q|h|V))
-@(U|R|S|Q|h|V))
op="${arg/-}"
mod="${mod}${a:2}"
;;
--)
arg="${a:2}"
case "${arg}" in
add) op="A" ;;
remove) op="R" ;;
upgrade) op="U" ;;
query) op="Q" ;;
@@ -187,6 +186,7 @@ _pacman ()
dbonly) mod="${mod}k" ;;
nosave) mod="${mod}n" ;;
recursive) mod="${mod}s" ;;
unneeded) mod="${mod}u" ;;
esac ;;
*) toparse="${a}" ;;
esac
@@ -202,7 +202,6 @@ _pacman ()
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '\
-A --add \
-h --help \
-Q --query \
-R --remove \
@@ -216,9 +215,10 @@ _pacman ()
if [[ "$cur" == -* ]]; then
case "${op}" in
A|U)
U)
COMPREPLY=( $( compgen -W '\
--asdeps \
--asexplicit \
-d --nodeps \
-f --force \
-h --help \
@@ -242,6 +242,7 @@ _pacman ()
-k --dbonly \
-n --nosave \
-s --recursive \
-u --unneeded \
--config \
--logfile \
--noconfirm \
@@ -257,9 +258,9 @@ _pacman ()
S)
COMPREPLY=( $( compgen -W '\
--asdeps \
--asexplicit \
-c --clean \
-d --nodeps \
-e --dependsonly \
-f --force \
-g --groups \
-h --help \
@@ -316,7 +317,7 @@ _pacman ()
rem_selected
else
case "${op}" in
A|U)
U)
COMPREPLY=( $( compgen -d -- "$cur" ) \
$( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
return 0

77
scripts/gensync.sh.in → contrib/gensync Normal file → Executable file
View File

@@ -1,7 +1,6 @@
#!/bin/bash
#
# gensync
# @configure_input@
#
# Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
#
@@ -19,42 +18,35 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# gettext initialization
export TEXTDOMAIN='pacman'
export TEXTDOMAINDIR='@localedir@'
myver='@PACKAGE_VERSION@'
myver='3.1.1'
# functions
usage() {
printf "gensync (pacman) %s\n\n" "$myver"
printf "$(gettext "Usage: %s <root> <destfile> [package_directory]")\n\n" "$0"
printf "$(gettext "\
NOTE: this script is DEPRECATED. It will be removed in the next major\n\
release of pacman, so please use repo-add and repo-remove instead.\n\n")"
printf "$(gettext "\
printf "Usage: %s <root> <destfile> [package_directory]\n\n" "$0"
printf "\
gensync will generate a sync database by reading all PKGBUILD files\n\
from <root>. gensync builds the database in a temporary directory\n\
and then compresses it to <destfile>.\n\n")"
printf "$(gettext "\
and then compresses it to <destfile>.\n\n"
printf "\
gensync will calculate md5sums of packages in the same directory as\n\
<destfile>, unless an alternate [package_directory] is specified.\n\n")"
printf "$(gettext "\
<destfile>, unless an alternate [package_directory] is specified.\n\n"
printf "\
note: The <destfile> name is important. It must be of the form\n\
{treename}.db.tar.gz where {treename} is the name of the custom\n\
package repository you configured in /etc/pacman.conf. The\n\
generated database must reside in the same directory as your\n\
custom packages (also configured in /etc/pacman.conf)\n\n")"
echo "$(gettext "Example: gensync /var/abs/local /home/mypkgs/custom.db.tar.gz")"
custom packages (also configured in /etc/pacman.conf)\n\n"
echo "Example: gensync /var/abs/local /home/mypkgs/custom.db.tar.gz"
}
version() {
printf "gensync (pacman) %s\n" "$myver"
printf "$(gettext "\
printf "\
Copyright (C) 2002-2007 Judd Vinet <jvinet@zeroflux.org>.\n\n\
This is free software; see the source for copying conditions.\n\
There is NO WARRANTY, to the extent permitted by law.\n")"
There is NO WARRANTY, to the extent permitted by law.\n"
}
error () {
@@ -67,26 +59,8 @@ die () {
exit 1
}
check_force () {
local i
for i in ${options[@]}; do
local lc=$(echo $i | tr [:upper:] [:lower:])
if [ "$lc" = "force" ]; then
true
fi
done
false
}
# PROGRAM START
# determine whether we have gettext; make it a no-op if we do not
if [ ! $(type -t gettext) ]; then
gettext() {
echo "$@"
}
fi
if [ "$1" = "-h" -o "$1" = "--help" ]; then
usage
exit 0
@@ -103,10 +77,10 @@ if [ $# -lt 2 ]; then
fi
# source system and user makepkg.conf
if [ -r @sysconfdir@/makepkg.conf ]; then
source @sysconfdir@/makepkg.conf
if [ -r /etc/makepkg.conf ]; then
source /etc/makepkg.conf
else
die "$(gettext "%s not found. Can not continue.")" "@sysconfdir@/makepkg.conf"
die "/etc/makepkg.conf not found. Cannot continue."
fi
if [ -r ~/.makepkg.conf ]; then
@@ -124,22 +98,17 @@ if [ "$3" != "" ]; then
pkgdir="$3"
fi
[ ! -d "$rootdir" ] && die "$(gettext "invalid root dir: %s")" $rootdir
[ ! -d "$rootdir" ] && die "invalid root dir: $rootdir"
printf "$(gettext "\
NOTE: this script is DEPRECATED. It will be removed in the next major\n\
release of pacman, so please use repo-add and repo-remove instead.\n\n")"
echo "$(gettext "gensync: building database entries, generating md5sums...")" >&2
echo "gensync: building database entries, generating md5sums..." >&2
cd "$destdir"
pkgs=""
forcepkgs=""
for file in $(find "$rootdir"/* -name "$BUILDSCRIPT"); do
unset pkgname pkgver pkgrel options
source $file || die "$(gettext "failed to parse %s")" $file
source $file || die "failed to parse $file"
if [ "$arch" = 'any' ]; then
CARCH='any'
fi
@@ -150,20 +119,16 @@ for file in $(find "$rootdir"/* -name "$BUILDSCRIPT"); do
fi
if [ ! -f "$pkgfile" ]; then
error "$(gettext "could not find %s-%s-%s-%s%s - skipping")" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
error "could not find %s-%s-%s-%s%s - skipping" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
else
if check_force; then
forcepkgs="$forcepkgs $pkgfile"
else
pkgs="$pkgs $pkgfile"
fi
pkgs="$pkgs $pkgfile"
fi
done
echo "$(gettext "creating repo DB...")"
echo "creating repo DB..."
# we'll trim the output just a tad, as gensync may be used on large repos
repo-add $destfile $pkgs --force $force_pkgs \
repo-add $destfile $pkgs \
| grep -e "package" -e "database"
# vim: set ts=2 sw=2 noet:

View File

@@ -20,7 +20,7 @@
# Original http://phraktured.net/config/bin/pacdiff
diffprog=${DIFFPROG:-vimdiff}
for x in $(find /etc/ -name *.pacnew -o -name *.pacorig -o -name *.pacsave)
for x in $(find /etc/ -name "*.pacnew" -o -name "*.pacorig" -o -name "*.pacsave")
do
echo "File: ${x%.pac*}"
chk="$(cmp $x ${x%.pac*})"

88
contrib/paclist Executable file
View File

@@ -0,0 +1,88 @@
#!/usr/bin/perl
# paclist - List all packages installed from a given repo
#
# Copyright (C) 2008 Dan McGee <dpmcgee@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use warnings;
my $progname = "paclist";
my $version = "1.0";
if ($#ARGV != 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
print "$progname - List all packages installed from a given repo\n";
print "Usage: $progname <repo>\n";
print "Example: $progname testing\n";
if ($#ARGV != 0) {
exit 1;
}
exit 0;
}
if ( $ARGV[0] eq "--version" || $ARGV[0] eq "-v") {
print "$progname version $version\n";
print "Copyright (C) 2008 Dan McGee\n";
exit 0;
}
# This hash table will be used to store pairs of ('name version', count) from
# the return of both pacman -Sl <repo> and pacman -Q output. We then check to
# see if a value was added twice (count = 2)- if so, we will print that package
# as it is both in the repo we queried and installed on our local system.
my %packages = ();
my $output;
$output = `pacman -Sl $ARGV[0]`;
if ($? != 0) {
exit 1;
}
my @sync = split(/\n/, $output);
# sample output from pacman -Sl:
# testing foobar 1.0-1
foreach $_ (@sync) {
my @info = split(/ /);
# we only want to store 'foobar 1.0-1' in our hash table
my $pkg = $info[1] . " " . $info[2];
$packages{$pkg}++;
}
$output = `pacman -Q`;
if ($? != 0) {
exit 1;
}
# sample output from pacman -Q:
# foobar 1.0-1
my @local = split(/\n/, $output);
foreach $_ (@local) {
# store 'foobar 1.0-1' in our hash table
$packages{$_}++;
}
# run comparison check- if value was added twice, it was in the intersection
my @intersection;
foreach $_ (keys %packages) {
if ($packages{$_} == 2) {
push @{ \@intersection }, $_;
}
}
# print our intersection, and bask in the glory and speed of perl
@intersection = sort @intersection;
foreach $_ (@intersection) {
print $_ . "\n";
}
#vim: set noet:

View File

@@ -1,6 +1,9 @@
#!/bin/bash
#!/usr/bin/perl
# pacsearch - Adds color and install information to a 'pacman -Ss' search
#
# Copyright (C) 2008 Dan McGee <dpmcgee@gmail.com>
#
# Based off original shell script version:
# Copyright (C) 2006-2007 Dan McGee <dpmcgee@gmail.com>
#
# This program is free software; you can redistribute it and/or
@@ -18,72 +21,112 @@
#TODO: colors flag on commandline
readonly progname="pacsearch"
readonly version="1.0"
use strict;
use warnings;
readonly CLR1='\\\e[0;34m'
readonly CLR2='\\\e[0;32m'
readonly CLR3='\\\e[0;35m'
readonly CLR4='\\\e[0;36m'
readonly CLR5='\\\e[0;31m'
readonly CLR6='\\\e[0;33m'
readonly CLR7='\\\e[1;36m'
readonly INST='\\\e[1;31m'
readonly BASE='\\\e[0m'
my $progname = "pacsearch";
my $version = "2.0";
if [ "$1" = "--help" -o "$1" = "-h" ]; then
echo "Usage: $progname <pattern>"
echo "Ex: $progname ^gnome"
exit 0
fi
if ($#ARGV lt 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
print "$progname - Add color and install information to a pacman -Ss search\n";
print "Usage: $progname <pattern>\n";
print "Example: $progname ^gnome\n";
if ($#ARGV lt 0) {
exit 1;
}
exit 0;
}
if [ "$1" = "--version" -o "$1" = "-v" ]; then
echo "$progname version $version"
echo "Copyright (C) 2006-2007 Dan McGee"
exit 0
fi
if ($ARGV[0] eq "--version" || $ARGV[0] eq "-v") {
print "$progname version $version\n";
print "Copyright (C) 2006-2008 Dan McGee\n";
exit 0;
}
if [ -z "$1" -o "${1:0:1}" = "-" ]; then
echo "Usage: $progname <pattern>"
echo "Ex: $progname ^gnome"
exit 1
fi
# define our colors to use when printing
my $CLR1 = "\e[0;34m";
my $CLR2 = "\e[0;32m";
my $CLR3 = "\e[0;35m";
my $CLR4 = "\e[0;36m";
my $CLR5 = "\e[0;31m";
my $CLR6 = "\e[0;33m";
my $CLR7 = "\e[1;36m";
my $INST = "\e[1;31m";
my $BASE = "\e[0m";
my $INSTMARK = $INST."***";
# Make two temp files and send output of commands to these files
querydump=$(mktemp)
pacman -Qs $1 > $querydump
syncdump=$(mktemp)
pacman -Ss $1 > $syncdump
# color a "repo/pkgname pkgver" line based on the respository name
sub to_color {
my $line = shift;
$line =~ s/(^core\/.*)/$CLR1$1$BASE/;
$line =~ s/(^extra\/.*)/$CLR2$1$BASE/;
$line =~ s/(^community\/.*)/$CLR3$1$BASE/;
$line =~ s/(^testing\/.*)/$CLR4$1$BASE/;
$line =~ s/(^unstable\/.*)/$CLR5$1$BASE/;
$line =~ s/(^custom\/.*)/$CLR6$1$BASE/;
$line =~ s/(^local\/.*)/$CLR7$1$BASE/;
# any other unknown repository
$line =~ s/(^[\w-]*\/.*)/$CLR6$1$BASE/;
return $line;
}
# Strip descriptions and 'local/' from -Qs query
instpkg=$(mktemp)
egrep '^[^ ]' $querydump | sed -e 's@^local/@@' > $instpkg
my %allpkgs = ();
# Add pkgs not in sync db, mark pkgs that are installed
cat $instpkg | while read -r pkg; do
if [ -z "$(grep "$pkg" $syncdump)" ]; then
# grep package name; pipe to another grep that prints at most one
# line starting with 'local/', allows for comments >1 line
grep -A10 "$pkg" $querydump | grep -A10 -m1 "local/" >> $syncdump
fi
sed -i "s@^\(.\+/$pkg\)@\***\1@" $syncdump
done
my $syncout = `pacman -Ss '@ARGV'`;
# split each sync search entry into its own array entry
my @syncpkgs = split(/\n^(?=\w)/m, $syncout);
# remove the extra \n from the last desc entry
if ($#syncpkgs >= 0) {
chomp($syncpkgs[$#syncpkgs]);
}
# Print colorized package list and descriptions to screen
echo -e "$(sed -r \
-e "s@core/.*@$CLR1&$BASE@" \
-e "s@extra/.*@$CLR2&$BASE@" \
-e "s@community/.*@$CLR3&$BASE@" \
-e "s@testing/.*@$CLR4&$BASE@" \
-e "s@unstable/.*@$CLR5&$BASE@" \
-e "s@custom/.*@$CLR6&$BASE@" \
-e "s@local/.*@$CLR7&$BASE@" \
-e "s@(^|\*\*\*)([[:alnum:]]*/.* .*)@\1$CLR6\2$BASE@" \
-e "s@\*\*\*@$INST&@" \
< $syncdump )"
echo -en "\e[0m"
# counter var for packages, used here and in the query loop too
my $cnt = 0;
foreach $_ (@syncpkgs) {
# we grab 3 fields here: repo, name/ver, and desc
my @pkgfields = /^(.*?)\/(.*?)\n(.*)$/s;
# add a fourth field that will indicate install status
push (@pkgfields, "");
# add a fifth field that indicates original order
push (@pkgfields, $cnt++);
# add each sync pkg by name/ver to a hash table for quick lookup
$allpkgs{$pkgfields[1]} = [ @pkgfields ];
}
rm $querydump
rm $syncdump
rm $instpkg
my $queryout = `pacman -Qs '@ARGV'`;
# split each querysearch entry into its own array entry
my @querypkgs = split(/\n^(?=\w)/m, $queryout);
# remove the extra \n from the last desc entry
if ($#querypkgs >= 0) {
chomp ($querypkgs[$#querypkgs]);
}
foreach $_ (@querypkgs) {
# we grab 3 fields here: repo, name/ver, and desc
my @pkgfields = /^(.*?)\/(.*?)\n(.*)$/s;
# check if the package was listed in the sync out
# if it is we want to mark it with a *** marker
if (exists $allpkgs{$pkgfields[1]}) {
# mark it in our fourth field as installed
@{ $allpkgs{$pkgfields[1]} }[3] = $INSTMARK;
} else {
# add a fourth field that will indicate install status
push (@pkgfields, $INSTMARK);
# add a fifth field that indicates original order (after sync)
push (@pkgfields, $cnt++);
# add our local-only package to the hash
$allpkgs{$pkgfields[1]} = [ @pkgfields ];
}
}
# sort by original order (the fifth field) and print
foreach $_ ( sort{ @{$allpkgs{$a}}[4] <=> @{$allpkgs{$b}}[4] } keys %allpkgs) {
my @v = @{$allpkgs{$_}};
my $line = "$v[0]/$v[1]";
$line = to_color($line);
# print install marker + colorized "repo/pkgname pkgver" string
print "$v[3]$line\n";
print "$v[2]\n";
}
#vim: set noet:

301
contrib/pactree Executable file
View File

@@ -0,0 +1,301 @@
#!/bin/bash
# pactree : a simple dependency tree viewer
#
# Copyright (C) 2008 Carlo "carlocci" Bersani <carlocci@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Original http://carlocci.ngi.it/arch/pactree
# Credit to scj for the graphviz idea
# set the colors
branch1_color="\033[0;33m" #Brown
branch2_color="\033[0;37m" #Gray
leaf_color="\033[1;32m" #Light green
leaf2_color="\033[0;32m" #Green
# set the separators
separator=" "
branch_tip1="|--"
branch_tip2="+--"
provides="provides "
# set the graphviz options
# http://www.graphviz.org/doc/info/output.html for available output formats
# http://www.graphviz.org/doc/info/colors.html for available colors
gformat="png" #output format
start_color="red" #START color
nodes_color="green" #color of the nodes
arrow1_color="chocolate4" #color of the normal arrow
arrow2_color="grey" #color of the "provided by" headless arrow
readonly prog_name="pactree"
readonly prog_ver="0.2"
_usage(){
echo "This program generates the dependency tree of an installed package"
echo "Usage: $prog_name [OPTIONS] <installed packages>"
echo
echo " OPTIONS:"
echo " -c, --color Enable color output"
echo " -d, --depth INT Limit the shown dependencies depth"
echo " -g, --graph Use graphviz to make an image of the tree"
echo " -l, --linear Enable linear output"
echo " -s, --silent Shh, let me hear those errors!"
echo " -u, --unique Print the dependency list with no duplicates"
echo
echo " -h, --help Print this help message"
echo " -v, --version Print the program name and version"
echo
echo "Example: $prog_name -c -d 2 readline"
}
_version(){
echo "$prog_name version $prog_ver"
echo "Copyright (C) 2008 Carlo \"carlocci\" Bersani <carlocci@gmail.com>"
}
# end of the friendliness
# grab a field from the database: $1=path/to/file, $2=field to grab
_grabfield(){
for line in $(cat "$1" 2>/dev/null ); do
if [ -z "$line" ]; then
continue;
fi;
if [[ "$line" =~ %[A-Z]*% ]]; then
current="$line"
continue;
fi;
if [ "$current" = "$2" ]; then
echo "$line"
fi;
done
}
# find a dep in the db: $1=dep, $2=field, $3=dbfile, ret=file list
_finddep(){
for line in $(awk 'BEGIN{RS=""}
{
if ($1=="'"$2"'"){
for (i=2 ; i<=NF ; ++i){
if ($i ~ /^'"$1"'([<>=]+.*|)$/ ){
print FILENAME}
}
}
}' $(find $pac_db -name $3)); do
echo "${line%/*}"
done
}
# Recursive function: does all of the work, pays all of the taxes #
_tree(){
pkg_name="$1"
pkg_dirs="$(echo $pac_db/$pkg_name-[0-9]*)"
# Is $pkg_name real or provided?
[ ! -d "$pkg_dirs" ] && pkg_dirs="$(_finddep $pkg_name %PROVIDES% depends)"
for pkg_dir in $pkg_dirs ; do
spaces="$2"
unset provided
branch_tip="$branch_tip1"
branch_color="$branch1_color"
pkg_name="$(_grabfield "$pkg_dir/desc" %NAME%)"
if [ ! "$pkg_name" = "$1" ]; then
provided="$leaf2_color $provides$leaf_color$1"
branch_tip="$branch_tip2"
branch_color="$branch2_color"
if [ $graphviz -eq 1 ] && [[ ! "${dep_list[@]}" =~ _$1_ ]] && [ $spaces -ne $((max_depth+1)) ]; then
echo "\"$1\" -> \"$pkg_name\" [arrowhead=none, color=$arrow2_color];"
dep_list=( "${dep_list[@]}" "_$1_" )
_tree "$pkg_name" $((spaces+1))
continue
fi
fi
# Generate the spacer
spacer=""
for each in $(seq 1 $spaces); do
spacer="$spacer$separator"
done
spacer="$spacer$branch_tip"
[ $silent -ne 1 ] && echo -e "$branch_color$spacer$leaf_color$pkg_name$provided"
[ ! -d "$pkg_dir" ] && echo "No $pkg_name in the database (inconsistent database?)" >&2
if [[ ! " ${dep_list[@]} " =~ " $pkg_name " ]] && [ $spaces -ne $max_depth ]; then
dep_list=( "${dep_list[@]}" "$pkg_name" )
for dep_pkg in $(_grabfield "$pkg_dir/depends" %DEPENDS%); do
spaces=$2 #Bash scoping ;_;
if [ $graphviz -eq 1 ]; then
echo "\"$1\" -> \"${dep_pkg%%[<>=]*}\" [color=$arrow1_color];"
fi
_tree "${dep_pkg%%[<>=]*}" $((spaces+1))
done
fi
done
}
# Main program: gets all of the money, pays none of the taxes
# Command line parameters parser
if [ $# -eq 0 ]; then
_usage
exit 1
fi
options=( "$@" )
len_options=${#options[@]}
for (( n=0 ; n < $len_options ; n++ )); do
if [ "${options[$n]}" = "--" ]; then
unset options[$n]
break
fi
if [ "${options[$n]}" = "-h" -o "${options[$n]}" = "--help" ]; then
_usage
exit 0
fi
if [ "${options[$n]}" = "-v" -o "${options[$n]}" = "--version" ]; then
_version
exit 0
fi
if [ "${options[$n]}" = "-l" -o "${options[$n]}" = "--linear" ]; then
unset options[$n]
linear=1
continue
fi
if [ "${options[$n]}" = "-s" -o "${options[$n]}" = "--silent" ]; then
unset options[$n]
silent=1
continue
fi
if [ "${options[$n]}" = "-u" -o "${options[$n]}" = "--unique" ]; then
unset options[$n]
silent=1
nodup=1
continue
fi
if [ "${options[$n]}" = "-g" -o "${options[$n]}" = "--graph" ]; then
unset options[$n]
graphviz=1
continue
fi
if [ "${options[$n]}" = "-c" -o "${options[$n]}" = "--color" ]; then
unset options[$n]
colored=1
continue
fi
if [[ "${options[$n]}" =~ -d[[:digit:]]* || "${options[$n]}" == "--depth" ]]; then
if [[ "${options[$n]#-d}" =~ [[:digit:]]+ ]]; then
max_depth="${options[$n]#-d}"
elif [[ ${options[$((n+1))]} =~ [[:digit:]]+ ]]; then
# if [ ${options[$((n+1))]} -eq ${options[$((n+1))]} 2>/dev/null ]; then
max_depth="${options[$((n+1))]}"
unset options[$((n+1))]
((++n))
fi
unset options[$n]
continue
fi
done
# End of the dumb command line parser
# Env
colored=${colored:-0}
max_depth=${max_depth:--10}
linear=${linear:-0}
silent=${silent:-0}
nodup=${nodup:-0}
graphviz=${graphviz:-0}
if [ $colored -ne 1 ]; then
unset branch1_color
unset leaf_color
unset leaf2_color
unset branch2_color
fi
if [ $linear -eq 1 ]; then
unset separator
unset branch_tip1
unset branch_tip2
unset provides
fi
if [ $graphviz -eq 1 ]; then
silent=1
nodup=0
if [ ! -f /usr/bin/dot ]; then
echo "ERROR: package graphviz is not installed"
echo " Run pacman -S graphviz to install it"
exit 1
fi
fi
if [ ! -r /etc/pacman.conf ]; then
echo "ERROR: unable to read /etc/pacman.conf"
exit 1
else
eval $(awk '/DBPath/ {print $1$2$3}' /etc/pacman.conf)
fi
pac_db="${DBPath:-/var/lib/pacman}/local"
if [ ! -d "$pac_db" ] ; then
echo "ERROR: pacman database directory ${pac_db} not found"
exit 1
fi
# Env End
# Program starts
_main(){
for pkg_name in ${options[@]} ; do
[ $graphviz -eq 1 ] && echo -e "\"START\" -> \"$pkg_name\" ;"
_tree "$pkg_name" 0
if [ $nodup -eq 1 ]; then
for pkg_tree in ${dep_list[@]} ; do
echo "$pkg_tree"
done
fi
done
if [ $silent -eq 0 ]; then
echo -ne '\033[0m' # return colors to normal?
echo -ne '\033[?25h' #return cursor to normal?
fi
}
if [ $graphviz -eq 1 ]; then
root_pkgs="${options[@]}"
# Uncomment for the "generated by pactree" node in graphviz
#advert="xyz [height=0.07, fontsize=8.0, label=\"GENERATED WITH PACTREE\",shape=box,color="black",style=filled,fontcolor="white"];\n"
echo -e "digraph G { START [color=$start_color, style=filled];\n node [style=filled, color=$nodes_color];\n$(_main)\n$advert}" | dot -T$gformat -o "${root_pkgs// /_}.deps.$gformat"
else _main
fi
# vim: set ts=2 sw=2 noet:

View File

@@ -1,77 +0,0 @@
#!/bin/sh
#
# re-pacman: regenerate a pacman package based on installed files and the
# pacman database entries. Useful for reuse, or possible config file
# extension
#
# Copyright (c) 2006 Aaron Griffin <aaron@archlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#TODO
# * Check for md5 changes in backup lines and change pkgrel
pacinfo () {
[ $# -ne 2 ] && return 1
#use echo to strip spaces
echo $(pacman -Qi ${1} | grep "${2}" | cut -d: -f2-)
}
make_pkginfo () {
echo "# Generated by re-pacman 1.0.0"
echo "# On $(date)"
echo "pkgname =$(pacinfo ${1} Name)"
echo "pkgver =$(pacinfo ${1} Version)"
echo "pkgdesc =$(pacinfo ${1} Description)"
echo "url =$(pacinfo ${1} URL)"
echo "builddate =$(pacinfo ${1} 'Build Date')"
echo "packager =$(pacinfo ${1} Packager)"
echo "size =$(pacinfo ${1} Size)"
echo "arch =$(pacinfo ${1} Architecture)"
deps=$(pacinfo ${1} 'Depends On')
for d in ${deps}; do
echo "depend = ${d}"
done
}
LANG="POSIX"
if [ $# -ne 1 ]; then
echo "usage: re-pacman <installed package name>"
exit 1
fi
ver=$(pacinfo ${1} Version)
if [ "x${ver}" = "x" ]; then
echo "Package '${1}' not found, aborting."
exit 1
fi
echo ":: Cleaning up old files"
rm -f .PKGINFO "${1}-${ver}.pkg.tar.gz"
echo ":: Building PKGINFO"
make_pkginfo ${1} > .PKGINFO
flist=".PKGINFO"
flist="${flist} $(pacman -Ql ${1} | sed 's|\w* \(.*\)|/\1|g' | grep -v '/$')"
echo ":: Building final package tarball"
echo ${flist} | tr ' ' '\n' | tar czf "${1}-${ver}.pkg.tar.gz" -T - 2>/dev/null
rm -f .PKGINFO
echo ":: Package '${1}-${ver}.pkg.tar.gz' is now ready for installation"
# vim: set ts=2 sw=2 noet:

75
scripts/updatesync.sh.in → contrib/updatesync Normal file → Executable file
View File

@@ -1,7 +1,6 @@
#!/bin/bash
#
# updatesync
# @configure_input@
#
# Copyright (c) 2004 by Jason Chu <jason@archlinux.org>
# Derived from gensync (c) 2002-2006 Judd Vinet <jvinet@zeroflux.org>
@@ -20,40 +19,33 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# gettext initialization
export TEXTDOMAIN='pacman'
export TEXTDOMAINDIR='@localedir@'
myver='@PACKAGE_VERSION@'
myver='3.1.1'
# functions
usage() {
printf "updatesync (pacman) %s\n\n" "$myver"
printf "$(gettext "Usage: %s <action> <destfile> <option> [package_directory]")\n\n" "$0"
printf "$(gettext "\
NOTE: this script is DEPRECATED. It will be removed in the next major\n\
release of pacman, so please use repo-add and repo-remove instead.\n\n")"
printf "$(gettext "\
printf "Usage: %s <action> <destfile> <option> [package_directory]\n\n" "$0"
printf "\
updatesync will update a sync database by reading a PKGBUILD and\n\
modifying the destfile. updatesync updates the database in a temporary\n\
directory and then compresses it to <destfile>.\n\n")"
printf "$(gettext "There are two types of actions:\n\n")"
printf "$(gettext "upd - Will update a package's entry or create it if it doesn't exist.\n It takes the package's PKGBUILD as an option.\n")"
printf "$(gettext "del - Will remove a package's entry from the db. It takes the package's\n name as an option.\n")"
directory and then compresses it to <destfile>.\n\n"
printf "There are two types of actions:\n\n"
printf "upd - Will update a package's entry or create it if it doesn't exist.\n It takes the package's PKGBUILD as an option.\n"
printf "del - Will remove a package's entry from the db. It takes the package's\n name as an option.\n"
echo
printf "$(gettext "\
printf "\
updatesync will calculate md5sums of packages in the same directory as\n\
<destfile>, unless an alternate [package_directory] is specified.\n\n")"
echo "$(gettext "Example: updatesync upd /home/mypkgs/custom.db.tar.gz PKGBUILD")"
<destfile>, unless an alternate [package_directory] is specified.\n\n"
echo "Example: updatesync upd /home/mypkgs/custom.db.tar.gz PKGBUILD"
}
version() {
printf "updatesync (pacman) %s\n" "$myver"
printf "$(gettext "\
printf "\
Copyright (C) 2004 Jason Chu <jason@archlinux.org>.\n\n\
This is free software; see the source for copying conditions.\n\
There is NO WARRANTY, to the extent permitted by law.\n")"
There is NO WARRANTY, to the extent permitted by law.\n"
}
error () {
@@ -66,26 +58,8 @@ die () {
exit 1
}
check_force () {
local i
for i in ${options[@]}; do
local lc=$(echo $i | tr [:upper:] [:lower:])
if [ "$lc" = "force" ]; then
true
fi
done
false
}
# PROGRAM START
# determine whether we have gettext; make it a no-op if we do not
if [ ! $(type -t gettext) ]; then
gettext() {
echo "$@"
}
fi
if [ "$1" = "-h" -o "$1" = "--help" ]; then
usage
exit 0
@@ -102,10 +76,10 @@ if [ $# -lt 3 ]; then
fi
# source system and user makepkg.conf
if [ -r @sysconfdir@/makepkg.conf ]; then
source @sysconfdir@/makepkg.conf
if [ -r /etc/makepkg.conf ]; then
source /etc/makepkg.conf
else
die "$(gettext "%s not found. Can not continue.")" "@sysconfdir@/makepkg.conf"
die "/etc/makepkg.conf not found. Cannot continue."
fi
if [ -r ~/.makepkg.conf ]; then
@@ -124,39 +98,30 @@ pkgdir="$(pwd)"
if [ "$4" != "" ]; then
pkgdir="$4"
fi
opt_force=""
printf "$(gettext "\
NOTE: this script is DEPRECATED. It will be removed in the next major\n\
release of pacman, so please use repo-add and repo-remove instead.\n\n")"
if [ "$action" = "upd" ]; then # INSERT / UPDATE
if [ ! -f "$option" ]; then
die "$(gettext "%s not found")" $option
die "$option not found"
fi
unset pkgname pkgver pkgrel options
source $option || die "$(gettext "failed to parse %s")" $option
source $option || die "failed to parse $option"
if [ "$arch" = 'any' ]; then
CARCH='any'
fi
pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}"
if [ ! -f "$pkgfile" ]; then
die "$(gettext "could not find %s-%s-%s-%s%s - aborting")" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
die "could not find %s-%s-%s-%s%s - aborting" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
fi
if check_force; then
opt_force="--force"
fi
repo-add "$pkgdb" $opt_force "$pkgfile"
repo-add "$pkgdb" "$pkgfile"
else # DELETE
fname="$(basename $option)"
if [ "$fname" = "PKGBUILD" ]; then
if [ ! -f "$option" ]; then
die "$(gettext "%s not found")" $option
die "%s not found" $option
fi
unset pkgname pkgver pkgrel options

View File

@@ -1,96 +0,0 @@
This is a project file for the vim-project
plugin. I like it, so decided to contribute
this to the main repo.
$ pacman -S vim-project
change the pacman= path below
$ vim
:Project vimproject
pacman=~/devel/pacman-lib CD=. flags=S {
Makefile.am
configure.ac
libalpm=lib/libalpm/ filter="*.c *.h *.am"{
add.c
alpm.c
alpm_list.c
backup.c
be_files.c
cache.c
conflict.c
db.c
deps.c
error.c
group.c
handle.c
log.c
md5.c
package.c
provide.c
remove.c
server.c
sync.c
trans.c
util.c
add.h
alpm.h
alpm_list.h
backup.h
cache.h
conflict.h
db.h
deps.h
error.h
group.h
handle.h
log.h
md5.h
package.h
provide.h
remove.h
server.h
sync.h
trans.h
util.h
Makefile.am
Makefile.in
}
pacman=src/pacman/ filter="*.c *.h *.am" {
add.c
conf.c
deptest.c
downloadprog.c
log.c
package.c
pacman.c
query.c
remove.c
sync.c
trans.c
upgrade.c
util.c
add.h
conf.h
deptest.h
downloadprog.h
log.h
package.h
query.h
remove.h
sync.h
trans.h
upgrade.h
util.h
Makefile.am
}
utils=src/util filter="*.c *.h *.am" {
testpkg.c
vercmp.c
Makefile.am
}
contrib=contrib CD=. {
bash_completion
pacsearch
vimproject
zsh_completion
}
}

25
contrib/vimprojects Normal file
View File

@@ -0,0 +1,25 @@
This is a project file
for the vim-project plugin.
Save it as ~/.vimprojects
$ pacman -S vim-project
change the pacman path below
$ vim
:Project
Press \r in the project view
on a project name to generate
the list of files
pacman=~/devel/pacman/ CD=. filter="*.ac *.am" flags=S {
libalpm=lib/libalpm/ filter="*.c *.h *.am" {
}
pacman=src/pacman/ filter="*.c *.h *.am" {
}
scripts=scripts/ filter="*.sh.in *.py.in *.am" {
}
utils=src/util filter="*.c *.h *.am" {
}
contrib=contrib CD=. {
}
}

View File

@@ -6,7 +6,6 @@ typeset -A opt_args
# options for passing to _arguments: main pacman commands
_pacman_opts_commands=(
'-A[Add a package to the system]'
'-Q[Query the package database]'
'-R[Remove a package from the system]'
'-S[Synchronize packages]'
@@ -29,7 +28,7 @@ _pacman_opts_common=(
'--noscriptlet[Do not execute the install scriptlet if one exists]'
)
# options for passing to _arguments: options for --add and --update commands
# options for passing to _arguments: options for --upgrade commands
_pacman_opts_pkgfile=(
'-d[Skip dependency checks]'
'-f[Overwrite conflicting files]'
@@ -78,7 +77,6 @@ _pacman_opts_sync_actions=(
# options for passing to _arguments: options for --sync command
_pacman_opts_sync_modifiers=(
'-d[Skip dependency checks]'
'-e[Install dependencies only]'
'-f[Overwrite conflicting files]'
'-i[View package information]'
'-l[List all packages in a repository]'
@@ -91,15 +89,9 @@ _pacman_opts_sync_modifiers=(
'*--ignoregroup[Ignore a group upgrade]:package group:
_pacman_completions_all_groups'
'--asdeps[Install packages as non-explicitly installed]'
'--asexplicit[Install packages as explicitly installed]'
)
# handles --action subcommand
_pacman_action_add() {
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_pkgfile[@]"
}
# handles --help subcommand
_pacman_action_help() {
_arguments -s : \
@@ -290,7 +282,6 @@ _pacman_get_command() {
# main dispatcher
_pacman() {
case $words[2] in
-A*) _pacman_action_add ;;
-Q*g*) # ipkg groups
_arguments -s : \
"$_pacman_opts_common[@]" \

View File

@@ -1,4 +1,4 @@
# Doxyfile 1.5.2
# Doxyfile 1.5.5
#---------------------------------------------------------------------------
# Project related configuration options
@@ -28,7 +28,8 @@ FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
@@ -37,10 +38,14 @@ TAB_SIZE = 4
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -49,6 +54,7 @@ EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
@@ -60,6 +66,7 @@ SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
@@ -126,6 +133,10 @@ HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
@@ -194,7 +205,9 @@ EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH = ../..
INCLUDE_FILE_PATTERNS = *.h
PREDEFINED = HAVE_CONFIG_H= SYMHIDDEN= SYMEXPORT=
PREDEFINED = HAVE_CONFIG_H= \
SYMHIDDEN= \
SYMEXPORT=
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
@@ -227,6 +240,7 @@ DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 3
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES

View File

@@ -32,6 +32,14 @@ EXTRA_DIST = \
MOSTLYCLEANFILES = *.xml
MAINTAINERCLEANFILES = $(ASCIIDOC_MANS)
if USE_GIT_VERSION
GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 | sed s/^v//')-dirty
REAL_PACKAGE_VERSION = $(GIT_VERSION)
else
REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
endif
man_MANS =
dist_man_MANS = $(ASCIIDOC_MANS) repo-remove.8
@@ -47,7 +55,7 @@ endif
if USE_ASCIIDOC
ASCIIDOC_OPTS = \
-f asciidoc.conf \
-a pacman_version="$(PACKAGE_VERSION)" \
-a pacman_version="$(REAL_PACKAGE_VERSION)" \
-a pacman_date="`date +%Y-%m-%d`" \
-a sysconfdir=$(sysconfdir)
A2X_OPTS = \

View File

@@ -1,4 +1,4 @@
# Maintainer: judd <jvinet@zeroflux.org>
# Maintainer: Joe User <joe.user@example.com>
pkgname=patch
pkgver=2.5.4
@@ -13,8 +13,8 @@ source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz)
md5sums=('ee5ae84d115f051d87fcaaef3b4ae782')
build() {
cd $startdir/src/$pkgname-$pkgver
cd $srcdir/$pkgname-$pkgver
./configure --prefix=/usr
make || return 1
make prefix=$startdir/pkg/usr install
make prefix=$pkgdir/usr install
}

View File

@@ -30,12 +30,22 @@ distribution of this package.
Options and Directives
----------------------
The following is a list of standard options and directives available for use
in a PKGBUILD. These are all understood and interpreted by makepkg, and most
will be directly transferred to the built package.
If you need to create any custom variables for use in your build process, it is
recommended to name your custom variables with an '_' (underscore) prefix.
This will prevent any possible name clashes with internal makepkg variables.
For example, to store the base kernel version in a variable, use something
similar to `$_basekernver`.
*pkgname*::
The name of the package. This has be a unix-friendly name as it will be
used in the package filename.
*pkgver*::
The version of the software as released from the author (e.g. \'2.7.1').
The version of the software as released from the author (e.g. '2.7.1').
*pkgrel*::
This is the release number specific to the Arch Linux release. This
@@ -77,6 +87,10 @@ Options and Directives
variables if possible when specifying the download location. Any files
that are compressed will automatically be extracted, unless found in
the noextract array listed below.
+
It is also possible to specify an optional filename, which is helpful
with weird URLs and for handling multiple source files with the same
name. The syntax is: `source=('filename::url')`
*noextract (array)*::
An array of filenames corresponding to those from the source array. Files
@@ -89,14 +103,13 @@ Options and Directives
source array (in the same order). makepkg will use this to verify source
file integrity during subsequent builds. To easily generate md5sums, run
``makepkg -g >> PKGBUILD''. If desired, move the md5sums line to an
appropriate location. *NOTE:* makepkg supports multiple integrity
algorithms and their corresponding arrays (i.e. sha1sums for the SHA1
algorithm); however, official packages use only md5sums for the time
being.
appropriate location.
*sha1sums, etc.*::
Alternative integrity checks that makepkg supports, as noted in md5sums
above.
*sha1sums, sha256sums, sha384sums, sha512sums (arrays)*::
Alternative integrity checks that makepkg supports; these all behave
similar to the md5sums option described above. To enable use and generation
of these checksums, be sure to set up the `INTEGRITY_CHECK` option in
linkman:makepkg.conf[5].
*groups (array)*::
An array of symbolic names that represent groups of packages, allowing
@@ -182,6 +195,9 @@ Options and Directives
*emptydirs*;;
Leave empty directories in packages.
*zipman*;;
Compress man pages with gzip.
*ccache*;;
Allow the use of ccache during build. More useful in its negative
form `!ccache` with select packages that have problems building
@@ -202,9 +218,42 @@ Options and Directives
Force the package to be upgraded by a pacman system upgrade
operation, even if the version number would normally not trigger
such an upgrade. This is useful when the version numbering scheme
of a package changes (or is alphanumeric).
of a package changes (or is alphanumeric). See linkman:pacman[8] for
more infomation on version comparisons.
build() Function
----------------
In addition to the above directives, the build() bash function comprises the
remainder of the PKGBUILD. This is directly sourced and executed by makepkg, so
anything that bash or the system has available is available for use here. Be
sure any exotic commands used are covered by `makedepends`.
All of the above variables such as `pkgname` and `pkgver` are available for use
in the build function. In addition, makepkg defines three variables for your
use during the build and install process. These three variables are as follows:
*startdir*::
This contains the absolute path to the directory where the PKGBUILD was
located, which is usually the output of `$(pwd)` when makepkg is started.
$$startdir$$ was most often used in combination with `/src` or `/pkg`
postfixes, but use of the `srcdir` and `pkgdir` variables is preferred.
*srcdir*::
This points to the directory where makepkg extracts or copies all source
files. Although it currently is an alias for `$startdir/src`, this
assumption should not be assumed true for all future revisions of makepkg.
*pkgdir*::
This points to the directory where makepkg bundles the installed package
(this directory will become the root directory of your built package).
Although it currently is an alias for `$startdir/pkg`, this assumption
should not be assumed true for all future revisions of makepkg.
If you create any variables of your own in the build function, it is
recommended to use the bash `local` keyword to scope the variable to inside
the build function.
Install/Upgrade/Remove Scripting
--------------------------------
Pacman has the ability to store and execute a package-specific script when it

View File

@@ -15,9 +15,16 @@ mailto:pacman-dev@archlinux.org[].
Authors
-------
Current maintainers:
* Dan McGee <dan@archlinux.org>
* Xavier Chantry <shiningxc@gmail.com>
* Aaron Griffin <aaron@archlinux.org>
Past contributors:
* Judd Vinet <jvinet@zeroflux.org>
* Aurelien Foret <aurelien@archlinux.org>
* Aaron Griffin <aaron@archlinux.org>
* Dan McGee <dan@archlinux.org>
See the 'AUTHORS' file for additional contributors.

View File

@@ -45,13 +45,6 @@ Options
for rebuilding packages from source when the PKGBUILD may be slightly
outdated and not updated with an `$$arch=('yourarch')$$` field.
*-b, \--builddeps*::
Build missing dependencies from source. When makepkg finds missing
build-time or run-time dependencies, it will look for the dependencies'
PKGBUILD files under `SRCROOT` (set in linkman:makepkg.conf[5]). If it
finds them it will call makepkg to build and install the missing
dependencies. The child calls will be made with the `-b` and `-i` options.
*-c, \--clean*::
Clean up leftover work files and directories after a successful build.
@@ -135,10 +128,18 @@ Options
dependencies are not found, pacman will try to resolve them. If
successful, the missing packages will be downloaded and installed.
*\--allsource*::
Do not actually build the package, but build a source-only tarball that
includes all sources, including those that are normally download via
makepkg. This is useful for passing a single tarball to another program
such as a chroot or remote builder. It will also satisfy requirements of
the GPL when distributing binary packages.
*\--source*::
Do not actually build the package, but build a source-only tarball. This
is useful for passing a single tarball to another program such as a
chroot, remote builder, or an AUR upload.
Do not actually build the package, but build a source-only tarball that
does not include sources that can be fetched via a download URL. This is
useful for passing a single tarball to another program such as a chroot,
remote builder, or a tarball upload.
*\--noconfirm*::
(Passed to pacman) Prevent pacman from waiting for user input before

View File

@@ -34,9 +34,13 @@ Options
**DLAGENTS=(**\'protocol::/path/to/command [options]' ...**)**::
Sets the download agents used to fetch source files specified with a URL in
the linkman:PKGBUILD[5] file. Options can be specified for each command as
well; the download URL is placed on the end of the command. This is more
flexible than the former `FTPAGENT` variable, as any protocol can have a
download agent. Several examples are provided in the default makepkg.conf.
well, and any protocol can have a download agent. Several examples are provided
in the default makepkg.conf.
+
If present, `%u` will be replaced with the download URL. Otherwise, the
download URL will be placed on the end of the command. If present, `%o` will
be replaced with the local filename, plus a ``.part'' extension, which allows
makepkg to handle resuming file downloads.
**CARCH=**"carch"::
Specifies your computer architecture; possible values include such things
@@ -94,8 +98,8 @@ Options
running in the DistCC cluster. In addition, you will want to modify your
`MAKEFLAGS`.
**OPTIONS=(**strip !docs libtool emptydirs**)**::
This array contains options that affect the default packaging. All four are
**OPTIONS=(**strip docs libtool emptydirs zipman**)**::
This array contains options that affect the default packaging. They are
equivalent to options that can be placed in the PKGBUILD; the defaults are
shown here. All options should always be left in the array; to enable or
disable an option simply remove or place an ``!'' at the front of the
@@ -117,6 +121,9 @@ Options
*emptydirs*;;
Leave empty directories in packages.
*zipman*;;
Compress man pages with gzip.
**INTEGRITY_CHECK=(**check1 ...**)**::
File integrity checks to use. Multiple checks may be specified; this
affects both generation and checking. The current valid options are:
@@ -128,6 +135,13 @@ Options
that are located in opt/, you may need to add the directory to this
array. *NOTE:* Do not add the leading slash to the directory name.
**STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**::
If "strip" is specified in the OPTIONS array, this variable will
instruct makepkg where to look to for files to strip. If you build
packages that are located in opt/, you may need to add the directory
to this array. *NOTE:* Do not add the leading slash to the directory
name.
**PKGDEST=**"/path/to/folder"::
If this value is not set, packages will by default be placed in the
current directory (location of the linkman:PKGBUILD[5]). Many people

View File

@@ -28,13 +28,6 @@ ends to be written (for instance, a GUI front end).
Operations
----------
*-A, \--add* (deprecated)::
Add a package to the system. Either a URL or file path can be specified.
The package will be uncompressed into the installation root and the
database will be updated. The package will not be installed if another
version is already installed. *NOTE*: please use '\--upgrade' in place of
this option.
*-Q, \--query*::
Query the package database. This operation allows you to view installed
packages and their files, as well as meta-information about individual
@@ -56,7 +49,9 @@ Operations
example, `pacman -S qt` will download and install qt and all the
packages it depends on. If a package name exists in more than one repo, the
repo can be explicitly specified to clarify the package to install:
`pacman -S testing/qt`.
`pacman -S testing/qt`. You can also specify version requirements:
`pacman -S "bash>=3.2"`. (Quotes are needed, otherwise your shell
interprets ">" as redirection to file.)
+
In addition to packages, groups can be specified as well. For example, if
gnome is a defined package group, then `pacman -S gnome` will install every
@@ -68,7 +63,13 @@ provide the same functionality as foo will be searched for. If any package is
found, it will be installed.
+
You can also use `pacman -Su` to upgrade all packages that are out of date. See
<<SO,Sync Options>> below.
<<SO,Sync Options>> below. When upgrading, pacman performs version comparison
to determine which packages need upgrading. This behavior operates as follows:
Alphanumeric:
1.0a < 1.0alpha < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0
Numeric:
1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
*-U, \--upgrade*::
Upgrade or add a package to the system. Either a URL or file path can be
@@ -86,16 +87,22 @@ You can also use `pacman -Su` to upgrade all packages that are out of date. See
Options
-------
*\--asdeps*::
Install packages non-explicitly; in other works, fake their install reason
Install packages non-explicitly; in other words, fake their install reason
to be installed as a dependency. This is useful for makepkg and other
build from source tools that need to install dependencies before building
the package.
*\--asexplicit*::
Install packages explicitly; in other words, fake their install reason to
be explicitly installed. This is useful if you want to mark a dependency
as explicitly installed so it will not be removed by the '\--recursive'
remove operation.
*-b, \--dbpath* <'path'>::
Specify an alternative database location (a typical default is
``/var/lib/pacman''). This should not be used unless you know what you are
doing. *NOTE*: if specified, this is an absolute path and the root path is
not automatically prepended. This behavior changed in pacman 3.1.0.
not automatically prepended.
*-d, \--nodeps*::
Skips all dependency checks. Normally, pacman will always check a
@@ -113,7 +120,7 @@ Options
not be used as a way to install software into ``/usr/local'' instead of
``/usr''. This option is used if you want to install a package on a
temporary mounted partition which is "owned" by another system.
*NOTE*: If database path or logfile are not specified on either the
*NOTE*: if database path or logfile are not specified on either the
command line or in linkman:pacman.conf[5], their default location will
be inside this root path.
@@ -124,8 +131,7 @@ Options
Specify an alternative package cache location (a typical default is
``/var/cache/pacman/pkg''). Multiple cache directories can be specified,
and they are tried in the order they are passed to pacman. *NOTE*: this
is an absolute path, the root path is not automatically prepended. This
behavior changed in pacman 3.1.0.
is an absolute path, the root path is not automatically prepended.
*\--config* <'file'>::
Specify an alternate configuration file.
@@ -193,6 +199,11 @@ Query Options[[QO]]
not an entry in the database. The file will be decompressed and queried.
This is useful in combination with '\--info' and '\--list'.
*-q, \--quiet*::
Show less information for certain query operations. Search will only show
package names and not version, group, and description information; a bare
query will only show package names rather than names and versions.
*-s, \--search* <'regexp'>::
This will search each locally-installed package for names or
descriptions that match `regexp`.
@@ -226,7 +237,12 @@ Remove Options[[RO]]
that (A) they are not required by other packages; and (B) they were not
explicitly installed by the user. This operation is recursive and analogous
to a backwards '\--sync' operation, and helps keep a clean system without
orphans.
orphans. If you want to omit condition (B), pass this option twice.
*-u, \--unneeded*::
Removes the targets that are not required by any other packages.
This is mostly useful when removing a group without using the '-c' option,
to avoid breaking any dependencies.
Sync Options[[SO]]
@@ -241,10 +257,9 @@ Sync Options[[SO]]
packages that are no longer installed; use two to remove all packages
from the cache. In both cases, you will have a yes or no option to
remove packages and/or unused downloaded databases.
*-e, \--dependsonly*::
Install all dependencies of a package, but not the specified package
itself. This is pretty useless and we're not sure why it even exists.
+
If you use a network shared cache, see the 'CleanMethod' option in
linkman:pacman.conf[5].
*-g, \--groups*::
Display all the members for each package group specified. If no group
@@ -264,6 +279,11 @@ Sync Options[[SO]]
dependencies yet to be installed. These can be piped to a file and
downloaded at a later time, using a program like wget.
*-q, \--quiet*::
Show less information for certain sync operations. Search will only show
package names and not version, group, and description information; list
will only show package names and omit databases and versions.
*-s, \--search* <'regexp'>::
This will search each package in the sync databases for names or
descriptions that match `regexp`.
@@ -288,7 +308,7 @@ Sync Options[[SO]]
to date.
*\--needed*::
Only install the targets that are not already installed and up-to-date.
Don't reinstall the targets that are already up-to-date.
*\--ignore* <'package'>::
Directs pacman to ignore upgrades of package even if there is one

View File

@@ -40,6 +40,9 @@ Include = /etc/pacman.d/core
Server = file:///home/pkgs
--------
NOTE: Each directive must be in CamelCase. If the case isn't respected, the
directive won't be recognized. For example. noupgrade or NOUPGRADE will not
work.
Options
-------
@@ -55,7 +58,7 @@ Options
Overrides the default location of the toplevel database directory. A
typical default is ``/var/lib/pacman/''. Most users will not need to set
this option. *NOTE*: if specified, this is an absolute path and the root
path is not automatically prepended. This behavior changed in pacman 3.1.0.
path is not automatically prepended.
*CacheDir =* path/to/cache/dir::
Overrides the default location of the package cache directory. A typical
@@ -63,14 +66,13 @@ Options
specified, and they are tried in the order they are listed in the config
file. If a file is not found in any cache directory, it will be downloaded
to the first cache directory with write access. *NOTE*: this is an absolute
path, the root path is not automatically prepended. This behavior changed
in pacman 3.1.0.
path, the root path is not automatically prepended.
*LogFile =* '/path/to/file'::
Log actions directly to a file. A typical default is
``/var/log/pacman.log''. As of pacman 3.1.0, this does not need to be
specified by default. This is an absolute path and root is not prepended.
Overrides the default location of the pacman log file. A typical default
is ``/var/log/pacman.log''. This is an absolute path and the root directory
is not prepended.
*HoldPkg =* package ...::
If a user tries to '\--remove' a package that's listed in `HoldPkg`,
@@ -80,6 +82,12 @@ Options
Instructs pacman to ignore any upgrades for this package when performing
a '\--sysupgrade'.
*SyncFirst =* package ...::
Instructs pacman to check for newer version of these packages before any
sync operation. The user will have the choice to either cancel the current
operation and upgrade these packages first or go on with the current operation.
This option is typically used with the 'pacman' package.
*IgnoreGroup =* group ...::
Instructs pacman to ignore any upgrades for all packages in this
group when performing a '\--sysupgrade'.
@@ -104,8 +112,9 @@ Options
*NoUpgrade =* file ...::
All files listed with a `NoUpgrade` directive will never be touched during
a package install/upgrade. Do not include the leading slash when specifying
files.
a package install/upgrade.
These files refer to files in the package archive, so do not include the
leading slash (the RootDir) when specifying them.
*NoExtract =* file ...::
All files listed with a `NoExtract` directive will never be extracted from
@@ -113,6 +122,17 @@ Options
of a package to be installed. For example, if your httpd root uses an
'index.php', then you would not want the 'index.html' file to be extracted
from the 'apache' package.
These files refer to files in the package archive, so do not include the
leading slash (the RootDir) when specifying them.
*CleanMethod =* KeepInstalled | KeepCurrent::
If set to `KeepInstalled` (the default), the '-Sc' operation will clean
packages that are no longer installed (not present in the local database).
If set to `KeepCurrent`, '-Sc' will clean outdated packages (not present in
any sync database).
The second behavior is useful when the package cache is shared among
multiple machines, where the local databases are usually different, but the
sync databases in use could be the same.
*UseSyslog*::
Log action messages through syslog(). This will insert log entries into
@@ -127,7 +147,7 @@ Options
*TotalDownload*::
When downloading, display the amount downloaded, download rate, ETA,
and completed percentage of the entire download list list rather
and completed percentage of the entire download list rather
than the percent of each individual download target. The progress
bar is still based solely on the current file download.

View File

@@ -16,9 +16,9 @@ repo-add - package database maintenance utility
Synopsis
--------
repo-add <path-to-db> [--force] <package> ...
repo-add [-q] <path-to-db> <package> ...
repo-remove <path-to-db> <packagename> ...
repo-remove [-q] <path-to-db> <packagename> ...
Description
@@ -36,12 +36,9 @@ on the command line.
Options
-------
*--force* (repo-add only)::
Add a force entry to the sync database, which tells pacman to skip version
number comparison and update the package regardless. This flag can be
specified in the middle of the command line, with any packages listed
before the flag being added as normal entries, and any specified after
being marked as force upgrades.
*-q, \--quiet*::
Force this program to keep quiet and run silent except for warning and
error messages.
See Also

View File

@@ -8,11 +8,11 @@
#
#-- The download utilities that makepkg should use to acquire sources
# Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3'
'http::/usr/bin/wget -c -t 3 --waitretry=3'
'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate'
'rsync::/usr/bin/rsync -z'
'scp::/usr/bin/scp -C')
DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'
'rsync::/usr/bin/rsync -z %u %o'
'scp::/usr/bin/scp -C %u %o')
# Other common tools:
# /usr/bin/snarf
@@ -58,20 +58,23 @@ BUILDENV=(fakeroot !distcc color !ccache !xdelta)
# These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip !docs libtool emptydirs)
# Default: OPTIONS=(strip docs libtool emptydirs zipman)
# A negated option will do the opposite of the comments below.
#
#-- strip: Strip symbols from binaries/libraries
#-- docs: Save doc and info directories
#-- libtool: Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman: Compress manpages with gzip
#
OPTIONS=(strip !docs libtool emptydirs)
OPTIONS=(strip docs libtool emptydirs zipman)
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Info and doc directories to remove (if option set correctly above)
DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc})
#-- Directories to be searched for the strip option (if option set correctly above)
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
#########################################################################
# PACKAGE OUTPUT
@@ -83,8 +86,6 @@ DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc})
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Source root: specify location where PKGBUILDs are located for '--builddeps'
#SRCROOT=/home/pkgbuilds
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"

View File

@@ -14,7 +14,25 @@
#CacheDir = @localstatedir@/cache/pacman/pkg/
#LogFile = @localstatedir@/log/pacman.log
HoldPkg = pacman glibc
# If upgrades are available for these packages they will be asked for first
SyncFirst = pacman
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#XferCommand = /usr/bin/curl %u > %o
#CleanMethod = KeepInstalled
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options (all disabled by default)
#NoPassiveFtp
#UseSyslog
#ShowSize
#UseDelta
#TotalDownload
#
# REPOSITORIES

View File

@@ -10,8 +10,12 @@ DEFS = -DLOCALEDIR=\"@localedir@\" @DEFS@
AM_CFLAGS = -pedantic -D_GNU_SOURCE
if ENABLE_VISIBILITY_CC
if DARWIN
AM_CFLAGS += -fvisibility=hidden
else
AM_CFLAGS += -fvisibility=internal
endif
endif
if ENABLE_GNU89_INLINE_CC
AM_CFLAGS += -fgnu89-inline
endif
@@ -22,23 +26,26 @@ libalpm_la_SOURCES = \
alpm_list.h alpm_list.c \
backup.h backup.c \
be_files.c \
be_package.c \
cache.h cache.c \
conflict.h conflict.c \
db.h db.c \
delta.h delta.c \
deps.h deps.c \
error.h error.c \
dload.h dload.c \
error.c \
graph.h \
group.h group.c \
handle.h handle.c \
log.h log.c \
md5.h md5.c \
package.h package.c \
remove.h remove.c \
server.h server.c \
sync.h sync.c \
trans.h trans.c \
util.h util.c
libalpm_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_INFO)
libalpm_la_LIBADD = $(LTLIBINTL)
# vim:set ts=2 sw=2 noet:

View File

@@ -27,6 +27,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <inttypes.h> /* int64_t */
#include <stdint.h> /* intmax_t */
/* libarchive */
#include <archive.h>
@@ -37,7 +39,6 @@
#include "alpm_list.h"
#include "trans.h"
#include "util.h"
#include "error.h"
#include "cache.h"
#include "log.h"
#include "backup.h"
@@ -68,41 +69,25 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
pkgname = alpm_pkg_get_name(pkg);
pkgver = alpm_pkg_get_version(pkg);
if(trans->type != PM_TRANS_TYPE_UPGRADE) {
/* only install this package if it is not already installed */
if(_alpm_db_get_pkgfromcache(db, pkgname)) {
pm_errno = PM_ERR_PKG_INSTALLED;
goto error;
}
}
/* check if an older version of said package is already in transaction
* packages. if so, replace it in the list */
for(i = trans->packages; i; i = i->next) {
pmpkg_t *pkg = i->data;
if(strcmp(pkg->name, pkgname) == 0) {
if(_alpm_versioncmp(pkg->version, pkgver) < 0) {
pmpkg_t *newpkg;
pmpkg_t *transpkg = i->data;
if(strcmp(transpkg->name, pkgname) == 0) {
if(alpm_pkg_vercmp(transpkg->version, pkgver) < 0) {
_alpm_log(PM_LOG_WARNING, _("replacing older version %s-%s by %s in target list\n"),
pkg->name, pkg->version, pkgver);
if((newpkg = _alpm_pkg_load(name, 1)) == NULL) {
/* pm_errno is already set by pkg_load() */
goto error;
}
transpkg->name, transpkg->version, pkgver);
_alpm_pkg_free(i->data);
i->data = newpkg;
i->data = pkg;
} else {
_alpm_log(PM_LOG_WARNING, _("newer version %s-%s is in the target list -- skipping\n"),
pkg->name, pkg->version);
_alpm_log(PM_LOG_WARNING, _("skipping %s-%s because newer version %s is in the target list\n"),
pkgname, pkgver, transpkg->version);
_alpm_pkg_free(pkg);
}
return(0);
}
}
if(trans->flags & PM_TRANS_FLAG_ALLDEPS) {
pkg->reason = PM_PKG_REASON_DEPEND;
}
/* add the package to the transaction */
trans->packages = alpm_list_add(trans->packages, pkg);
@@ -113,15 +98,6 @@ error:
return(-1);
}
/* This is still messy. We have a lot of compare functions, and we should
* try to consolidate them as much as we can (between add and sync) */
/*static int deppkg_cmp(const void *p1, const void *p2)
{
return(strcmp(((pmdepmissing_t *)p1)->target,
((pmdepmissing_t *)p2)->target));
}*/
int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
{
alpm_list_t *lp = NULL;
@@ -138,12 +114,13 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
/* look for unsatisfied dependencies */
_alpm_log(PM_LOG_DEBUG, "looking for unsatisfied dependencies\n");
lp = alpm_checkdeps(db, trans->type == PM_TRANS_TYPE_UPGRADE, NULL, trans->packages);
lp = alpm_checkdeps(db, 1, NULL, trans->packages);
if(lp != NULL) {
if(data) {
*data = lp;
} else {
FREELIST(lp);
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_depmiss_free);
alpm_list_free(lp);
}
RET_ERR(PM_ERR_UNSATISFIED_DEPS, -1);
}
@@ -160,14 +137,15 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
if(data) {
*data = lp;
} else {
FREELIST(lp);
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_conflict_free);
alpm_list_free(lp);
}
if(inner) {
_alpm_log(PM_LOG_ERROR, _("conflicting packages were found in the target list\n"));
_alpm_log(PM_LOG_ERROR, _("you cannot install two conflicting packages at the same time\n"));
}
if(outer) {
_alpm_log(PM_LOG_ERROR, _("replacing packages with -A and -U is not supported yet\n"));
_alpm_log(PM_LOG_ERROR, _("replacing packages with -U is not supported yet\n"));
_alpm_log(PM_LOG_ERROR, _("you can replace packages manually using -Rd and -U\n"));
}
RET_ERR(PM_ERR_CONFLICTING_DEPS, -1);
@@ -175,7 +153,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
/* re-order w.r.t. dependencies */
_alpm_log(PM_LOG_DEBUG, "sorting by dependencies\n");
lp = _alpm_sortbydeps(trans->packages, PM_TRANS_TYPE_ADD);
lp = _alpm_sortbydeps(trans->packages, 0);
/* free the old alltargs */
alpm_list_free(trans->packages);
trans->packages = lp;
@@ -193,7 +171,8 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
if(data) {
*data = lp;
} else {
FREELIST(lp);
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_fileconflict_free);
alpm_list_free(lp);
}
RET_ERR(PM_ERR_FILE_CONFLICTS, -1);
}
@@ -210,6 +189,9 @@ static int upgrade_remove(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *trans, pm
* with the type PM_TRANS_TYPE_REMOVEUPGRADE. TODO: kill this weird
* behavior. */
pmtrans_t *tr = _alpm_trans_new();
ALPM_LOG_FUNC;
_alpm_log(PM_LOG_DEBUG, "removing old package first (%s-%s)\n",
oldpkg->name, oldpkg->version);
@@ -243,6 +225,7 @@ static int upgrade_remove(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *trans, pm
char *backup = _alpm_backup_file(b->data);
/* safety check (fix the upgrade026 pactest) */
if(!alpm_list_find_str(filelist, backup)) {
FREE(backup);
continue;
}
_alpm_log(PM_LOG_DEBUG, "adding %s to the NoUpgrade array temporarily\n",
@@ -289,11 +272,12 @@ static int extract_single_file(struct archive *archive,
struct archive_entry *entry, pmpkg_t *newpkg, pmpkg_t *oldpkg,
pmtrans_t *trans, pmdb_t *db)
{
const char *entryname; /* the name of the file in the archive */
const char *entryname;
mode_t entrymode;
char filename[PATH_MAX]; /* the actual file we're extracting */
int needbackup = 0, notouch = 0;
char *hash_orig = NULL;
char *entryname_orig = NULL;
const int archive_flags = ARCHIVE_EXTRACT_OWNER |
ARCHIVE_EXTRACT_PERM |
ARCHIVE_EXTRACT_TIME;
@@ -306,12 +290,12 @@ static int extract_single_file(struct archive *archive,
if(strcmp(entryname, ".INSTALL") == 0) {
/* the install script goes inside the db */
snprintf(filename, PATH_MAX, "%s/%s-%s/install", db->path,
snprintf(filename, PATH_MAX, "%s%s-%s/install", db->path,
newpkg->name, newpkg->version);
archive_entry_set_mode(entry, 0644);
} else if(strcmp(entryname, ".CHANGELOG") == 0) {
/* the changelog goes inside the db */
snprintf(filename, PATH_MAX, "%s/%s-%s/changelog", db->path,
snprintf(filename, PATH_MAX, "%s%s-%s/changelog", db->path,
newpkg->name, newpkg->version);
archive_entry_set_mode(entry, 0644);
} else if(*entryname == '.') {
@@ -337,7 +321,8 @@ static int extract_single_file(struct archive *archive,
/* if a file is in the add skiplist we never extract it */
if(alpm_list_find_str(trans->skip_add, filename)) {
_alpm_log(PM_LOG_DEBUG, "%s is in trans->skip_add, skipping extraction\n", entryname);
_alpm_log(PM_LOG_DEBUG, "%s is in trans->skip_add, skipping extraction\n",
entryname);
archive_read_data_skip(archive);
return(0);
}
@@ -436,7 +421,7 @@ static int extract_single_file(struct archive *archive,
/* if we force hash_orig to be non-NULL retroactive backup works */
if(needbackup && !hash_orig) {
hash_orig = strdup("");
STRDUP(hash_orig, "", RET_ERR(PM_ERR_MEMORY, -1));
}
}
}
@@ -444,35 +429,35 @@ static int extract_single_file(struct archive *archive,
/* case 5,8: don't need to do anything special */
}
/* we need access to the original entryname later after calls to
* archive_entry_set_pathname(), so we need to dupe it and free() later */
STRDUP(entryname_orig, entryname, RET_ERR(PM_ERR_MEMORY, -1));
if(needbackup) {
char *tempfile = NULL;
char checkfile[PATH_MAX];
char *hash_local = NULL, *hash_pkg = NULL;
int fd;
int ret;
/* extract the package's version to a temporary file and checksum it */
tempfile = strdup("/tmp/alpm_XXXXXX");
fd = mkstemp(tempfile);
snprintf(checkfile, PATH_MAX, "%s.paccheck", filename);
archive_entry_set_pathname(entry, checkfile);
archive_entry_set_pathname(entry, tempfile);
int ret = archive_read_extract(archive, entry, archive_flags);
ret = archive_read_extract(archive, entry, archive_flags);
if(ret == ARCHIVE_WARN) {
/* operation succeeded but a non-critical error was encountered */
_alpm_log(PM_LOG_DEBUG, "warning extracting %s (%s)\n",
entryname, archive_error_string(archive));
entryname_orig, archive_error_string(archive));
} else if(ret != ARCHIVE_OK) {
_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"),
entryname, archive_error_string(archive));
entryname_orig, archive_error_string(archive));
alpm_logaction("error: could not extract %s (%s)\n",
entryname, archive_error_string(archive));
unlink(tempfile);
entryname_orig, archive_error_string(archive));
FREE(hash_orig);
close(fd);
FREE(entryname_orig);
return(1);
}
hash_local = alpm_get_md5sum(filename);
hash_pkg = alpm_get_md5sum(tempfile);
hash_pkg = alpm_get_md5sum(checkfile);
/* append the new md5 hash to it's respective entry
* in newpkg's backup (it will be the new orginal) */
@@ -480,16 +465,13 @@ static int extract_single_file(struct archive *archive,
for(backups = alpm_pkg_get_backup(newpkg); backups;
backups = alpm_list_next(backups)) {
char *oldbackup = alpm_list_getdata(backups);
if(!oldbackup || strcmp(oldbackup, entryname) != 0) {
if(!oldbackup || strcmp(oldbackup, entryname_orig) != 0) {
continue;
}
char *backup = NULL;
/* length is tab char, null byte and MD5 (32 char) */
int backup_len = strlen(oldbackup) + 34;
backup = malloc(backup_len);
if(!backup) {
RET_ERR(PM_ERR_MEMORY, -1);
}
size_t backup_len = strlen(oldbackup) + 34;
MALLOC(backup, backup_len, RET_ERR(PM_ERR_MEMORY, -1));
sprintf(backup, "%s\t%s", oldbackup, hash_pkg);
backup[backup_len-1] = '\0';
@@ -497,7 +479,7 @@ static int extract_single_file(struct archive *archive,
backups->data = backup;
}
_alpm_log(PM_LOG_DEBUG, "checking hashes for %s\n", entryname);
_alpm_log(PM_LOG_DEBUG, "checking hashes for %s\n", entryname_orig);
_alpm_log(PM_LOG_DEBUG, "current: %s\n", hash_local);
_alpm_log(PM_LOG_DEBUG, "new: %s\n", hash_pkg);
_alpm_log(PM_LOG_DEBUG, "original: %s\n", hash_orig);
@@ -511,19 +493,20 @@ static int extract_single_file(struct archive *archive,
/* move the existing file to the "pacorig" */
if(rename(filename, newpath)) {
archive_entry_set_pathname(entry, filename);
_alpm_log(PM_LOG_ERROR, _("could not rename %s (%s)\n"), filename, strerror(errno));
alpm_logaction("error: could not rename %s (%s)\n", filename, strerror(errno));
_alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
filename, newpath, strerror(errno));
alpm_logaction("error: could not rename %s to %s (%s)\n",
filename, newpath, strerror(errno));
errors++;
} else {
/* copy the tempfile we extracted to the real path */
if(_alpm_copyfile(tempfile, filename)) {
archive_entry_set_pathname(entry, filename);
_alpm_log(PM_LOG_ERROR, _("could not copy tempfile to %s (%s)\n"), filename, strerror(errno));
alpm_logaction("error: could not copy tempfile to %s (%s)\n", filename, strerror(errno));
/* rename the file we extracted to the real name */
if(rename(checkfile, filename)) {
_alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
checkfile, filename, strerror(errno));
alpm_logaction("error: could not rename %s to %s (%s)\n",
checkfile, filename, strerror(errno));
errors++;
} else {
archive_entry_set_pathname(entry, filename);
_alpm_log(PM_LOG_WARNING, _("%s saved as %s\n"), filename, newpath);
alpm_logaction("warning: %s saved as %s\n", filename, newpath);
}
@@ -536,38 +519,48 @@ static int extract_single_file(struct archive *archive,
/* installed file has NOT been changed by user */
if(strcmp(hash_orig, hash_pkg) != 0) {
_alpm_log(PM_LOG_DEBUG, "action: installing new file: %s\n",
entryname);
entryname_orig);
if(_alpm_copyfile(tempfile, filename)) {
_alpm_log(PM_LOG_ERROR, _("could not copy tempfile to %s (%s)\n"), filename, strerror(errno));
if(rename(checkfile, filename)) {
_alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
checkfile, filename, strerror(errno));
alpm_logaction("error: could not rename %s to %s (%s)\n",
checkfile, filename, strerror(errno));
errors++;
}
archive_entry_set_pathname(entry, filename);
} else {
/* there's no sense in installing the same file twice, install
* ONLY is the original and package hashes differ */
_alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place\n");
unlink(checkfile);
}
} else if(strcmp(hash_orig, hash_pkg) == 0) {
/* originally installed file and new file are the same - this
* implies the case above failed - i.e. the file was changed by a
* user */
_alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place\n");
unlink(checkfile);
} else if(strcmp(hash_local, hash_pkg) == 0) {
/* this would be magical. The above two cases failed, but the
* user changes just so happened to make the new file exactly the
* same as the one in the package... skip it */
_alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place\n");
unlink(checkfile);
} else {
char newpath[PATH_MAX];
_alpm_log(PM_LOG_DEBUG, "action: keeping current file and installing new one with .pacnew ending\n");
_alpm_log(PM_LOG_DEBUG, "action: keeping current file and installing"
" new one with .pacnew ending\n");
snprintf(newpath, PATH_MAX, "%s.pacnew", filename);
if(_alpm_copyfile(tempfile, newpath)) {
_alpm_log(PM_LOG_ERROR, _("could not install %s as %s: %s\n"), filename, newpath, strerror(errno));
alpm_logaction("error: could not install %s as %s: %s\n", filename, newpath, strerror(errno));
if(rename(checkfile, newpath)) {
_alpm_log(PM_LOG_ERROR, _("could not install %s as %s (%s)\n"),
filename, newpath, strerror(errno));
alpm_logaction("error: could not install %s as %s (%s)\n",
filename, newpath, strerror(errno));
} else {
_alpm_log(PM_LOG_WARNING, _("%s installed as %s\n"), filename, newpath);
alpm_logaction("warning: %s installed as %s\n", filename, newpath);
_alpm_log(PM_LOG_WARNING, _("%s installed as %s\n"),
filename, newpath);
alpm_logaction("warning: %s installed as %s\n",
filename, newpath);
}
}
}
@@ -575,10 +568,9 @@ static int extract_single_file(struct archive *archive,
FREE(hash_local);
FREE(hash_pkg);
FREE(hash_orig);
unlink(tempfile);
FREE(tempfile);
close(fd);
} else {
int ret;
/* we didn't need a backup */
if(notouch) {
/* change the path to a .pacnew extension */
@@ -599,16 +591,17 @@ static int extract_single_file(struct archive *archive,
archive_entry_set_pathname(entry, filename);
int ret = archive_read_extract(archive, entry, archive_flags);
ret = archive_read_extract(archive, entry, archive_flags);
if(ret == ARCHIVE_WARN) {
/* operation succeeded but a non-critical error was encountered */
_alpm_log(PM_LOG_DEBUG, "warning extracting %s (%s)\n",
entryname, archive_error_string(archive));
entryname_orig, archive_error_string(archive));
} else if(ret != ARCHIVE_OK) {
_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"),
entryname, archive_error_string(archive));
entryname_orig, archive_error_string(archive));
alpm_logaction("error: could not extract %s (%s)\n",
entryname, archive_error_string(archive));
entryname_orig, archive_error_string(archive));
FREE(entryname_orig);
return(1);
}
@@ -618,18 +611,15 @@ static int extract_single_file(struct archive *archive,
char *backup = NULL, *hash = NULL;
char *oldbackup = alpm_list_getdata(b);
/* length is tab char, null byte and MD5 (32 char) */
int backup_len = strlen(oldbackup) + 34;
size_t backup_len = strlen(oldbackup) + 34;
if(!oldbackup || strcmp(oldbackup, entryname) != 0) {
if(!oldbackup || strcmp(oldbackup, entryname_orig) != 0) {
continue;
}
_alpm_log(PM_LOG_DEBUG, "appending backup entry for %s\n", filename);
hash = alpm_get_md5sum(filename);
backup = malloc(backup_len);
if(!backup) {
RET_ERR(PM_ERR_MEMORY, -1);
}
MALLOC(backup, backup_len, RET_ERR(PM_ERR_MEMORY, -1));
sprintf(backup, "%s\t%s", oldbackup, hash);
backup[backup_len-1] = '\0';
@@ -638,6 +628,7 @@ static int extract_single_file(struct archive *archive,
b->data = backup;
}
}
FREE(entryname_orig);
return(errors);
}
@@ -645,14 +636,12 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
pmtrans_t *trans, pmdb_t *db)
{
int i, ret = 0, errors = 0;
struct archive *archive;
struct archive_entry *entry;
char cwd[PATH_MAX] = "";
char scriptlet[PATH_MAX+1];
int is_upgrade = 0;
double percent = 0.0;
pmpkg_t *oldpkg = NULL;
ALPM_LOG_FUNC;
snprintf(scriptlet, PATH_MAX, "%s%s-%s/install", db->path,
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
@@ -667,12 +656,11 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
/* we'll need to save some record for backup checks later */
oldpkg = _alpm_pkg_dup(local);
/* copy over the install reason (unless alldeps is set) */
if(trans->flags & PM_TRANS_FLAG_ALLDEPS) {
newpkg->reason = PM_PKG_REASON_DEPEND;
} else {
/* make sure all infos are loaded because the database entry
* will be removed soon */
_alpm_db_read(oldpkg->origin_data.db, oldpkg, INFRQ_ALL);
/* copy over the install reason */
newpkg->reason = alpm_pkg_get_reason(local);
}
/* pre_upgrade scriptlet */
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
@@ -693,27 +681,43 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
}
}
/* we override any pre-set reason if we have alldeps or allexplicit set */
if(trans->flags & PM_TRANS_FLAG_ALLDEPS) {
newpkg->reason = PM_PKG_REASON_DEPEND;
} else if(trans->flags & PM_TRANS_FLAG_ALLEXPLICIT) {
newpkg->reason = PM_PKG_REASON_EXPLICIT;
}
if(oldpkg) {
/* set up fake remove transaction */
int ret = upgrade_remove(oldpkg, newpkg, trans, db);
if(ret != 0) {
return(ret);
goto cleanup;
}
}
if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) {
struct archive *archive;
struct archive_entry *entry;
char cwd[PATH_MAX] = "";
_alpm_log(PM_LOG_DEBUG, "extracting files\n");
if ((archive = archive_read_new()) == NULL) {
RET_ERR(PM_ERR_LIBARCHIVE_ERROR, -1);
pm_errno = PM_ERR_LIBARCHIVE;
ret = -1;
goto cleanup;
}
archive_read_support_compression_all(archive);
archive_read_support_format_all(archive);
_alpm_log(PM_LOG_DEBUG, "archive: %s\n", newpkg->origin_data.file);
if(archive_read_open_filename(archive, newpkg->origin_data.file,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
RET_ERR(PM_ERR_PKG_OPEN, -1);
pm_errno = PM_ERR_PKG_OPEN;
ret = -1;
goto cleanup;
}
/* save the cwd so we can restore it later */
@@ -735,17 +739,22 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
}
for(i = 0; archive_read_next_header(archive, &entry) == ARCHIVE_OK; i++) {
double percent;
if(newpkg->size != 0) {
/* Using compressed size for calculations here, as newpkg->isize is not
* exact when it comes to comparing to the ACTUAL uncompressed size
* (missing metadata sizes) */
unsigned long pos = archive_position_compressed(archive);
int64_t pos = archive_position_compressed(archive);
percent = (double)pos / (double)newpkg->size;
_alpm_log(PM_LOG_DEBUG, "decompression progress: %f%% (%ld / %ld)\n",
percent*100.0, pos, newpkg->size);
_alpm_log(PM_LOG_DEBUG, "decompression progress: "
"%f%% (%"PRId64" / %jd)\n",
percent*100.0, pos, (intmax_t)newpkg->size);
if(percent >= 1.0) {
percent = 1.0;
}
} else {
percent = 0.0;
}
if(is_upgrade) {
@@ -770,7 +779,7 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
}
if(errors) {
ret = 1;
ret = -1;
if(is_upgrade) {
_alpm_log(PM_LOG_ERROR, _("problem occurred while upgrading %s\n"),
newpkg->name);
@@ -796,7 +805,9 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
alpm_logaction("error: could not update database entry %s-%s\n",
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
RET_ERR(PM_ERR_DB_WRITE, -1);
pm_errno = PM_ERR_DB_WRITE;
ret = -1;
goto cleanup;
}
if(_alpm_db_add_pkgincache(db, newpkg) == -1) {
@@ -811,7 +822,6 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
PROGRESS(trans, PM_TRANS_PROGRESS_ADD_START,
alpm_pkg_get_name(newpkg), 100, pkg_count, pkg_current);
}
EVENT(trans, PM_TRANS_EVT_EXTRACT_DONE, NULL, NULL);
/* run the post-install script if it exists */
if(alpm_pkg_has_scriptlet(newpkg)
@@ -832,9 +842,9 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
EVENT(trans, PM_TRANS_EVT_ADD_DONE, newpkg, oldpkg);
}
cleanup:
_alpm_pkg_free(oldpkg);
return(0);
return(ret);
}
int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
@@ -851,7 +861,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
return(0);
}
pkg_count = alpm_list_count(trans->targets);
pkg_count = alpm_list_count(trans->packages);
pkg_current = 1;
/* loop through our package list adding/upgrading one at a time */

View File

@@ -25,7 +25,6 @@
/* libalpm */
#include "alpm.h"
#include "alpm_list.h"
#include "error.h"
#include "handle.h"
#include "util.h"

View File

@@ -1,7 +1,7 @@
/*
* alpm.h
*
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
@@ -26,6 +26,7 @@
extern "C" {
#endif
#include <sys/types.h> /* for off_t */
#include <time.h> /* for time_t */
#include <stdarg.h> /* for va_list */
@@ -45,14 +46,12 @@ typedef struct __pmdb_t pmdb_t;
typedef struct __pmpkg_t pmpkg_t;
typedef struct __pmdelta_t pmdelta_t;
typedef struct __pmgrp_t pmgrp_t;
typedef struct __pmserver_t pmserver_t;
typedef struct __pmtrans_t pmtrans_t;
typedef struct __pmsyncpkg_t pmsyncpkg_t;
typedef struct __pmdepend_t pmdepend_t;
typedef struct __pmdepmissing_t pmdepmissing_t;
typedef struct __pmconflict_t pmconflict_t;
typedef struct __pmfileconflict_t pmfileconflict_t;
typedef struct __pmgraph_t pmgraph_t;
/*
* Library
@@ -81,21 +80,23 @@ int alpm_logaction(char *fmt, ...);
* Downloading
*/
typedef void (*alpm_cb_download)(const char *filename, int file_xfered,
int file_total, int list_xfered, int list_total);
typedef void (*alpm_cb_download)(const char *filename,
off_t xfered, off_t total);
typedef void (*alpm_cb_totaldl)(off_t total);
/*
* Options
*/
#define PM_DLFNM_LEN 22
alpm_cb_log alpm_option_get_logcb();
void alpm_option_set_logcb(alpm_cb_log cb);
alpm_cb_download alpm_option_get_dlcb();
void alpm_option_set_dlcb(alpm_cb_download cb);
alpm_cb_totaldl alpm_option_get_totaldlcb();
void alpm_option_set_totaldlcb(alpm_cb_totaldl cb);
const char *alpm_option_get_root();
int alpm_option_set_root(const char *root);
@@ -170,7 +171,6 @@ int alpm_db_update(int level, pmdb_t *db);
pmpkg_t *alpm_db_get_pkg(pmdb_t *db, const char *name);
alpm_list_t *alpm_db_getpkgcache(pmdb_t *db);
alpm_list_t *alpm_db_whatprovides(pmdb_t *db, const char *name);
pmgrp_t *alpm_db_readgrp(pmdb_t *db, const char *name);
alpm_list_t *alpm_db_getgrpcache(pmdb_t *db);
@@ -192,7 +192,7 @@ int alpm_pkg_load(const char *filename, unsigned short full, pmpkg_t **pkg);
int alpm_pkg_free(pmpkg_t *pkg);
int alpm_pkg_checkmd5sum(pmpkg_t *pkg);
char *alpm_fetch_pkgurl(const char *url);
int alpm_pkg_vercmp(const char *ver1, const char *ver2);
int alpm_pkg_vercmp(const char *a, const char *b);
alpm_list_t *alpm_pkg_compute_requiredby(pmpkg_t *pkg);
const char *alpm_pkg_get_filename(pmpkg_t *pkg);
@@ -205,8 +205,8 @@ time_t alpm_pkg_get_installdate(pmpkg_t *pkg);
const char *alpm_pkg_get_packager(pmpkg_t *pkg);
const char *alpm_pkg_get_md5sum(pmpkg_t *pkg);
const char *alpm_pkg_get_arch(pmpkg_t *pkg);
unsigned long alpm_pkg_get_size(pmpkg_t *pkg);
unsigned long alpm_pkg_get_isize(pmpkg_t *pkg);
off_t alpm_pkg_get_size(pmpkg_t *pkg);
off_t alpm_pkg_get_isize(pmpkg_t *pkg);
pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg);
alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg);
@@ -224,39 +224,35 @@ size_t alpm_pkg_changelog_read(void *ptr, size_t size,
/*int alpm_pkg_changelog_feof(const pmpkg_t *pkg, void *fp);*/
int alpm_pkg_changelog_close(const pmpkg_t *pkg, void *fp);
unsigned short alpm_pkg_has_scriptlet(pmpkg_t *pkg);
unsigned short alpm_pkg_has_force(pmpkg_t *pkg);
unsigned long alpm_pkg_download_size(pmpkg_t *newpkg, pmdb_t *db_local);
off_t alpm_pkg_download_size(pmpkg_t *newpkg);
/*
* Deltas
*/
const char *alpm_delta_get_from(pmdelta_t *delta);
const char *alpm_delta_get_from_md5sum(pmdelta_t *delta);
const char *alpm_delta_get_to(pmdelta_t *delta);
unsigned long alpm_delta_get_size(pmdelta_t *delta);
const char *alpm_delta_get_to_md5sum(pmdelta_t *delta);
const char *alpm_delta_get_filename(pmdelta_t *delta);
const char *alpm_delta_get_md5sum(pmdelta_t *delta);
off_t alpm_delta_get_size(pmdelta_t *delta);
/*
* Groups
*/
const char *alpm_grp_get_name(const pmgrp_t *grp);
const alpm_list_t *alpm_grp_get_pkgs(const pmgrp_t *grp);
alpm_list_t *alpm_grp_get_pkgs(const pmgrp_t *grp);
/*
* Sync
*/
/* Types */
typedef enum _pmsynctype_t {
PM_SYNC_TYPE_REPLACE = 1,
PM_SYNC_TYPE_UPGRADE,
PM_SYNC_TYPE_DEPEND
} pmsynctype_t;
pmsynctype_t alpm_sync_get_type(const pmsyncpkg_t *sync);
pmpkg_t *alpm_sync_get_pkg(const pmsyncpkg_t *sync);
void *alpm_sync_get_data(const pmsyncpkg_t *sync);
alpm_list_t *alpm_sync_get_removes(const pmsyncpkg_t *sync);
pmpkg_t *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync);
int alpm_sync_sysupgrade(pmdb_t *db_local,
alpm_list_t *dbs_sync, alpm_list_t **syncpkgs);
@@ -266,10 +262,9 @@ int alpm_sync_sysupgrade(pmdb_t *db_local,
/* Types */
typedef enum _pmtranstype_t {
PM_TRANS_TYPE_ADD = 1,
PM_TRANS_TYPE_UPGRADE = 1,
PM_TRANS_TYPE_REMOVE,
PM_TRANS_TYPE_REMOVEUPGRADE,
PM_TRANS_TYPE_UPGRADE,
PM_TRANS_TYPE_SYNC
} pmtranstype_t;
@@ -282,45 +277,103 @@ typedef enum _pmtransflag_t {
PM_TRANS_FLAG_CASCADE = 0x10,
PM_TRANS_FLAG_RECURSE = 0x20,
PM_TRANS_FLAG_DBONLY = 0x40,
PM_TRANS_FLAG_DEPENDSONLY = 0x80,
/* 0x80 flag can go here */
PM_TRANS_FLAG_ALLDEPS = 0x100,
PM_TRANS_FLAG_DOWNLOADONLY = 0x200,
PM_TRANS_FLAG_NOSCRIPTLET = 0x400,
PM_TRANS_FLAG_NOCONFLICTS = 0x800,
PM_TRANS_FLAG_PRINTURIS = 0x1000,
PM_TRANS_FLAG_NEEDED = 0x2000
PM_TRANS_FLAG_NEEDED = 0x2000,
PM_TRANS_FLAG_ALLEXPLICIT = 0x4000,
PM_TRANS_FLAG_UNNEEDED = 0x8000,
PM_TRANS_FLAG_RECURSEALL = 0x10000
} pmtransflag_t;
/* Transaction Events */
/**
* @addtogroup alpm_trans
* @{
*/
/**
* @brief Transaction events.
* NULL parameters are passed to in all events unless specified otherwise.
*/
typedef enum _pmtransevt_t {
/** Dependencies will be computed for a package. */
PM_TRANS_EVT_CHECKDEPS_START = 1,
/** Dependencies were computed for a package. */
PM_TRANS_EVT_CHECKDEPS_DONE,
/** File conflicts will be computed for a package. */
PM_TRANS_EVT_FILECONFLICTS_START,
/** File conflicts were computed for a package. */
PM_TRANS_EVT_FILECONFLICTS_DONE,
/** Dependencies will be resolved for target package. */
PM_TRANS_EVT_RESOLVEDEPS_START,
/** Dependencies were resolved for target package. */
PM_TRANS_EVT_RESOLVEDEPS_DONE,
/** Inter-conflicts will be checked for target package. */
PM_TRANS_EVT_INTERCONFLICTS_START,
/** Inter-conflicts were checked for target package. */
PM_TRANS_EVT_INTERCONFLICTS_DONE,
/** Package will be installed.
* A pointer to the target package is passed to the callback.
*/
PM_TRANS_EVT_ADD_START,
/** Package was installed.
* A pointer to the new package is passed to the callback.
*/
PM_TRANS_EVT_ADD_DONE,
/** Package will be removed.
* A pointer to the target package is passed to the callback.
*/
PM_TRANS_EVT_REMOVE_START,
/** Package was removed.
* A pointer to the removed package is passed to the callback.
*/
PM_TRANS_EVT_REMOVE_DONE,
/** Package will be upgraded.
* A pointer to the upgraded package is passed to the callback.
*/
PM_TRANS_EVT_UPGRADE_START,
/** Package was upgraded.
* A pointer to the new package, and a pointer to the old package is passed
* to the callback, respectively.
*/
PM_TRANS_EVT_UPGRADE_DONE,
PM_TRANS_EVT_EXTRACT_DONE,
/** Target package's integrity will be checked. */
PM_TRANS_EVT_INTEGRITY_START,
/** Target package's integrity was checked. */
PM_TRANS_EVT_INTEGRITY_DONE,
/** Target deltas's integrity will be checked. */
PM_TRANS_EVT_DELTA_INTEGRITY_START,
/** Target delta's integrity was checked. */
PM_TRANS_EVT_DELTA_INTEGRITY_DONE,
/** Deltas will be applied to packages. */
PM_TRANS_EVT_DELTA_PATCHES_START,
/** Deltas were applied to packages. */
PM_TRANS_EVT_DELTA_PATCHES_DONE,
/** Delta patch will be applied to target package.
* The filename of the package and the filename of the patch is passed to the
* callback.
*/
PM_TRANS_EVT_DELTA_PATCH_START,
/** Delta patch was applied to target package. */
PM_TRANS_EVT_DELTA_PATCH_DONE,
/** Delta patch failed to apply to target package. */
PM_TRANS_EVT_DELTA_PATCH_FAILED,
/** Scriptlet has printed information.
* A line of text is passed to the callback.
*/
PM_TRANS_EVT_SCRIPTLET_INFO,
/** Print URI.
* The database's URI and the package's filename are passed to the callback.
*/
PM_TRANS_EVT_PRINTURI,
/** Files will be downloaded from a repository.
* The repository's tree name is passed to the callback.
*/
PM_TRANS_EVT_RETRIEVE_START,
} pmtransevt_t;
/*@}*/
/* Transaction Conversations (ie, questions) */
typedef enum _pmtransconv_t {
@@ -353,7 +406,6 @@ typedef void (*alpm_trans_cb_progress)(pmtransprog_t, const char *, int, int, in
pmtranstype_t alpm_trans_get_type();
unsigned int alpm_trans_get_flags();
alpm_list_t * alpm_trans_get_targets();
alpm_list_t * alpm_trans_get_pkgs();
int alpm_trans_init(pmtranstype_t type, pmtransflag_t flags,
alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv,
@@ -378,13 +430,16 @@ typedef enum _pmdepmod_t {
PM_DEP_MOD_LT
} pmdepmod_t;
pmdepend_t *alpm_splitdep(const char *depstring);
int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
alpm_list_t *alpm_checkdeps(pmdb_t *db, int reversedeps,
alpm_list_t *remove, alpm_list_t *upgrade);
alpm_list_t *alpm_deptest(pmdb_t *db, alpm_list_t *targets);
const char *alpm_miss_get_target(const pmdepmissing_t *miss);
pmdepend_t *alpm_miss_get_dep(pmdepmissing_t *miss);
const char *alpm_miss_get_causingpkg(const pmdepmissing_t *miss);
alpm_list_t *alpm_checkdbconflicts(pmdb_t *db_local);
const char *alpm_conflict_get_package1(pmconflict_t *conflict);
const char *alpm_conflict_get_package2(pmconflict_t *conflict);
@@ -439,12 +494,6 @@ enum _pmerrno_t {
PM_ERR_DB_REMOVE,
/* Servers */
PM_ERR_SERVER_BAD_URL,
/* Configuration */
PM_ERR_OPT_LOGFILE,
PM_ERR_OPT_DBPATH,
PM_ERR_OPT_LOCALDB,
PM_ERR_OPT_SYNCDB,
PM_ERR_OPT_USESYSLOG,
/* Transactions */
PM_ERR_TRANS_NOT_NULL,
PM_ERR_TRANS_NULL,
@@ -460,14 +509,12 @@ enum _pmerrno_t {
PM_ERR_PKG_INVALID,
PM_ERR_PKG_OPEN,
PM_ERR_PKG_LOAD,
PM_ERR_PKG_INSTALLED,
PM_ERR_PKG_CANT_FRESH,
PM_ERR_PKG_CANT_REMOVE,
PM_ERR_PKG_INVALID_NAME,
PM_ERR_PKG_CORRUPTED,
PM_ERR_PKG_REPO_NOT_FOUND,
/* Deltas */
PM_ERR_DLT_CORRUPTED,
PM_ERR_DLT_INVALID,
PM_ERR_DLT_PATCHFAILED,
/* Groups */
PM_ERR_GRP_NOT_FOUND,
@@ -478,14 +525,14 @@ enum _pmerrno_t {
/* Misc */
PM_ERR_USER_ABORT,
PM_ERR_INTERNAL_ERROR,
PM_ERR_LIBARCHIVE_ERROR,
PM_ERR_DB_SYNC,
PM_ERR_RETRIEVE,
PM_ERR_PKG_HOLD,
PM_ERR_INVALID_REGEX,
/* Downloading */
PM_ERR_CONNECT_FAILED,
PM_ERR_FORK_FAILED
/* External library errors */
PM_ERR_LIBARCHIVE,
PM_ERR_LIBDOWNLOAD,
PM_ERR_EXTERNAL_DOWNLOAD
};
extern enum _pmerrno_t pm_errno;

View File

@@ -1,7 +1,7 @@
/*
* alpm_list.c
*
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,15 +17,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
/* libalpm */
#include "alpm_list.h"
#include "util.h"
/* check exported library symbols with: nm -C -D <lib> */
#define SYMEXPORT __attribute__((visibility("default")))
#define SYMHIDDEN __attribute__((visibility("internal")))
/**
* @addtogroup alpm_list List Functions
@@ -39,25 +40,6 @@
/* Allocation */
/**
* @brief Allocate a new alpm_list_t.
*
* @return a new alpm_list_t item, or NULL on failure
*/
alpm_list_t SYMEXPORT *alpm_list_new()
{
alpm_list_t *list = NULL;
list = malloc(sizeof(alpm_list_t));
if(list) {
list->data = NULL;
list->prev = list; /* maintain a back reference to the tail pointer */
list->next = NULL;
}
return(list);
}
/**
* @brief Free a list, but not the contained data.
*
@@ -107,30 +89,26 @@ alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
{
alpm_list_t *ptr, *lp;
ptr = list;
ptr = calloc(1, sizeof(alpm_list_t));
if(ptr == NULL) {
ptr = alpm_list_new();
if(ptr == NULL) {
return(NULL);
}
return(list);
}
lp = alpm_list_last(ptr);
if(lp == ptr && lp->data == NULL) {
/* nada */
} else {
lp->next = alpm_list_new();
if(lp->next == NULL) {
return(NULL);
}
lp->next->prev = lp;
lp = lp->next;
list->prev = lp;
ptr->data = data;
ptr->next = NULL;
/* Special case: the input list is empty */
if(list == NULL) {
ptr->prev = ptr;
return(ptr);
}
lp->data = data;
lp = alpm_list_last(list);
lp->next = ptr;
ptr->prev = lp;
list->prev = ptr;
return(ptr);
return(list);
}
/**
@@ -144,12 +122,15 @@ alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
*/
alpm_list_t SYMEXPORT *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn)
{
if(!fn) {
return alpm_list_add(list, data);
if(!fn || !list) {
return(alpm_list_add(list, data));
} else {
alpm_list_t *add = NULL, *prev = NULL, *next = list;
add = alpm_list_new();
add = calloc(1, sizeof(alpm_list_t));
if(add == NULL) {
return(list);
}
add->data = data;
/* Find insertion point. */
@@ -159,26 +140,25 @@ alpm_list_t SYMEXPORT *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_
next = next->next;
}
/* Insert node before insertion point. */
add->prev = prev;
add->next = next;
if(next != NULL) {
next->prev = add; /* Not at end. */
}
if(prev != NULL) {
prev->next = add; /* In middle. */
} else {
list = add; /* At beginning, or new list */
}
if(next == NULL) {
/* At end, adjust tail pointer on head node */
/* Insert the add node to the list */
if(prev == NULL) { /* special case: we insert add as the first element */
add->prev = list->prev; /* list != NULL */
add->next = list;
list->prev = add;
return(add);
} else if(next == NULL) { /* another special case: add last element */
add->prev = prev;
add->next = NULL;
prev->next = add;
list->prev = add;
return(list);
} else {
add->prev = prev;
add->next = next;
next->prev = add;
prev->next = add;
return(list);
}
return(list);
}
}
@@ -198,10 +178,10 @@ alpm_list_t SYMEXPORT *alpm_list_join(alpm_list_t *first, alpm_list_t *second)
alpm_list_t *tmp;
if (first == NULL) {
return second;
return(second);
}
if (second == NULL) {
return first;
return(first);
}
/* tmp is the last element of the first list */
tmp = first->prev;
@@ -322,12 +302,16 @@ alpm_list_t SYMEXPORT *alpm_list_remove(alpm_list_t *haystack, const void *needl
*data = NULL;
}
if(needle == NULL) {
return(haystack);
}
while(i) {
if(i->data == NULL) {
continue;
}
tmp = i->next;
if(fn(needle, i->data) == 0) {
if(fn(i->data, needle) == 0) {
/* we found a matching item */
if(i == haystack) {
/* Special case: removing the head node which has a back reference to
@@ -370,6 +354,22 @@ alpm_list_t SYMEXPORT *alpm_list_remove(alpm_list_t *haystack, const void *needl
return(haystack);
}
/**
* @brief Remove a string from a list.
*
* @param haystack the list to remove the item from
* @param needle the data member of the item we're removing
* @param data output parameter containing data of the removed item
*
* @return the resultant list
*/
alpm_list_t SYMEXPORT *alpm_list_remove_str(alpm_list_t *haystack,
const char *needle, char **data)
{
return(alpm_list_remove(haystack, (const void *)needle,
(alpm_list_fn_cmp)strcmp, (void **)data));
}
/**
* @brief Create a new list without any duplicates.
*
@@ -464,18 +464,22 @@ alpm_list_t SYMEXPORT *alpm_list_copy_data(const alpm_list_t *list,
alpm_list_t SYMEXPORT *alpm_list_reverse(alpm_list_t *list)
{
const alpm_list_t *lp;
alpm_list_t *newlist = NULL;
alpm_list_t *newlist = NULL, *backup;
if(list == NULL) {
return(NULL);
}
lp = alpm_list_last(list);
if(list) {
/* break our reverse circular list */
list->prev = NULL;
}
/* break our reverse circular list */
backup = list->prev;
list->prev = NULL;
while(lp) {
newlist = alpm_list_add(newlist, lp->data);
lp = lp->prev;
}
list->prev = backup; /* restore tail pointer */
return(newlist);
}
@@ -490,14 +494,18 @@ alpm_list_t SYMEXPORT *alpm_list_reverse(alpm_list_t *list)
*/
inline alpm_list_t SYMEXPORT *alpm_list_first(const alpm_list_t *list)
{
return((alpm_list_t*)list);
if(list) {
return((alpm_list_t*)list);
} else {
return(NULL);
}
}
/**
* @brief Return nth element from list (starting from 0).
*
* @param list the list
* @param n the index of the item to find
* @param n the index of the item to find (n < alpm_list_count(list) IS needed)
*
* @return an alpm_list_t node for index `n`
*/
@@ -519,7 +527,11 @@ alpm_list_t SYMEXPORT *alpm_list_nth(const alpm_list_t *list, int n)
*/
inline alpm_list_t SYMEXPORT *alpm_list_next(const alpm_list_t *node)
{
return(node->next);
if(node) {
return(node->next);
} else {
return(NULL);
}
}
/**
@@ -594,7 +606,7 @@ void SYMEXPORT *alpm_list_find(const alpm_list_t *haystack, const void *needle,
}
/* trivial helper function for alpm_list_find_ptr */
static int ptrcmp(const void *p, const void *q)
static int ptr_cmp(const void *p, const void *q)
{
return(p != q);
}
@@ -611,7 +623,7 @@ static int ptrcmp(const void *p, const void *q)
*/
void SYMEXPORT *alpm_list_find_ptr(const alpm_list_t *haystack, const void *needle)
{
return(alpm_list_find(haystack, needle, ptrcmp));
return(alpm_list_find(haystack, needle, ptr_cmp));
}
/**
@@ -622,9 +634,11 @@ void SYMEXPORT *alpm_list_find_ptr(const alpm_list_t *haystack, const void *need
*
* @return `needle` if found, NULL otherwise
*/
char SYMEXPORT *alpm_list_find_str(const alpm_list_t *haystack, const char *needle)
char SYMEXPORT *alpm_list_find_str(const alpm_list_t *haystack,
const char *needle)
{
return((char *)alpm_list_find(haystack, (const void*)needle, (alpm_list_fn_cmp)strcmp));
return((char *)alpm_list_find(haystack, (const void*)needle,
(alpm_list_fn_cmp)strcmp));
}
/**

View File

@@ -19,6 +19,8 @@
#ifndef _ALPM_LIST_H
#define _ALPM_LIST_H
#include <stdlib.h> /* size_t */
#ifdef __cplusplus
extern "C" {
#endif
@@ -45,7 +47,6 @@ typedef void (*alpm_list_fn_free)(void *); /* item deallocation callback */
typedef int (*alpm_list_fn_cmp)(const void *, const void *); /* item comparison callback */
/* allocation */
alpm_list_t *alpm_list_new(void);
void alpm_list_free(alpm_list_t *list);
void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn);
@@ -56,6 +57,7 @@ alpm_list_t *alpm_list_join(alpm_list_t *first, alpm_list_t *second);
alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn);
alpm_list_t *alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn);
alpm_list_t *alpm_list_remove(alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn, void **data);
alpm_list_t *alpm_list_remove_str(alpm_list_t *haystack, const char *needle, char **data);
alpm_list_t *alpm_list_remove_dupes(const alpm_list_t *list);
alpm_list_t *alpm_list_strdup(const alpm_list_t *list);
alpm_list_t *alpm_list_copy(const alpm_list_t *list);

View File

@@ -42,6 +42,9 @@ int _alpm_backup_split(const char *string, char **file, char **hash)
if(ptr == NULL) {
if(file) {
*file = str;
} else {
/* don't need our dup as the fname wasn't requested, so free it */
FREE(str);
}
return(0);
}

View File

@@ -25,7 +25,7 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdint.h> /* uintmax_t */
#include <stdint.h> /* uintmax_t, intmax_t */
#include <sys/stat.h>
#include <dirent.h>
#include <ctype.h>
@@ -36,32 +36,182 @@
/* libalpm */
#include "db.h"
#include "alpm_list.h"
#include "cache.h"
#include "log.h"
#include "util.h"
#include "alpm.h"
#include "error.h"
#include "handle.h"
#include "package.h"
#include "delta.h"
#include "deps.h"
#include "dload.h"
/* This function is used to convert the downloaded db file to the proper backend
* format
/*
* Return the last update time as number of seconds from the epoch.
* Returns 0 if the value is unknown or can't be read.
*/
int _alpm_db_install(pmdb_t *db, const char *dbfile)
time_t getlastupdate(const pmdb_t *db)
{
FILE *fp;
char *file;
time_t ret = 0;
ALPM_LOG_FUNC;
/* TODO we should not simply unpack the archive, but better parse it and
* db_write each entry (see sync_load_dbarchive to get archive content) */
_alpm_log(PM_LOG_DEBUG, "unpacking database '%s'\n", dbfile);
if(_alpm_unpack(dbfile, db->path, NULL)) {
RET_ERR(PM_ERR_SYSTEM, -1);
if(db == NULL) {
return(ret);
}
return unlink(dbfile);
/* db->path + '.lastupdate' + NULL */
MALLOC(file, strlen(db->path) + 12, RET_ERR(PM_ERR_MEMORY, ret));
sprintf(file, "%s.lastupdate", db->path);
/* get the last update time, if it's there */
if((fp = fopen(file, "r")) == NULL) {
free(file);
return(ret);
} else {
char line[64];
if(fgets(line, sizeof(line), fp)) {
ret = atol(line);
}
}
fclose(fp);
free(file);
return(ret);
}
/*
* writes the dbpath/.lastupdate file with the value in time
*/
int setlastupdate(const pmdb_t *db, time_t time)
{
FILE *fp;
char *file;
int ret = 0;
ALPM_LOG_FUNC;
if(db == NULL || time == 0) {
return(-1);
}
/* db->path + '.lastupdate' + NULL */
MALLOC(file, strlen(db->path) + 12, RET_ERR(PM_ERR_MEMORY, ret));
sprintf(file, "%s.lastupdate", db->path);
if((fp = fopen(file, "w")) == NULL) {
free(file);
return(-1);
}
if(fprintf(fp, "%ju", (uintmax_t)time) <= 0) {
ret = -1;
}
fclose(fp);
free(file);
return(ret);
}
/** Update a package database
* @param force if true, then forces the update, otherwise update only in case
* the database isn't up to date
* @param db pointer to the package database to update
* @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up
* to date
*/
int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
{
alpm_list_t *lp;
char *dbfile, *dbfilepath;
time_t newmtime = 0, lastupdate = 0;
const char *dbpath;
size_t len;
int ret;
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
ASSERT(db != NULL && db != handle->db_local, RET_ERR(PM_ERR_WRONG_ARGS, -1));
/* Verify we are in a transaction. This is done _mainly_ because we need a DB
* lock - if we update without a db lock, we may kludge some other pacman
* process that _has_ a lock.
*/
ASSERT(handle->trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(handle->trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1));
ASSERT(handle->trans->type == PM_TRANS_TYPE_SYNC, RET_ERR(PM_ERR_TRANS_TYPE, -1));
if(!alpm_list_find_ptr(handle->dbs_sync, db)) {
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
}
if(!force) {
/* get the lastupdate time */
lastupdate = getlastupdate(db);
if(lastupdate == 0) {
_alpm_log(PM_LOG_DEBUG, "failed to get lastupdate time for %s\n",
db->treename);
}
}
len = strlen(db->treename) + strlen(DBEXT) + 1;
MALLOC(dbfile, len, RET_ERR(PM_ERR_MEMORY, -1));
sprintf(dbfile, "%s" DBEXT, db->treename);
dbpath = alpm_option_get_dbpath();
ret = _alpm_download_single_file(dbfile, db->servers, dbpath,
lastupdate, &newmtime);
free(dbfile);
if(ret == 1) {
/* mtimes match, do nothing */
pm_errno = 0;
return(1);
} else if(ret == -1) {
/* pm_errno was set by the download code */
_alpm_log(PM_LOG_DEBUG, "failed to sync db: %s\n", alpm_strerrorlast());
return(-1);
} else {
/* remove the old dir */
_alpm_log(PM_LOG_DEBUG, "flushing database %s\n", db->path);
for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) {
pmpkg_t *pkg = lp->data;
if(pkg && _alpm_db_remove(db, pkg) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not remove database entry %s%s\n"),
db->treename, pkg->name);
RET_ERR(PM_ERR_DB_REMOVE, -1);
}
}
/* Cache needs to be rebuilt */
_alpm_db_free_pkgcache(db);
/* form the path to the db location */
len = strlen(dbpath) + strlen(db->treename) + strlen(DBEXT) + 1;
MALLOC(dbfilepath, len, RET_ERR(PM_ERR_MEMORY, -1));
sprintf(dbfilepath, "%s%s" DBEXT, dbpath, db->treename);
/* uncompress the sync database */
ret = _alpm_unpack(dbfilepath, db->path, NULL);
if(ret) {
free(dbfilepath);
RET_ERR(PM_ERR_SYSTEM, -1);
}
unlink(dbfilepath);
free(dbfilepath);
/* if we have a new mtime, set the DB last update value */
if(newmtime) {
_alpm_log(PM_LOG_DEBUG, "sync: new mtime for %s: %ju\n",
db->treename, (uintmax_t)newmtime);
setlastupdate(db, newmtime);
}
}
return(0);
}
int _alpm_db_open(pmdb_t *db)
@@ -95,18 +245,7 @@ void _alpm_db_close(pmdb_t *db)
}
}
void _alpm_db_rewind(pmdb_t *db)
{
ALPM_LOG_FUNC;
if(db == NULL || db->handle == NULL) {
return;
}
rewinddir(db->handle);
}
static int _alpm_db_splitname(const char *target, char *name, char *version)
static int splitname(const char *target, pmpkg_t *pkg)
{
/* the format of a db entry is as follows:
* package-version-rel/
@@ -115,10 +254,10 @@ static int _alpm_db_splitname(const char *target, char *name, char *version)
*/
char *tmp, *p, *q;
if(target == NULL) {
if(target == NULL || pkg == NULL) {
return(-1);
}
tmp = strdup(target);
STRDUP(tmp, target, RET_ERR(PM_ERR_MEMORY, -1));
p = tmp + strlen(tmp);
/* do the magic parsing- find the beginning of the version string
@@ -130,120 +269,95 @@ static int _alpm_db_splitname(const char *target, char *name, char *version)
}
/* copy into fields and return */
if(version) {
strncpy(version, p+1, PKG_VERSION_LEN);
if(pkg->version) {
FREE(pkg->version);
}
STRDUP(pkg->version, p+1, RET_ERR(PM_ERR_MEMORY, -1));
/* insert a terminator at the end of the name (on hyphen)- then copy it */
*p = '\0';
if(name) {
strncpy(name, tmp, PKG_NAME_LEN);
if(pkg->name) {
FREE(pkg->name);
}
STRDUP(pkg->name, tmp, RET_ERR(PM_ERR_MEMORY, -1));
free(tmp);
return(0);
}
pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target)
int _alpm_db_populate(pmdb_t *db)
{
int count = 0;
struct dirent *ent = NULL;
struct stat sbuf;
char path[PATH_MAX];
char name[PKG_FULLNAME_LEN];
char *ptr = NULL;
int found = 0;
pmpkg_t *pkg = NULL;
ALPM_LOG_FUNC;
if(db == NULL) {
RET_ERR(PM_ERR_DB_NULL, NULL);
}
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
/* We loop here until we read a valid package. When an iteration of this loop
* fails, it means alpm_db_read failed to read a valid package, so we'll read
* the next so as not to abort whole-db operations early
*/
while(!pkg) {
if(target != NULL) {
/* search for a specific package (by name only) */
rewinddir(db->handle);
while(!found && (ent = readdir(db->handle)) != NULL) {
if(!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) {
continue;
}
/* stat the entry, make sure it's a directory */
snprintf(path, PATH_MAX, "%s/%s", db->path, ent->d_name);
if(stat(path, &sbuf) || !S_ISDIR(sbuf.st_mode)) {
continue;
}
strncpy(name, ent->d_name, PKG_FULLNAME_LEN);
/* truncate the string at the second-to-last hyphen, */
/* which will give us the package name */
if((ptr = rindex(name, '-'))) {
*ptr = '\0';
}
if((ptr = rindex(name, '-'))) {
*ptr = '\0';
}
if(!strcmp(name, target)) {
found = 1;
}
}
if(!found) {
return(NULL);
}
} else { /* target == NULL, full scan */
int isdir = 0;
while(!isdir) {
ent = readdir(db->handle);
if(ent == NULL) {
return(NULL);
}
if(!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) {
isdir = 0;
continue;
}
/* stat the entry, make sure it's a directory */
snprintf(path, PATH_MAX, "%s/%s", db->path, ent->d_name);
if(!stat(path, &sbuf) && S_ISDIR(sbuf.st_mode)) {
isdir = 1;
}
}
rewinddir(db->handle);
while((ent = readdir(db->handle)) != NULL) {
const char *name = ent->d_name;
pmpkg_t *pkg;
if(strcmp(name, ".") == 0 || strcmp(name, "..") == 0) {
continue;
}
/* stat the entry, make sure it's a directory */
snprintf(path, PATH_MAX, "%s%s", db->path, name);
if(stat(path, &sbuf) != 0 || !S_ISDIR(sbuf.st_mode)) {
continue;
}
pkg = _alpm_pkg_new(NULL, NULL);
pkg = _alpm_pkg_new();
if(pkg == NULL) {
_alpm_log(PM_LOG_DEBUG, "db scan could not find package: %s\n", target);
return(NULL);
return(-1);
}
/* split the db entry name */
if(_alpm_db_splitname(ent->d_name, pkg->name, pkg->version) != 0) {
if(splitname(name, pkg) != 0) {
_alpm_log(PM_LOG_ERROR, _("invalid name for database entry '%s'\n"),
ent->d_name);
alpm_pkg_free(pkg);
pkg = NULL;
name);
_alpm_pkg_free(pkg);
continue;
}
/* explicitly read with only 'BASE' data, accessors will handle the rest */
if(_alpm_db_read(db, pkg, INFRQ_BASE) == -1) {
/* TODO removed corrupt entry from the FS here */
_alpm_log(PM_LOG_ERROR, _("corrupted database entry '%s'\n"), name);
_alpm_pkg_free(pkg);
} else {
pkg->origin = PKG_FROM_CACHE;
pkg->origin_data.db = db;
continue;
}
pkg->origin = PKG_FROM_CACHE;
pkg->origin_data.db = db;
/* add to the collection */
_alpm_log(PM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
pkg->name, db->treename);
db->pkgcache = alpm_list_add(db->pkgcache, pkg);
count++;
}
return(pkg);
db->pkgcache = alpm_list_msort(db->pkgcache, count, _alpm_pkg_cmp);
return(count);
}
/* Note: the return value must be freed by the caller */
static char *get_pkgpath(pmdb_t *db, pmpkg_t *info)
{
size_t len;
char *pkgpath;
len = strlen(db->path) + strlen(info->name) + strlen(info->version) + 3;
MALLOC(pkgpath, len, RET_ERR(PM_ERR_MEMORY, NULL));
sprintf(pkgpath, "%s%s-%s/", db->path, info->name, info->version);
return(pkgpath);
}
int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
{
FILE *fp = NULL;
struct stat buf;
char path[PATH_MAX+1];
char path[PATH_MAX];
char line[513];
char *pkgpath = NULL;
ALPM_LOG_FUNC;
@@ -251,7 +365,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
RET_ERR(PM_ERR_DB_NULL, -1);
}
if(info == NULL || info->name[0] == 0 || info->version[0] == 0) {
if(info == NULL || info->name == NULL || info->version == NULL) {
_alpm_log(PM_LOG_DEBUG, "invalid package entry provided to _alpm_db_read, skipping\n");
return(-1);
}
@@ -276,17 +390,18 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
/* clear out 'line', to be certain - and to make valgrind happy */
memset(line, 0, 513);
snprintf(path, PATH_MAX, "%s/%s-%s", db->path, info->name, info->version);
if(stat(path, &buf)) {
pkgpath = get_pkgpath(db, info);
if(access(pkgpath, F_OK)) {
/* directory doesn't exist or can't be opened */
_alpm_log(PM_LOG_DEBUG, "cannot find '%s-%s' in db '%s'\n",
info->name, info->version, db->treename);
return(-1);
goto error;
}
/* DESC */
if(inforeq & INFRQ_DESC) {
snprintf(path, PATH_MAX, "%s/%s-%s/desc", db->path, info->name, info->version);
snprintf(path, PATH_MAX, "%sdesc", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
goto error;
@@ -296,120 +411,131 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
break;
}
_alpm_strtrim(line);
if(!strcmp(line, "%FILENAME%")) {
if(fgets(info->filename, sizeof(info->filename), fp) == NULL) {
if(strcmp(line, "%NAME%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(info->filename);
} else if(!strcmp(line, "%DESC%")) {
if(fgets(info->desc, sizeof(info->desc), fp) == NULL) {
if(strcmp(_alpm_strtrim(line), info->name) != 0) {
_alpm_log(PM_LOG_ERROR, _("%s database is inconsistent: name "
"mismatch on package %s\n"), db->treename, info->name);
}
} else if(strcmp(line, "%VERSION%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(info->desc);
} else if(!strcmp(line, "%GROUPS%")) {
if(strcmp(_alpm_strtrim(line), info->version) != 0) {
_alpm_log(PM_LOG_ERROR, _("%s database is inconsistent: version "
"mismatch on package %s\n"), db->treename, info->name);
}
} else if(strcmp(line, "%FILENAME%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
STRDUP(info->filename, _alpm_strtrim(line), goto error);
} else if(strcmp(line, "%DESC%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
STRDUP(info->desc, _alpm_strtrim(line), goto error);
} else if(strcmp(line, "%GROUPS%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->groups = alpm_list_add(info->groups, strdup(line));
char *linedup;
STRDUP(linedup, _alpm_strtrim(line), goto error);
info->groups = alpm_list_add(info->groups, linedup);
}
} else if(!strcmp(line, "%URL%")) {
if(fgets(info->url, sizeof(info->url), fp) == NULL) {
} else if(strcmp(line, "%URL%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(info->url);
} else if(!strcmp(line, "%LICENSE%")) {
STRDUP(info->url, _alpm_strtrim(line), goto error);
} else if(strcmp(line, "%LICENSE%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->licenses = alpm_list_add(info->licenses, strdup(line));
char *linedup;
STRDUP(linedup, _alpm_strtrim(line), goto error);
info->licenses = alpm_list_add(info->licenses, linedup);
}
} else if(!strcmp(line, "%ARCH%")) {
if(fgets(info->arch, sizeof(info->arch), fp) == NULL) {
} else if(strcmp(line, "%ARCH%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(info->arch);
} else if(!strcmp(line, "%BUILDDATE%")) {
char tmp[32];
if(fgets(tmp, sizeof(tmp), fp) == NULL) {
STRDUP(info->arch, _alpm_strtrim(line), goto error);
} else if(strcmp(line, "%BUILDDATE%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(tmp);
_alpm_strtrim(line);
char first = tolower(tmp[0]);
char first = tolower(line[0]);
if(first > 'a' && first < 'z') {
struct tm tmp_tm = {0}; //initialize to null incase of failure
setlocale(LC_TIME, "C");
strptime(tmp, "%a %b %e %H:%M:%S %Y", &tmp_tm);
strptime(line, "%a %b %e %H:%M:%S %Y", &tmp_tm);
info->builddate = mktime(&tmp_tm);
setlocale(LC_TIME, "");
} else {
info->builddate = atol(tmp);
info->builddate = atol(line);
}
} else if(!strcmp(line, "%INSTALLDATE%")) {
char tmp[32];
if(fgets(tmp, sizeof(tmp), fp) == NULL) {
} else if(strcmp(line, "%INSTALLDATE%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(tmp);
_alpm_strtrim(line);
char first = tolower(tmp[0]);
char first = tolower(line[0]);
if(first > 'a' && first < 'z') {
struct tm tmp_tm = {0}; //initialize to null incase of failure
setlocale(LC_TIME, "C");
strptime(tmp, "%a %b %e %H:%M:%S %Y", &tmp_tm);
strptime(line, "%a %b %e %H:%M:%S %Y", &tmp_tm);
info->installdate = mktime(&tmp_tm);
setlocale(LC_TIME, "");
} else {
info->installdate = atol(tmp);
info->installdate = atol(line);
}
} else if(!strcmp(line, "%PACKAGER%")) {
if(fgets(info->packager, sizeof(info->packager), fp) == NULL) {
} else if(strcmp(line, "%PACKAGER%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(info->packager);
} else if(!strcmp(line, "%REASON%")) {
char tmp[32];
if(fgets(tmp, sizeof(tmp), fp) == NULL) {
STRDUP(info->packager, _alpm_strtrim(line), goto error);
} else if(strcmp(line, "%REASON%") == 0) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(tmp);
info->reason = atol(tmp);
} else if(!strcmp(line, "%SIZE%") || !strcmp(line, "%CSIZE%")) {
info->reason = atol(_alpm_strtrim(line));
} else if(strcmp(line, "%SIZE%") == 0 || strcmp(line, "%CSIZE%") == 0) {
/* NOTE: the CSIZE and SIZE fields both share the "size" field
* in the pkginfo_t struct. This can be done b/c CSIZE
* is currently only used in sync databases, and SIZE is
* only used in local databases.
*/
char tmp[32];
if(fgets(tmp, sizeof(tmp), fp) == NULL) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(tmp);
info->size = atol(tmp);
info->size = atol(_alpm_strtrim(line));
/* also store this value to isize if isize is unset */
if(info->isize == 0) {
info->isize = atol(tmp);
info->isize = info->size;
}
} else if(!strcmp(line, "%ISIZE%")) {
} else if(strcmp(line, "%ISIZE%") == 0) {
/* ISIZE (installed size) tag only appears in sync repositories,
* not the local one. */
char tmp[32];
if(fgets(tmp, sizeof(tmp), fp) == NULL) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
_alpm_strtrim(tmp);
info->isize = atol(tmp);
} else if(!strcmp(line, "%MD5SUM%")) {
info->isize = atol(_alpm_strtrim(line));
} else if(strcmp(line, "%MD5SUM%") == 0) {
/* MD5SUM tag only appears in sync repositories,
* not the local one. */
if(fgets(info->md5sum, sizeof(info->md5sum), fp) == NULL) {
if(fgets(line, 512, fp) == NULL) {
goto error;
}
} else if(!strcmp(line, "%REPLACES%")) {
/* the REPLACES tag is special -- it only appears in sync repositories,
* not the local one. */
STRDUP(info->md5sum, _alpm_strtrim(line), goto error);
} else if(strcmp(line, "%REPLACES%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->replaces = alpm_list_add(info->replaces, strdup(line));
char *linedup;
STRDUP(linedup, _alpm_strtrim(line), goto error);
info->replaces = alpm_list_add(info->replaces, linedup);
}
} else if(!strcmp(line, "%FORCE%")) {
/* FORCE tag only appears in sync repositories,
* not the local one. */
} else if(strcmp(line, "%FORCE%") == 0) {
info->force = 1;
}
}
@@ -419,20 +545,24 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
/* FILES */
if(inforeq & INFRQ_FILES) {
snprintf(path, PATH_MAX, "%s/%s-%s/files", db->path, info->name, info->version);
snprintf(path, PATH_MAX, "%sfiles", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
goto error;
}
while(fgets(line, 256, fp)) {
_alpm_strtrim(line);
if(!strcmp(line, "%FILES%")) {
if(strcmp(line, "%FILES%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->files = alpm_list_add(info->files, strdup(line));
char *linedup;
STRDUP(linedup, _alpm_strtrim(line), goto error);
info->files = alpm_list_add(info->files, linedup);
}
} else if(!strcmp(line, "%BACKUP%")) {
} else if(strcmp(line, "%BACKUP%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->backup = alpm_list_add(info->backup, strdup(line));
char *linedup;
STRDUP(linedup, _alpm_strtrim(line), goto error);
info->backup = alpm_list_add(info->backup, linedup);
}
}
}
@@ -442,7 +572,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
/* DEPENDS */
if(inforeq & INFRQ_DEPENDS) {
snprintf(path, PATH_MAX, "%s/%s-%s/depends", db->path, info->name, info->version);
snprintf(path, PATH_MAX, "%sdepends", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
goto error;
@@ -450,37 +580,30 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
while(!feof(fp)) {
fgets(line, 255, fp);
_alpm_strtrim(line);
if(!strcmp(line, "%DEPENDS%")) {
if(strcmp(line, "%DEPENDS%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
pmdepend_t *dep = alpm_splitdep(line);
pmdepend_t *dep = _alpm_splitdep(_alpm_strtrim(line));
info->depends = alpm_list_add(info->depends, dep);
}
} else if(!strcmp(line, "%OPTDEPENDS%")) {
} else if(strcmp(line, "%OPTDEPENDS%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->optdepends = alpm_list_add(info->optdepends, strdup(line));
char *linedup;
STRDUP(linedup, _alpm_strtrim(line), goto error);
info->optdepends = alpm_list_add(info->optdepends, linedup);
}
} else if(!strcmp(line, "%CONFLICTS%")) {
} else if(strcmp(line, "%CONFLICTS%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->conflicts = alpm_list_add(info->conflicts, strdup(line));
char *linedup;
STRDUP(linedup, _alpm_strtrim(line), goto error);
info->conflicts = alpm_list_add(info->conflicts, linedup);
}
} else if(!strcmp(line, "%PROVIDES%")) {
} else if(strcmp(line, "%PROVIDES%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->provides = alpm_list_add(info->provides, strdup(line));
char *linedup;
STRDUP(linedup, _alpm_strtrim(line), goto error);
info->provides = alpm_list_add(info->provides, linedup);
}
}
/* TODO: we were going to move these things here, but it should wait.
* A better change would be to figure out how to restructure the DB. */
/* else if(!strcmp(line, "%REPLACES%")) {
* the REPLACES tag is special -- it only appears in sync repositories,
* not the local one. *
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->replaces = alpm_list_add(info->replaces, strdup(line));
}
} else if(!strcmp(line, "%FORCE%")) {
* FORCE tag only appears in sync repositories,
* not the local one. *
info->force = 1;
} */
}
fclose(fp);
fp = NULL;
@@ -488,12 +611,12 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
/* DELTAS */
if(inforeq & INFRQ_DELTAS) {
snprintf(path, PATH_MAX, "%s/%s-%s/deltas", db->path, info->name, info->version);
snprintf(path, PATH_MAX, "%sdeltas", pkgpath);
if((fp = fopen(path, "r"))) {
while(!feof(fp)) {
fgets(line, 255, fp);
_alpm_strtrim(line);
if(!strcmp(line, "%DELTAS%")) {
if(strcmp(line, "%DELTAS%") == 0) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->deltas = alpm_list_add(info->deltas, _alpm_delta_parse(line));
}
@@ -506,8 +629,8 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
/* INSTALL */
if(inforeq & INFRQ_SCRIPTLET) {
snprintf(path, PATH_MAX, "%s/%s-%s/install", db->path, info->name, info->version);
if(!stat(path, &buf)) {
snprintf(path, PATH_MAX, "%sinstall", pkgpath);
if(access(path, F_OK) == 0) {
info->scriptlet = 1;
}
}
@@ -515,9 +638,11 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
/* internal */
info->infolevel |= inforeq;
free(pkgpath);
return(0);
error:
free(pkgpath);
if(fp) {
fclose(fp);
}
@@ -532,6 +657,7 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
alpm_list_t *lp = NULL;
int retval = 0;
int local = 0;
char *pkgpath = NULL;
ALPM_LOG_FUNC;
@@ -539,9 +665,10 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
return(-1);
}
snprintf(path, PATH_MAX, "%s/%s-%s", db->path, info->name, info->version);
pkgpath = get_pkgpath(db, info);
oldmask = umask(0000);
mkdir(path, 0755);
mkdir(pkgpath, 0755);
/* make sure we have a sane umask */
umask(0022);
@@ -553,7 +680,7 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
if(inforeq & INFRQ_DESC) {
_alpm_log(PM_LOG_DEBUG, "writing %s-%s DESC information back to db\n",
info->name, info->version);
snprintf(path, PATH_MAX, "%s/%s-%s/desc", db->path, info->name, info->version);
snprintf(path, PATH_MAX, "%sdesc", pkgpath);
if((fp = fopen(path, "w")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
retval = -1;
@@ -561,7 +688,7 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
}
fprintf(fp, "%%NAME%%\n%s\n\n"
"%%VERSION%%\n%s\n\n", info->name, info->version);
if(info->desc[0]) {
if(info->desc) {
fprintf(fp, "%%DESC%%\n"
"%s\n\n", info->desc);
}
@@ -572,8 +699,18 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
}
fprintf(fp, "\n");
}
if(info->replaces) {
fputs("%REPLACES%\n", fp);
for(lp = info->replaces; lp; lp = lp->next) {
fprintf(fp, "%s\n", (char *)lp->data);
}
fprintf(fp, "\n");
}
if(info->force) {
fprintf(fp, "%%FORCE%%\n\n");
}
if(local) {
if(info->url[0]) {
if(info->url) {
fprintf(fp, "%%URL%%\n"
"%s\n\n", info->url);
}
@@ -584,7 +721,7 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
}
fprintf(fp, "\n");
}
if(info->arch[0]) {
if(info->arch) {
fprintf(fp, "%%ARCH%%\n"
"%s\n\n", info->arch);
}
@@ -596,14 +733,14 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
fprintf(fp, "%%INSTALLDATE%%\n"
"%ju\n\n", (uintmax_t)info->installdate);
}
if(info->packager[0]) {
if(info->packager) {
fprintf(fp, "%%PACKAGER%%\n"
"%s\n\n", info->packager);
}
if(info->size) {
if(info->isize) {
/* only write installed size, csize is irrelevant once installed */
fprintf(fp, "%%SIZE%%\n"
"%lu\n\n", info->isize);
"%ju\n\n", (intmax_t)info->isize);
}
if(info->reason) {
fprintf(fp, "%%REASON%%\n"
@@ -612,11 +749,11 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
} else {
if(info->size) {
fprintf(fp, "%%CSIZE%%\n"
"%lu\n\n", info->size);
"%ju\n\n", (intmax_t)info->size);
}
if(info->isize) {
fprintf(fp, "%%ISIZE%%\n"
"%lu\n\n", info->isize);
"%ju\n\n", (intmax_t)info->isize);
}
if(info->md5sum) {
fprintf(fp, "%%MD5SUM%%\n"
@@ -631,7 +768,7 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
if(local && (inforeq & INFRQ_FILES)) {
_alpm_log(PM_LOG_DEBUG, "writing %s-%s FILES information back to db\n",
info->name, info->version);
snprintf(path, PATH_MAX, "%s/%s-%s/files", db->path, info->name, info->version);
snprintf(path, PATH_MAX, "%sfiles", pkgpath);
if((fp = fopen(path, "w")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
retval = -1;
@@ -659,7 +796,7 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
if(inforeq & INFRQ_DEPENDS) {
_alpm_log(PM_LOG_DEBUG, "writing %s-%s DEPENDS information back to db\n",
info->name, info->version);
snprintf(path, PATH_MAX, "%s/%s-%s/depends", db->path, info->name, info->version);
snprintf(path, PATH_MAX, "%sdepends", pkgpath);
if((fp = fopen(path, "w")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
retval = -1;
@@ -695,19 +832,6 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
}
fprintf(fp, "\n");
}
if(!local) {
if(info->replaces) {
fputs("%REPLACES%\n", fp);
for(lp = info->replaces; lp; lp = lp->next) {
fprintf(fp, "%s\n", (char *)lp->data);
}
fprintf(fp, "\n");
}
if(info->force) {
fprintf(fp, "%%FORCE%%\n"
"\n");
}
}
fclose(fp);
fp = NULL;
}
@@ -717,6 +841,7 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
cleanup:
umask(oldmask);
free(pkgpath);
if(fp) {
fclose(fp);
@@ -727,7 +852,8 @@ cleanup:
int _alpm_db_remove(pmdb_t *db, pmpkg_t *info)
{
char path[PATH_MAX];
int ret = 0;
char *pkgpath = NULL;
ALPM_LOG_FUNC;
@@ -735,70 +861,13 @@ int _alpm_db_remove(pmdb_t *db, pmpkg_t *info)
RET_ERR(PM_ERR_DB_NULL, -1);
}
snprintf(path, PATH_MAX, "%s%s-%s", db->path, info->name, info->version);
if(_alpm_rmrf(path) == -1) {
return(-1);
}
pkgpath = get_pkgpath(db, info);
return(0);
}
/*
* Return the last update time as number of seconds from the epoch.
* Returns 0 if the value is unknown or can't be read.
*/
time_t _alpm_db_getlastupdate(const pmdb_t *db)
{
FILE *fp;
char file[PATH_MAX];
time_t ret = 0;
ALPM_LOG_FUNC;
if(db == NULL) {
return(ret);
}
snprintf(file, PATH_MAX, "%s.lastupdate", db->path);
/* get the last update time, if it's there */
if((fp = fopen(file, "r")) == NULL) {
return(ret);
} else {
char line[64];
if(fgets(line, sizeof(line), fp)) {
ret = atol(line);
}
}
fclose(fp);
return(ret);
}
/*
* writes the dbpath/.lastupdate file with the value in time
*/
int _alpm_db_setlastupdate(const pmdb_t *db, time_t time)
{
FILE *fp;
char file[PATH_MAX];
int ret = 0;
ALPM_LOG_FUNC;
if(db == NULL || time == 0) {
return(-1);
}
snprintf(file, PATH_MAX, "%s.lastupdate", db->path);
if((fp = fopen(file, "w")) == NULL) {
return(-1);
}
if(fprintf(fp, "%ju", (uintmax_t)time) <= 0) {
ret = _alpm_rmrf(pkgpath);
free(pkgpath);
if(ret != 0) {
ret = -1;
}
fclose(fp);
return(ret);
}

288
lib/libalpm/be_package.c Normal file
View File

@@ -0,0 +1,288 @@
/*
* be_package.c
*
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include <locale.h> /* setlocale */
/* libarchive */
#include <archive.h>
#include <archive_entry.h>
/* libalpm */
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "package.h"
#include "deps.h" /* _alpm_splitdep */
/**
* Parses the package description file for a package into a pmpkg_t struct.
* @param archive the archive to read from, pointed at the .PKGINFO entry
* @param newpkg an empty pmpkg_t struct to fill with package info
*
* @return 0 on success, 1 on error
*/
static int parse_descfile(struct archive *a, pmpkg_t *newpkg)
{
char line[PATH_MAX];
char *ptr = NULL;
char *key = NULL;
int linenum = 0;
ALPM_LOG_FUNC;
/* loop until we reach EOF (where archive_fgets will return NULL) */
while(_alpm_archive_fgets(line, PATH_MAX, a) != NULL) {
linenum++;
_alpm_strtrim(line);
if(strlen(line) == 0 || line[0] == '#') {
continue;
}
ptr = line;
key = strsep(&ptr, "=");
if(key == NULL || ptr == NULL) {
_alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d\n",
newpkg->name ? newpkg->name : "error", linenum);
} else {
key = _alpm_strtrim(key);
ptr = _alpm_strtrim(ptr);
if(!strcmp(key, "pkgname")) {
STRDUP(newpkg->name, ptr, RET_ERR(PM_ERR_MEMORY, -1));
} else if(!strcmp(key, "pkgver")) {
STRDUP(newpkg->version, ptr, RET_ERR(PM_ERR_MEMORY, -1));
} else if(!strcmp(key, "pkgdesc")) {
STRDUP(newpkg->desc, ptr, RET_ERR(PM_ERR_MEMORY, -1));
} else if(!strcmp(key, "group")) {
newpkg->groups = alpm_list_add(newpkg->groups, strdup(ptr));
} else if(!strcmp(key, "url")) {
STRDUP(newpkg->url, ptr, RET_ERR(PM_ERR_MEMORY, -1));
} else if(!strcmp(key, "license")) {
newpkg->licenses = alpm_list_add(newpkg->licenses, strdup(ptr));
} else if(!strcmp(key, "builddate")) {
char first = tolower(ptr[0]);
if(first > 'a' && first < 'z') {
struct tm tmp_tm = {0}; //initialize to null in case of failure
setlocale(LC_TIME, "C");
strptime(ptr, "%a %b %e %H:%M:%S %Y", &tmp_tm);
newpkg->builddate = mktime(&tmp_tm);
setlocale(LC_TIME, "");
} else {
newpkg->builddate = atol(ptr);
}
} else if(!strcmp(key, "packager")) {
STRDUP(newpkg->packager, ptr, RET_ERR(PM_ERR_MEMORY, -1));
} else if(!strcmp(key, "arch")) {
STRDUP(newpkg->arch, ptr, RET_ERR(PM_ERR_MEMORY, -1));
} else if(!strcmp(key, "size")) {
/* size in the raw package is uncompressed (installed) size */
newpkg->isize = atol(ptr);
} else if(!strcmp(key, "depend")) {
pmdepend_t *dep = _alpm_splitdep(ptr);
newpkg->depends = alpm_list_add(newpkg->depends, dep);
} else if(!strcmp(key, "optdepend")) {
newpkg->optdepends = alpm_list_add(newpkg->optdepends, strdup(ptr));
} else if(!strcmp(key, "conflict")) {
newpkg->conflicts = alpm_list_add(newpkg->conflicts, strdup(ptr));
} else if(!strcmp(key, "replaces")) {
newpkg->replaces = alpm_list_add(newpkg->replaces, strdup(ptr));
} else if(!strcmp(key, "provides")) {
newpkg->provides = alpm_list_add(newpkg->provides, strdup(ptr));
} else if(!strcmp(key, "backup")) {
newpkg->backup = alpm_list_add(newpkg->backup, strdup(ptr));
} else {
_alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d\n",
newpkg->name ? newpkg->name : "error", linenum);
}
}
line[0] = '\0';
}
return(0);
}
/**
* Load a package and create the corresponding pmpkg_t struct.
* @param pkgfile path to the package file
* @param full whether to stop the load after metadata is read or continue
* through the full archive
* @return An information filled pmpkg_t struct
*/
static pmpkg_t *pkg_load(const char *pkgfile, unsigned short full)
{
int ret = ARCHIVE_OK;
int config = 0;
struct archive *archive;
struct archive_entry *entry;
pmpkg_t *newpkg = NULL;
struct stat st;
ALPM_LOG_FUNC;
if(pkgfile == NULL || strlen(pkgfile) == 0) {
RET_ERR(PM_ERR_WRONG_ARGS, NULL);
}
if(stat(pkgfile, &st) != 0) {
RET_ERR(PM_ERR_PKG_OPEN, NULL);
}
if((archive = archive_read_new()) == NULL) {
RET_ERR(PM_ERR_LIBARCHIVE, NULL);
}
archive_read_support_compression_all(archive);
archive_read_support_format_all(archive);
if (archive_read_open_filename(archive, pkgfile,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
RET_ERR(PM_ERR_PKG_OPEN, NULL);
}
newpkg = _alpm_pkg_new();
if(newpkg == NULL) {
archive_read_finish(archive);
RET_ERR(PM_ERR_MEMORY, NULL);
}
newpkg->filename = strdup(pkgfile);
newpkg->size = st.st_size;
/* If full is false, only read through the archive until we find our needed
* metadata. If it is true, read through the entire archive, which serves
* as a verfication of integrity and allows us to create the filelist. */
while((ret = archive_read_next_header(archive, &entry)) == ARCHIVE_OK) {
const char *entry_name = archive_entry_pathname(entry);
if(strcmp(entry_name, ".PKGINFO") == 0) {
/* parse the info file */
if(parse_descfile(archive, newpkg) != 0) {
_alpm_log(PM_LOG_ERROR, _("could not parse package description file in %s\n"),
pkgfile);
goto pkg_invalid;
}
if(newpkg->name == NULL || strlen(newpkg->name) == 0) {
_alpm_log(PM_LOG_ERROR, _("missing package name in %s\n"), pkgfile);
goto pkg_invalid;
}
if(newpkg->version == NULL || strlen(newpkg->version) == 0) {
_alpm_log(PM_LOG_ERROR, _("missing package version in %s\n"), pkgfile);
goto pkg_invalid;
}
config = 1;
continue;
} else if(strcmp(entry_name, ".INSTALL") == 0) {
newpkg->scriptlet = 1;
} else if(*entry_name == '.') {
/* for now, ignore all files starting with '.' that haven't
* already been handled (for future possibilities) */
} else {
/* Keep track of all files for filelist generation */
newpkg->files = alpm_list_add(newpkg->files, strdup(entry_name));
}
if(archive_read_data_skip(archive)) {
_alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"),
pkgfile, archive_error_string(archive));
pm_errno = PM_ERR_LIBARCHIVE;
goto error;
}
/* if we are not doing a full read, see if we have all we need */
if(!full && config) {
break;
}
}
if(ret != ARCHIVE_EOF && ret != ARCHIVE_OK) { /* An error occured */
_alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"),
pkgfile, archive_error_string(archive));
pm_errno = PM_ERR_LIBARCHIVE;
goto error;
}
if(!config) {
_alpm_log(PM_LOG_ERROR, _("missing package metadata in %s\n"), pkgfile);
goto pkg_invalid;
}
archive_read_finish(archive);
/* internal fields for package struct */
newpkg->origin = PKG_FROM_FILE;
newpkg->origin_data.file = strdup(pkgfile);
if(full) {
/* "checking for conflicts" requires a sorted list, ensure that here */
_alpm_log(PM_LOG_DEBUG, "sorting package filelist for %s\n", pkgfile);
newpkg->files = alpm_list_msort(newpkg->files, alpm_list_count(newpkg->files),
_alpm_str_cmp);
newpkg->infolevel = INFRQ_ALL;
} else {
/* get rid of any partial filelist we may have collected, it is invalid */
FREELIST(newpkg->files);
newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_DEPENDS;
}
return(newpkg);
pkg_invalid:
pm_errno = PM_ERR_PKG_INVALID;
error:
_alpm_pkg_free(newpkg);
archive_read_finish(archive);
return(NULL);
}
/** Create a package from a file.
* If full is false, the archive is read only until all necessary
* metadata is found. If it is true, the entire archive is read, which
* serves as a verfication of integrity and the filelist can be created.
* @param filename location of the package tarball
* @param full whether to stop the load after metadata is read or continue
* through the full archive
* @param pkg address of the package pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int SYMEXPORT alpm_pkg_load(const char *filename, unsigned short full,
pmpkg_t **pkg)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(filename != NULL && strlen(filename) != 0,
RET_ERR(PM_ERR_WRONG_ARGS, -1));
ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
*pkg = pkg_load(filename, full);
if(*pkg == NULL) {
/* pm_errno is set by pkg_load */
return(-1);
}
return(0);
}
/* vim: set ts=2 sw=2 noet: */

View File

@@ -31,7 +31,6 @@
#include "log.h"
#include "alpm.h"
#include "util.h"
#include "error.h"
#include "package.h"
#include "group.h"
#include "db.h"
@@ -41,32 +40,21 @@
*/
int _alpm_db_load_pkgcache(pmdb_t *db)
{
pmpkg_t *info;
int count = 0;
ALPM_LOG_FUNC;
if(db == NULL) {
return(-1);
}
_alpm_db_free_pkgcache(db);
_alpm_log(PM_LOG_DEBUG, "loading package cache for repository '%s'\n",
db->treename);
_alpm_db_rewind(db);
while((info = _alpm_db_scan(db, NULL)) != NULL) {
_alpm_log(PM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
alpm_pkg_get_name(info), db->treename);
info->origin = PKG_FROM_CACHE;
info->origin_data.db = db;
/* add to the collection */
db->pkgcache = alpm_list_add(db->pkgcache, info);
count++;
db->treename);
if(_alpm_db_populate(db) == -1) {
_alpm_log(PM_LOG_DEBUG,
"failed to load package cache for repository '%s'\n", db->treename);
return(-1);
}
db->pkgcache = alpm_list_msort(db->pkgcache, count, _alpm_pkg_cmp);
return(0);
}
@@ -81,10 +69,7 @@ void _alpm_db_free_pkgcache(pmdb_t *db)
_alpm_log(PM_LOG_DEBUG, "freeing package cache for repository '%s'\n",
db->treename);
alpm_list_t *tmp;
for(tmp = db->pkgcache; tmp; tmp = alpm_list_next(tmp)) {
_alpm_pkg_free(tmp->data);
}
alpm_list_free_inner(db->pkgcache, (alpm_list_fn_free)_alpm_pkg_free);
alpm_list_free(db->pkgcache);
db->pkgcache = NULL;
@@ -113,6 +98,7 @@ alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db)
return(db->pkgcache);
}
/* "duplicate" pkg with BASE info (to spare some memory) then add it to pkgcache */
int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
{
pmpkg_t *newpkg;
@@ -123,10 +109,21 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
return(-1);
}
newpkg = _alpm_pkg_dup(pkg);
newpkg = _alpm_pkg_new();
if(newpkg == NULL) {
return(-1);
}
newpkg->name = strdup(pkg->name);
newpkg->version = strdup(pkg->version);
if(newpkg->name == NULL || newpkg->version == NULL) {
pm_errno = PM_ERR_MEMORY;
_alpm_pkg_free(newpkg);
return(-1);
}
newpkg->origin = PKG_FROM_CACHE;
newpkg->origin_data.db = db;
newpkg->infolevel = INFRQ_BASE;
_alpm_log(PM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n",
alpm_pkg_get_name(newpkg), db->treename);
db->pkgcache = alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp);
@@ -181,7 +178,7 @@ pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target)
return(NULL);
}
return(_alpm_pkg_find(target, pkgcache));
return(_alpm_pkg_find(pkgcache, target));
}
/* Returns a new group cache from db.
@@ -208,33 +205,29 @@ int _alpm_db_load_grpcache(pmdb_t *db)
pmpkg_t *pkg = lp->data;
for(i = alpm_pkg_get_groups(pkg); i; i = i->next) {
if(!alpm_list_find_str(db->grpcache, i->data)) {
pmgrp_t *grp = _alpm_grp_new();
const char *grpname = i->data;
alpm_list_t *j;
pmgrp_t *grp = NULL;
int found = 0;
strncpy(grp->name, i->data, GRP_NAME_LEN);
grp->name[GRP_NAME_LEN-1] = '\0';
grp->packages = alpm_list_add_sorted(grp->packages,
/* gross signature forces us to
* discard const */
(void*)alpm_pkg_get_name(pkg),
_alpm_str_cmp);
db->grpcache = alpm_list_add_sorted(db->grpcache, grp, _alpm_grp_cmp);
} else {
alpm_list_t *j;
/* first look through the group cache for a group with this name */
for(j = db->grpcache; j; j = j->next) {
grp = j->data;
for(j = db->grpcache; j; j = j->next) {
pmgrp_t *grp = j->data;
if(strcmp(grp->name, i->data) == 0) {
const char *pkgname = alpm_pkg_get_name(pkg);
if(!alpm_list_find_str(grp->packages, pkgname)) {
grp->packages = alpm_list_add_sorted(grp->packages,
(void*)pkgname,
_alpm_str_cmp);
}
}
if(strcmp(grp->name, grpname) == 0
&& !alpm_list_find_ptr(grp->packages, pkg)) {
grp->packages = alpm_list_add(grp->packages, pkg);
found = 1;
break;
}
}
if(found) {
continue;
}
/* we didn't find the group, so create a new one with this name */
grp = _alpm_grp_new(grpname);
grp->packages = alpm_list_add(grp->packages, pkg);
db->grpcache = alpm_list_add(db->grpcache, grp);
}
}
@@ -252,10 +245,6 @@ void _alpm_db_free_grpcache(pmdb_t *db)
}
for(lg = db->grpcache; lg; lg = lg->next) {
pmgrp_t *grp = lg->data;
alpm_list_free(grp->packages);
grp->packages = NULL;
_alpm_grp_free(lg->data);
lg->data = NULL;
}

View File

@@ -36,7 +36,6 @@
#include "handle.h"
#include "trans.h"
#include "util.h"
#include "error.h"
#include "log.h"
#include "cache.h"
#include "deps.h"
@@ -49,12 +48,30 @@ pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2)
MALLOC(conflict, sizeof(pmconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
strncpy(conflict->package1, package1, PKG_NAME_LEN);
strncpy(conflict->package2, package2, PKG_NAME_LEN);
STRDUP(conflict->package1, package1, RET_ERR(PM_ERR_MEMORY, NULL));
STRDUP(conflict->package2, package2, RET_ERR(PM_ERR_MEMORY, NULL));
return(conflict);
}
void _alpm_conflict_free(pmconflict_t *conflict)
{
FREE(conflict->package2);
FREE(conflict->package1);
FREE(conflict);
}
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict)
{
pmconflict_t *newconflict;
CALLOC(newconflict, 1, sizeof(pmconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
STRDUP(newconflict->package1, conflict->package1, RET_ERR(PM_ERR_MEMORY, NULL));
STRDUP(newconflict->package2, conflict->package2, RET_ERR(PM_ERR_MEMORY, NULL));
return(newconflict);
}
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
{
alpm_list_t *i;
@@ -86,7 +103,7 @@ static int does_conflict(pmpkg_t *pkg1, const char *conflict, pmpkg_t *pkg2)
{
const char *pkg1name = alpm_pkg_get_name(pkg1);
const char *pkg2name = alpm_pkg_get_name(pkg2);
pmdepend_t *conf = alpm_splitdep(conflict);
pmdepend_t *conf = _alpm_splitdep(conflict);
int match = 0;
match = alpm_depcmp(pkg2, conf);
@@ -94,7 +111,7 @@ static int does_conflict(pmpkg_t *pkg1, const char *conflict, pmpkg_t *pkg2)
_alpm_log(PM_LOG_DEBUG, "package %s conflicts with %s (by %s)\n",
pkg1name, pkg2name, conflict);
}
FREE(conf);
_alpm_dep_free(conf);
return(match);
}
@@ -110,7 +127,7 @@ static void add_conflict(alpm_list_t **baddeps, const char *pkg1,
if(conflict && !_alpm_conflict_isin(conflict, *baddeps)) {
*baddeps = alpm_list_add(*baddeps, conflict);
} else {
FREE(conflict);
_alpm_conflict_free(conflict);
}
}
@@ -200,9 +217,13 @@ alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages)
return(baddeps);
}
/* Check for transaction conflicts */
alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages) {
return(alpm_list_join(_alpm_innerconflicts(packages), _alpm_outerconflicts(db, packages)));
/** Check the package conflicts in a database
*
* @param db_local the database to check
* @return an alpm_list_t of pmconflict_t
*/
alpm_list_t SYMEXPORT *alpm_checkdbconflicts(pmdb_t *db_local) {
return(_alpm_innerconflicts(_alpm_db_get_pkgcache(db_local)));
}
/* Returns a alpm_list_t* of file conflicts.
@@ -299,15 +320,15 @@ static alpm_list_t *add_fileconflict(alpm_list_t *conflicts,
const char* name1, const char* name2)
{
pmfileconflict_t *conflict;
MALLOC(conflict, sizeof(pmfileconflict_t), return(conflicts));
MALLOC(conflict, sizeof(pmfileconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
conflict->type = type;
strncpy(conflict->target, name1, PKG_NAME_LEN);
strncpy(conflict->file, filestr, CONFLICT_FILE_LEN);
STRDUP(conflict->target, name1, RET_ERR(PM_ERR_MEMORY, NULL));
STRDUP(conflict->file, filestr, RET_ERR(PM_ERR_MEMORY, NULL));
if(name2) {
strncpy(conflict->ctarget, name2, PKG_NAME_LEN);
STRDUP(conflict->ctarget, name2, RET_ERR(PM_ERR_MEMORY, NULL));
} else {
conflict->ctarget[0] = '\0';
conflict->ctarget = "";
}
conflicts = alpm_list_add(conflicts, conflict);
@@ -317,6 +338,16 @@ static alpm_list_t *add_fileconflict(alpm_list_t *conflicts,
return(conflicts);
}
void _alpm_fileconflict_free(pmfileconflict_t *conflict)
{
if(strlen(conflict->ctarget) > 0) {
FREE(conflict->ctarget);
}
FREE(conflict->file);;
FREE(conflict->target);
FREE(conflict);
}
/* Find file conflicts that may occur during the transaction with two checks:
* 1: check every target against every target
* 2: check every target against the filesystem */
@@ -351,13 +382,13 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, char *roo
PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", (percent * 100),
numtargs, current);
/* CHECK 1: check every target against every target */
_alpm_log(PM_LOG_DEBUG, "searching for file conflicts: %s\n",
alpm_pkg_get_name(p1));
for(j = i->next; j; j = j->next) {
p2 = j->data;
if(!p2) {
continue;
}
_alpm_log(PM_LOG_DEBUG, "searching for file conflicts: %s and %s\n",
alpm_pkg_get_name(p1), alpm_pkg_get_name(p2));
tmpfiles = chk_fileconflicts(alpm_pkg_get_files(p1), alpm_pkg_get_files(p2));
if(tmpfiles) {
@@ -416,26 +447,6 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, char *roo
if(!skip_conflict) {
_alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s\n", path);
/* Make sure the possible conflict is not a symlink that points to a
* path in the old package. This is kind of dirty with inode usage */
/* TODO this seems ripe for a cleanup */
if(dbpkg) {
struct stat pkgbuf;
char str[PATH_MAX+1];
unsigned ok = 0;
for(k = dbpkg->files; k; k = k->next) {
snprintf(str, PATH_MAX, "%s%s", root, (char*)k->data);
if(!_alpm_lstat(str, &pkgbuf) && lsbuf.st_ino == pkgbuf.st_ino) {
ok = 1;
_alpm_log(PM_LOG_DEBUG, "conflict was a symlink: %s\n", path);
break;
}
}
if(ok == 1) {
continue;
}
}
/* Look at all the targets to see if file has changed hands */
int resolved_conflict = 0; /* have we acted on this conflict? */
for(k = targets; k; k = k->next) {

View File

@@ -23,27 +23,28 @@
#include "db.h"
#include "package.h"
#define CONFLICT_FILE_LEN 512
struct __pmconflict_t {
char package1[PKG_NAME_LEN];
char package2[PKG_NAME_LEN];
char *package1;
char *package2;
};
struct __pmfileconflict_t {
char target[PKG_NAME_LEN];
char *target;
pmfileconflicttype_t type;
char file[CONFLICT_FILE_LEN];
char ctarget[PKG_NAME_LEN];
char *file;
char *ctarget;
};
pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2);
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict);
void _alpm_conflict_free(pmconflict_t *conflict);
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack);
alpm_list_t *_alpm_innerconflicts(alpm_list_t *packages);
alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages);
alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages);
alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, char *root);
void _alpm_fileconflict_free(pmfileconflict_t *conflict);
#endif /* _ALPM_CONFLICT_H */
/* vim: set ts=2 sw=2 noet: */

View File

@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdint.h> /* uintmax_t */
#include <sys/stat.h>
#include <dirent.h>
#include <regex.h>
@@ -39,8 +38,6 @@
#include "alpm_list.h"
#include "log.h"
#include "util.h"
#include "error.h"
#include "server.h"
#include "handle.h"
#include "cache.h"
#include "alpm.h"
@@ -173,6 +170,8 @@ int SYMEXPORT alpm_db_setserver(pmdb_t *db, const char *url)
{
alpm_list_t *i;
int found = 0;
char *newurl;
int len = 0;
ALPM_LOG_FUNC;
@@ -189,15 +188,18 @@ int SYMEXPORT alpm_db_setserver(pmdb_t *db, const char *url)
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
}
if(url && strlen(url)) {
pmserver_t *server;
if((server = _alpm_server_new(url)) == NULL) {
/* pm_errno is set by _alpm_server_new */
return(-1);
if(url) {
len = strlen(url);
}
if(len) {
newurl = strdup(url);
/* strip the trailing slash if one exists */
if(newurl[len - 1] == '/') {
newurl[len - 1] = '\0';
}
db->servers = alpm_list_add(db->servers, server);
_alpm_log(PM_LOG_DEBUG, "adding new server to database '%s': protocol '%s', server '%s', path '%s'\n",
db->treename, server->s_url->scheme, server->s_url->host, server->s_url->doc);
db->servers = alpm_list_add(db->servers, newurl);
_alpm_log(PM_LOG_DEBUG, "adding new server URL to database '%s': %s\n",
db->treename, newurl);
} else {
FREELIST(db->servers);
_alpm_log(PM_LOG_DEBUG, "serverlist flushed for '%s'\n", db->treename);
@@ -206,98 +208,6 @@ int SYMEXPORT alpm_db_setserver(pmdb_t *db, const char *url)
return(0);
}
/** Update a package database
* @param force if true, then forces the update, otherwise update only in case
* the database isn't up to date
* @param db pointer to the package database to update
* @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up
* to date
*/
int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
{
alpm_list_t *lp;
char path[PATH_MAX];
alpm_list_t *files = NULL;
time_t newmtime = 0, lastupdate = 0;
const char *dbpath;
int ret;
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
ASSERT(db != NULL && db != handle->db_local, RET_ERR(PM_ERR_WRONG_ARGS, -1));
/* Verify we are in a transaction. This is done _mainly_ because we need a DB
* lock - if we update without a db lock, we may kludge some other pacman
* process that _has_ a lock.
*/
ASSERT(handle->trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(handle->trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1));
ASSERT(handle->trans->type == PM_TRANS_TYPE_SYNC, RET_ERR(PM_ERR_TRANS_TYPE, -1));
if(!alpm_list_find_ptr(handle->dbs_sync, db)) {
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
}
if(!force) {
/* get the lastupdate time */
lastupdate = _alpm_db_getlastupdate(db);
if(lastupdate == 0) {
_alpm_log(PM_LOG_DEBUG, "failed to get lastupdate time for %s\n",
db->treename);
}
}
/* build a one-element list */
snprintf(path, PATH_MAX, "%s" DBEXT, db->treename);
files = alpm_list_add(files, strdup(path));
dbpath = alpm_option_get_dbpath();
ret = _alpm_downloadfiles_forreal(db->servers, dbpath, files, lastupdate,
&newmtime, NULL, 0);
FREELIST(files);
if(ret == 1) {
/* mtimes match, do nothing */
pm_errno = 0;
return(1);
} else if(ret == -1) {
/* we use downloadLastErrString and downloadLastErrCode here, error returns from
* libdownload */
_alpm_log(PM_LOG_DEBUG, "failed to sync db: %s [%d]\n",
downloadLastErrString, downloadLastErrCode);
RET_ERR(PM_ERR_DB_SYNC, -1);
} else {
if(newmtime != 0) {
_alpm_log(PM_LOG_DEBUG, "sync: new mtime for %s: %ju\n",
db->treename, (uintmax_t)newmtime);
_alpm_db_setlastupdate(db, newmtime);
}
snprintf(path, PATH_MAX, "%s%s" DBEXT, dbpath, db->treename);
/* remove the old dir */
_alpm_log(PM_LOG_DEBUG, "flushing database %s\n", db->path);
for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) {
pmpkg_t *pkg = lp->data;
if(pkg && _alpm_db_remove(db, pkg) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not remove database entry %s%s\n"), db->treename,
alpm_pkg_get_name(pkg));
RET_ERR(PM_ERR_DB_REMOVE, -1);
}
}
/* Cache needs to be rebuild */
_alpm_db_free_pkgcache(db);
/* uncompress the sync database */
if(_alpm_db_install(db, path) == -1) {
return -1;
}
}
return(0);
}
/** Get the name of a package database
* @param db pointer to the package database
* @return the name of the package database, NULL on error
@@ -319,8 +229,7 @@ const char SYMEXPORT *alpm_db_get_name(const pmdb_t *db)
*/
const char SYMEXPORT *alpm_db_get_url(const pmdb_t *db)
{
char path[PATH_MAX];
pmserver_t *s;
char *url;
ALPM_LOG_FUNC;
@@ -328,10 +237,9 @@ const char SYMEXPORT *alpm_db_get_url(const pmdb_t *db)
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
s = (pmserver_t*)db->servers->data;
url = (char*)db->servers->data;
snprintf(path, PATH_MAX, "%s://%s%s", s->s_url->scheme, s->s_url->host, s->s_url->doc);
return strdup(path);
return(url);
}
@@ -367,23 +275,6 @@ alpm_list_t SYMEXPORT *alpm_db_getpkgcache(pmdb_t *db)
return(_alpm_db_get_pkgcache(db));
}
/** Get the list of packages that a package provides
* @param db pointer to the package database to get the package from
* @param name name of the package
* @return the list of packages on success, NULL on error
*/
alpm_list_t SYMEXPORT *alpm_db_whatprovides(pmdb_t *db, const char *name)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
ASSERT(name != NULL && strlen(name) != 0, return(NULL));
return(_alpm_db_whatprovides(db, name));
}
/** Get a group entry from a package database
* @param db pointer to the package database to get the group from
* @param name of the group
@@ -445,41 +336,39 @@ pmdb_t *_alpm_db_new(const char *dbpath, const char *treename)
CALLOC(db->path, 1, pathsize, RET_ERR(PM_ERR_MEMORY, NULL));
sprintf(db->path, "%s%s/", dbpath, treename);
strncpy(db->treename, treename, PATH_MAX);
STRDUP(db->treename, treename, RET_ERR(PM_ERR_MEMORY, NULL));
return(db);
}
void _alpm_db_free(pmdb_t *db)
{
alpm_list_t *tmp;
ALPM_LOG_FUNC;
/* cleanup pkgcache */
_alpm_db_free_pkgcache(db);
/* cleanup server list */
for(tmp = db->servers; tmp; tmp = alpm_list_next(tmp)) {
_alpm_server_free(tmp->data);
}
alpm_list_free(db->servers);
FREELIST(db->servers);
FREE(db->path);
FREE(db->treename);
FREE(db);
return;
}
int _alpm_db_cmp(const void *db1, const void *db2)
int _alpm_db_cmp(const void *d1, const void *d2)
{
ALPM_LOG_FUNC;
return(strcmp(((pmdb_t *)db1)->treename, ((pmdb_t *)db2)->treename));
pmdb_t *db1 = (pmdb_t *)d1;
pmdb_t *db2 = (pmdb_t *)d2;
return(strcmp(db1->treename, db2->treename));
}
alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
{
const alpm_list_t *i, *j, *k;
alpm_list_t *ret = NULL;
/* copy the pkgcache- we will free the list var after each needle */
alpm_list_t *list = alpm_list_copy(_alpm_db_get_pkgcache(db));
ALPM_LOG_FUNC;
@@ -490,6 +379,7 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
if(i->data == NULL) {
continue;
}
ret = NULL;
targ = i->data;
_alpm_log(PM_LOG_DEBUG, "searching for target '%s'\n", targ);
@@ -497,21 +387,19 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
RET_ERR(PM_ERR_INVALID_REGEX, NULL);
}
for(j = _alpm_db_get_pkgcache(db); j; j = j->next) {
for(j = list; j; j = j->next) {
pmpkg_t *pkg = j->data;
const char *matched = NULL;
const char *name = alpm_pkg_get_name(pkg);
const char *desc = alpm_pkg_get_desc(pkg);
/* check name */
if (regexec(&reg, alpm_pkg_get_name(pkg), 0, 0, 0) == 0) {
matched = alpm_pkg_get_name(pkg);
}
/* check plain text name */
else if (strstr(alpm_pkg_get_name(pkg), targ)) {
matched = alpm_pkg_get_name(pkg);
/* check name as regex AND as plain text */
if(name && (regexec(&reg, name, 0, 0, 0) == 0 || strstr(name, targ))) {
matched = name;
}
/* check desc */
else if (regexec(&reg, alpm_pkg_get_desc(pkg), 0, 0, 0) == 0) {
matched = alpm_pkg_get_desc(pkg);
else if (desc && regexec(&reg, desc, 0, 0, 0) == 0) {
matched = desc;
}
/* check provides */
/* TODO: should we be doing this, and should we print something
@@ -532,6 +420,10 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
}
}
/* Free the existing search list, and use the returned list for the
* next needle. This allows for AND-based package searching. */
alpm_list_free(list);
list = ret;
regfree(&reg);
}
@@ -641,47 +533,4 @@ pmdb_t *_alpm_db_register_sync(const char *treename)
return(db);
}
/* helper function for alpm_list_find and _alpm_db_whatprovides
*
* @return "provision.name" == needle (as string)
*/
int _alpm_prov_cmp(const void *provision, const void *needle)
{
char *tmpptr;
char *provname = strdup(provision);
int retval = 0;
tmpptr = strchr(provname, '=');
if(tmpptr != NULL) { /* provision-version */
*tmpptr='\0';
}
retval = strcmp(provname, needle);
free(provname);
return(retval);
}
/* return a alpm_list_t of packages in "db" that provide "package"
*/
alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package)
{
alpm_list_t *pkgs = NULL;
alpm_list_t *lp;
ALPM_LOG_FUNC;
if(db == NULL || package == NULL || strlen(package) == 0) {
return(NULL);
}
for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) {
pmpkg_t *info = lp->data;
if(alpm_list_find(alpm_pkg_get_provides(info), (const void *)package, _alpm_prov_cmp)) {
pkgs = alpm_list_add(pkgs, info);
}
}
return(pkgs);
}
/* vim: set ts=2 sw=2 noet: */

View File

@@ -40,7 +40,7 @@ typedef enum _pmdbinfrq_t {
/* Database */
struct __pmdb_t {
char *path;
char treename[PATH_MAX];
char *treename;
void *handle;
alpm_list_t *pkgcache;
alpm_list_t *grpcache;
@@ -50,26 +50,18 @@ struct __pmdb_t {
/* db.c, database general calls */
pmdb_t *_alpm_db_new(const char *dbpath, const char *treename);
void _alpm_db_free(pmdb_t *db);
int _alpm_db_cmp(const void *db1, const void *db2);
int _alpm_db_cmp(const void *d1, const void *d2);
alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles);
pmdb_t *_alpm_db_register_local(void);
pmdb_t *_alpm_db_register_sync(const char *treename);
/* Provision */
int _alpm_prov_cmp(const void *provision, const void *needle);
alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package);
/* be.c, backend specific calls */
int _alpm_db_install(pmdb_t *db, const char *dbfile);
int _alpm_db_open(pmdb_t *db);
void _alpm_db_close(pmdb_t *db);
void _alpm_db_rewind(pmdb_t *db);
pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target);
int _alpm_db_populate(pmdb_t *db);
int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
int _alpm_db_remove(pmdb_t *db, pmpkg_t *info);
time_t _alpm_db_getlastupdate(const pmdb_t *db);
int _alpm_db_setlastupdate(const pmdb_t *db, time_t time);
#endif /* _ALPM_DB_H */

View File

@@ -1,7 +1,7 @@
/*
* delta.c
*
* Copyright (c) 2007 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2007-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,14 +21,14 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>
/* libalpm */
#include "delta.h"
#include "error.h"
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "alpm_list.h"
#include "alpm.h"
#include "graph.h"
/** \addtogroup alpm_deltas Delta Functions
* @brief Functions to manipulate libalpm deltas
@@ -37,200 +37,222 @@
const char SYMEXPORT *alpm_delta_get_from(pmdelta_t *delta)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(delta != NULL, return(NULL));
return(delta->from);
}
const char SYMEXPORT *alpm_delta_get_from_md5sum(pmdelta_t *delta)
{
ASSERT(delta != NULL, return(NULL));
return(delta->from_md5);
}
const char SYMEXPORT *alpm_delta_get_to(pmdelta_t *delta)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(delta != NULL, return(NULL));
return(delta->to);
}
unsigned long SYMEXPORT alpm_delta_get_size(pmdelta_t *delta)
const char SYMEXPORT *alpm_delta_get_to_md5sum(pmdelta_t *delta)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(delta != NULL, return(-1));
return(delta->size);
ASSERT(delta != NULL, return(NULL));
return(delta->to_md5);
}
const char SYMEXPORT *alpm_delta_get_filename(pmdelta_t *delta)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(delta != NULL, return(NULL));
return(delta->filename);
return(delta->delta);
}
const char SYMEXPORT *alpm_delta_get_md5sum(pmdelta_t *delta)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(delta != NULL, return(NULL));
return(delta->delta_md5);
}
return(delta->md5sum);
off_t SYMEXPORT alpm_delta_get_size(pmdelta_t *delta)
{
ASSERT(delta != NULL, return(-1));
return(delta->delta_size);
}
/** @} */
/** Calculates the combined size of a list of delta files.
*
* @param deltas the list of pmdelta_t * objects
*
* @return the combined size
*/
unsigned long _alpm_delta_path_size(alpm_list_t *deltas)
static alpm_list_t *delta_graph_init(alpm_list_t *deltas)
{
unsigned long sum = 0;
alpm_list_t *dlts = deltas;
alpm_list_t *i, *j;
alpm_list_t *vertices = NULL;
/* create the vertices */
for(i = deltas; i; i = i->next) {
char *fpath, *md5sum;
pmgraph_t *v = _alpm_graph_new();
pmdelta_t *vdelta = i->data;
vdelta->download_size = vdelta->delta_size;
v->weight = LONG_MAX;
while(dlts) {
pmdelta_t *d = (pmdelta_t *)alpm_list_getdata(dlts);
sum += d->size;
/* determine whether the delta file already exists */
fpath = _alpm_filecache_find(vdelta->delta);
md5sum = alpm_get_md5sum(fpath);
if(fpath && md5sum && strcmp(md5sum, vdelta->delta_md5) == 0) {
vdelta->download_size = 0;
}
FREE(fpath);
FREE(md5sum);
dlts = alpm_list_next(dlts);
/* determine whether a base 'from' file exists */
fpath = _alpm_filecache_find(vdelta->from);
md5sum = alpm_get_md5sum(fpath);
if(fpath && md5sum && strcmp(md5sum, vdelta->from_md5) == 0) {
v->weight = vdelta->download_size;
}
FREE(fpath);
FREE(md5sum);
v->data = vdelta;
vertices = alpm_list_add(vertices, v);
}
return(sum);
/* compute the edges */
for(i = vertices; i; i = i->next) {
pmgraph_t *v_i = i->data;
pmdelta_t *d_i = v_i->data;
/* loop a second time so we make all possible comparisons */
for(j = vertices; j; j = j->next) {
pmgraph_t *v_j = j->data;
pmdelta_t *d_j = v_j->data;
/* We want to create a delta tree like the following:
* 1_to_2
* |
* 1_to_3 2_to_3
* \ /
* 3_to_4
* If J 'from' is equal to I 'to', then J is a child of I.
* */
if(strcmp(d_j->from, d_i->to) == 0
&& strcmp(d_j->from_md5, d_i->to_md5) == 0) {
v_i->children = alpm_list_add(v_i->children, v_j);
}
}
v_i->childptr = v_i->children;
}
return(vertices);
}
/** Calculates the combined size of a list of delta files that are not
* in the cache.
*
* @param deltas the list of pmdelta_t * objects
*
* @return the combined size
*/
unsigned long _alpm_delta_path_size_uncached(alpm_list_t *deltas)
{
unsigned long sum = 0;
alpm_list_t *dlts = deltas;
static off_t delta_vert(alpm_list_t *vertices,
const char *to, const char *to_md5, alpm_list_t **path) {
alpm_list_t *i;
pmgraph_t *v;
while(1) {
v = NULL;
/* find the smallest vertice not visited yet */
for(i = vertices; i; i = i->next) {
pmgraph_t *v_i = i->data;
while(dlts) {
pmdelta_t *d = (pmdelta_t *)alpm_list_getdata(dlts);
char *fname = _alpm_filecache_find(d->filename);
if(v_i->state == -1) {
continue;
}
if(!fname) {
sum += d->size;
if(v == NULL || v_i->weight < v->weight) {
v = v_i;
}
}
if(v == NULL || v->weight == LONG_MAX) {
break;
}
FREE(fname);
v->state = -1;
dlts = alpm_list_next(dlts);
}
v->childptr = v->children;
while(v->childptr) {
pmgraph_t *v_c = v->childptr->data;
pmdelta_t *d_c = v_c->data;
if(v_c->weight > v->weight + d_c->download_size) {
v_c->weight = v->weight + d_c->download_size;
v_c->parent = v;
}
return(sum);
}
v->childptr = (v->childptr)->next;
/** Calculates the shortest path from one version to another.
*
* The shortest path is defined as the path with the smallest combined
* size, not the length of the path.
*
* The algorithm is based on Dijkstra's shortest path algorithm.
*
* @param deltas the list of pmdelta_t * objects that a package has
* @param from the version to start from
* @param to the version to end at
* @param path the current path
*
* @return the list of pmdelta_t * objects that has the smallest size.
* NULL (the empty list) is returned if there is no path between the
* versions.
*/
static alpm_list_t *shortest_delta_path(alpm_list_t *deltas,
const char *from, const char *to, alpm_list_t *path)
{
alpm_list_t *d;
alpm_list_t *shortest = NULL;
/* Found the 'to' version, this is a good path so return it. */
if(strcmp(from, to) == 0) {
return(path);
}
for(d = deltas; d; d = alpm_list_next(d)) {
pmdelta_t *v = alpm_list_getdata(d);
/* If this vertex has already been visited in the path, go to the
* next vertex. */
if(alpm_list_find_ptr(path, v)) {
continue;
}
}
/* Once we find a vertex that starts at the 'from' version,
* recursively find the shortest path using the 'to' version of this
* current vertex as the 'from' version in the function call. */
if(strcmp(v->from, from) == 0) {
alpm_list_t *newpath = alpm_list_copy(path);
newpath = alpm_list_add(newpath, v);
newpath = shortest_delta_path(deltas, v->to, to, newpath);
v = NULL;
off_t bestsize = 0;
if(newpath != NULL) {
/* The path returned works, now use it unless there is already a
* shorter path found. */
if(shortest == NULL) {
shortest = newpath;
} else if(_alpm_delta_path_size(shortest) > _alpm_delta_path_size(newpath)) {
alpm_list_free(shortest);
shortest = newpath;
} else {
alpm_list_free(newpath);
}
for(i = vertices; i; i = i->next) {
pmgraph_t *v_i = i->data;
pmdelta_t *d_i = v_i->data;
if(strcmp(d_i->to, to) == 0
|| strcmp(d_i->to_md5, to_md5) == 0) {
if(v == NULL || v_i->weight < v->weight) {
v = v_i;
bestsize = v->weight;
}
}
}
alpm_list_free(path);
alpm_list_t *rpath = NULL;
while(v != NULL) {
pmdelta_t *vdelta = v->data;
rpath = alpm_list_add(rpath, vdelta);
v = v->parent;
}
*path = alpm_list_reverse(rpath);
alpm_list_free(rpath);
return(shortest);
return(bestsize);
}
/** Calculates the shortest path from one version to another.
*
* The shortest path is defined as the path with the smallest combined
* size, not the length of the path.
*
* @param deltas the list of pmdelta_t * objects that a package has
* @param from the version to start from
* @param to the version to end at
*
* @return the list of pmdelta_t * objects that has the smallest size.
* NULL (the empty list) is returned if there is no path between the
* versions.
* @param deltas the list of pmdelta_t * objects that a file has
* @param to the file to start the search at
* @param to_md5 the md5sum of the above named file
* @param path the pointer to a list location where pmdelta_t * objects that
* have the smallest size are placed. NULL is set if there is no path
* possible with the files available.
* @return the size of the path stored, or LONG_MAX if path is unfindable
*/
alpm_list_t *_alpm_shortest_delta_path(alpm_list_t *deltas, const char *from,
const char *to)
off_t _alpm_shortest_delta_path(alpm_list_t *deltas,
const char *to, const char *to_md5, alpm_list_t **path)
{
alpm_list_t *path = NULL;
alpm_list_t *bestpath = NULL;
alpm_list_t *vertices;
off_t bestsize = LONG_MAX;
path = shortest_delta_path(deltas, from, to, path);
ALPM_LOG_FUNC;
return(path);
if(deltas == NULL) {
*path = NULL;
return(bestsize);
}
_alpm_log(PM_LOG_DEBUG, "started delta shortest-path search\n");
vertices = delta_graph_init(deltas);
bestsize = delta_vert(vertices, to, to_md5, &bestpath);
_alpm_log(PM_LOG_DEBUG, "delta shortest-path search complete\n");
alpm_list_free_inner(vertices, _alpm_graph_free);
alpm_list_free(vertices);
*path = bestpath;
return(bestsize);
}
/** Parses the string representation of a pmdelta_t object.
*
* This function assumes that the string is in the correct format.
*
* This format is as follows:
* $oldfile $oldmd5 $newfile $newmd5 $deltafile $deltamd5 $deltasize
* @param line the string to parse
*
* @return A pointer to the new pmdelta_t object
*/
/* TODO this does not really belong here, but in a parsing lib */
pmdelta_t *_alpm_delta_parse(char *line)
{
pmdelta_t *delta;
@@ -241,26 +263,47 @@ pmdelta_t *_alpm_delta_parse(char *line)
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
strncpy(delta->from, tmp2, DLT_VERSION_LEN);
STRDUP(delta->from, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
strncpy(delta->to, tmp2, DLT_VERSION_LEN);
STRDUP(delta->from_md5, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
delta->size = atol(tmp2);
STRDUP(delta->to, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
strncpy(delta->filename, tmp2, DLT_FILENAME_LEN);
STRDUP(delta->to_md5, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
strncpy(delta->md5sum, tmp, DLT_MD5SUM_LEN);
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
STRDUP(delta->delta, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
STRDUP(delta->delta_md5, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
delta->delta_size = atol(tmp);
return(delta);
}
void _alpm_delta_free(pmdelta_t *delta)
{
FREE(delta->from);
FREE(delta->from_md5);
FREE(delta->to);
FREE(delta->to_md5);
FREE(delta->delta);
FREE(delta->delta_md5);
FREE(delta);
}
/* vim: set ts=2 sw=2 noet: */

View File

@@ -1,7 +1,7 @@
/*
* delta.h
*
* Copyright (c) 2007 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2007-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,24 +19,33 @@
#ifndef _ALPM_DELTA_H
#define _ALPM_DELTA_H
#include <sys/types.h> /* off_t */
#include "alpm.h"
#define DLT_FILENAME_LEN 512
#define DLT_VERSION_LEN 64
#define DLT_MD5SUM_LEN 33
struct __pmdelta_t {
char from[DLT_VERSION_LEN];
char to[DLT_VERSION_LEN];
unsigned long size;
char filename[DLT_FILENAME_LEN];
char md5sum[DLT_MD5SUM_LEN];
/** filename of the 'before' file */
char *from;
/** md5sum of the 'before' file */
char *from_md5;
/** filename of the 'after' file */
char *to;
/** md5sum of the 'after' file */
char *to_md5;
/** filename of the delta patch */
char *delta;
/** md5sum of the delta file */
char *delta_md5;
/** filesize of the delta file */
off_t delta_size;
/** download filesize of the delta file */
off_t download_size;
};
unsigned long _alpm_delta_path_size(alpm_list_t *deltas);
unsigned long _alpm_delta_path_size_uncached(alpm_list_t *deltas);
pmdelta_t *_alpm_delta_parse(char *line);
alpm_list_t *_alpm_shortest_delta_path(alpm_list_t *deltas, const char *from, const char *to);
void _alpm_delta_free(pmdelta_t *delta);
off_t _alpm_shortest_delta_path(alpm_list_t *deltas,
const char *to, const char *to_md5, alpm_list_t **path);
#endif /* _ALPM_DELTA_H */

View File

@@ -30,37 +30,21 @@
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "error.h"
#include "graph.h"
#include "package.h"
#include "db.h"
#include "cache.h"
#include "handle.h"
static pmgraph_t *_alpm_graph_new(void)
void _alpm_dep_free(pmdepend_t *dep)
{
pmgraph_t *graph = NULL;
MALLOC(graph, sizeof(pmgraph_t), RET_ERR(PM_ERR_MEMORY, NULL));
if(graph) {
graph->state = 0;
graph->data = NULL;
graph->parent = NULL;
graph->children = NULL;
graph->childptr = NULL;
}
return(graph);
FREE(dep->name);
FREE(dep->version);
FREE(dep);
}
static void _alpm_graph_free(void *data)
{
pmgraph_t *graph = data;
alpm_list_free(graph->children);
free(graph);
}
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepmod_t depmod,
const char *depname, const char *depversion)
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepend_t *dep,
const char *causingpkg)
{
pmdepmissing_t *miss;
@@ -68,26 +52,29 @@ pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepmod_t depmod,
MALLOC(miss, sizeof(pmdepmissing_t), RET_ERR(PM_ERR_MEMORY, NULL));
strncpy(miss->target, target, PKG_NAME_LEN);
miss->depend.mod = depmod;
strncpy(miss->depend.name, depname, PKG_NAME_LEN);
if(depversion) {
strncpy(miss->depend.version, depversion, PKG_VERSION_LEN);
} else {
miss->depend.version[0] = 0;
}
STRDUP(miss->target, target, RET_ERR(PM_ERR_MEMORY, NULL));
miss->depend = _alpm_dep_dup(dep);
STRDUP(miss->causingpkg, causingpkg, RET_ERR(PM_ERR_MEMORY, NULL));
return(miss);
}
void _alpm_depmiss_free(pmdepmissing_t *miss)
{
_alpm_dep_free(miss->depend);
FREE(miss->target);
FREE(miss->causingpkg);
FREE(miss);
}
/* Convert a list of pmpkg_t * to a graph structure,
* with a edge for each dependency.
* Returns a list of vertices (one vertex = one package)
* (used by alpm_sortbydeps)
*/
static alpm_list_t *_alpm_graph_init(alpm_list_t *targets)
static alpm_list_t *dep_graph_init(alpm_list_t *targets)
{
alpm_list_t *i, *j, *k;
alpm_list_t *i, *j;
alpm_list_t *vertices = NULL;
/* We create the vertices */
for(i = targets; i; i = i->next) {
@@ -104,12 +91,7 @@ static alpm_list_t *_alpm_graph_init(alpm_list_t *targets)
for(j = vertices; j; j = j->next) {
pmgraph_t *vertex_j = j->data;
pmpkg_t *p_j = vertex_j->data;
int child = 0;
for(k = alpm_pkg_get_depends(p_i); k && !child; k = k->next) {
pmdepend_t *depend = k->data;
child = alpm_depcmp(p_j, depend);
}
if(child) {
if(_alpm_dep_edge(p_i, p_j)) {
vertex_i->children =
alpm_list_add(vertex_i->children, vertex_j);
}
@@ -121,20 +103,19 @@ static alpm_list_t *_alpm_graph_init(alpm_list_t *targets)
/* Re-order a list of target packages with respect to their dependencies.
*
* Example (PM_TRANS_TYPE_ADD):
* Example (reverse == 0):
* A depends on C
* B depends on A
* Target order is A,B,C,D
*
* Should be re-ordered to C,A,B,D
*
* mode should be either PM_TRANS_TYPE_ADD or PM_TRANS_TYPE_REMOVE. This
* affects the dependency order sortbydeps() will use.
* if reverse is > 0, the dependency order will be reversed.
*
* This function returns the new alpm_list_t* target list.
*
*/
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode)
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int reverse)
{
alpm_list_t *newtargs = NULL;
alpm_list_t *vertices = NULL;
@@ -149,7 +130,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode)
_alpm_log(PM_LOG_DEBUG, "started sorting dependencies\n");
vertices = _alpm_graph_init(targets);
vertices = dep_graph_init(targets);
vptr = vertices;
vertex = vertices->data;
@@ -169,7 +150,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode)
pmpkg_t *vertexpkg = vertex->data;
pmpkg_t *childpkg = nextchild->data;
_alpm_log(PM_LOG_WARNING, _("dependency cycle detected:\n"));
if(mode == PM_TRANS_TYPE_REMOVE) {
if(reverse) {
_alpm_log(PM_LOG_WARNING, _("%s will be removed after its %s dependency\n"), vertexpkg->name, childpkg->name);
} else {
_alpm_log(PM_LOG_WARNING, _("%s will be installed before its %s dependency\n"), vertexpkg->name, childpkg->name);
@@ -194,8 +175,8 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode)
_alpm_log(PM_LOG_DEBUG, "sorting dependencies finished\n");
if(mode == PM_TRANS_TYPE_REMOVE) {
/* we're removing packages, so reverse the order */
if(reverse) {
/* reverse the order */
alpm_list_t *tmptargs = alpm_list_reverse(newtargs);
/* free the old one */
alpm_list_free(newtargs);
@@ -208,10 +189,42 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode)
return(newtargs);
}
/* Little helper function for alpm_list_find */
static int satisfycmp(const void *pkg, const void *depend)
pmpkg_t *_alpm_find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep)
{
return(!alpm_depcmp((pmpkg_t*) pkg, (pmdepend_t*) depend));
alpm_list_t *i;
for(i = pkgs; i; i = alpm_list_next(i)) {
pmpkg_t *pkg = i->data;
if(alpm_depcmp(pkg, dep)) {
return(pkg);
}
}
return(NULL);
}
/** Checks dependencies and returns missing ones in a list.
* Dependencies can include versions with depmod operators.
* @param db pointer to the local package database
* @param targets an alpm_list_t* of dependencies strings to satisfy
* @return an alpm_list_t* of missing dependencies strings
*/
alpm_list_t SYMEXPORT *alpm_deptest(pmdb_t *db, alpm_list_t *targets)
{
alpm_list_t *i, *ret = NULL;
for(i = targets; i; i = alpm_list_next(i)) {
pmdepend_t *dep;
char *target;
target = alpm_list_getdata(i);
dep = _alpm_splitdep(target);
if(!_alpm_find_dep_satisfier(_alpm_db_get_pkgcache(db), dep)) {
ret = alpm_list_add(ret, target);
}
_alpm_dep_free(dep);
}
return(ret);
}
/** Checks dependencies and returns missing ones in a list.
@@ -257,15 +270,14 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps,
pmdepend_t *depend = j->data;
/* 1. we check the upgrade list */
/* 2. we check database for untouched satisfying packages */
if(!alpm_list_find(upgrade, depend, satisfycmp) &&
!alpm_list_find(dblist, depend, satisfycmp)) {
if(!_alpm_find_dep_satisfier(upgrade, depend) &&
!_alpm_find_dep_satisfier(dblist, depend)) {
/* Unsatisfied dependency in the upgrade list */
char *missdepstring = alpm_dep_get_string(depend);
_alpm_log(PM_LOG_DEBUG, "checkdeps: missing dependency '%s' for package '%s'\n",
missdepstring, alpm_pkg_get_name(tp));
free(missdepstring);
miss = _alpm_depmiss_new(alpm_pkg_get_name(tp), depend->mod,
depend->name, depend->version);
miss = _alpm_depmiss_new(alpm_pkg_get_name(tp), depend, NULL);
baddeps = alpm_list_add(baddeps, miss);
}
}
@@ -278,18 +290,18 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps,
pmpkg_t *lp = i->data;
for(j = alpm_pkg_get_depends(lp); j; j = j->next) {
pmdepend_t *depend = j->data;
pmpkg_t *causingpkg = _alpm_find_dep_satisfier(modified, depend);
/* we won't break this depend, if it is already broken, we ignore it */
/* 1. check upgrade list for satisfiers */
/* 2. check dblist for satisfiers */
if(alpm_list_find(modified, depend, satisfycmp) &&
!alpm_list_find(upgrade, depend, satisfycmp) &&
!alpm_list_find(dblist, depend, satisfycmp)) {
if(causingpkg &&
!_alpm_find_dep_satisfier(upgrade, depend) &&
!_alpm_find_dep_satisfier(dblist, depend)) {
char *missdepstring = alpm_dep_get_string(depend);
_alpm_log(PM_LOG_DEBUG, "checkdeps: transaction would break '%s' dependency of '%s'\n",
missdepstring, alpm_pkg_get_name(lp));
free(missdepstring);
miss = _alpm_depmiss_new(lp->name, depend->mod,
depend->name, depend->version);
miss = _alpm_depmiss_new(lp->name, depend, alpm_pkg_get_name(causingpkg));
baddeps = alpm_list_add(baddeps, miss);
}
}
@@ -309,7 +321,7 @@ static int dep_vercmp(const char *version1, pmdepmod_t mod,
if(mod == PM_DEP_MOD_ANY) {
equal = 1;
} else {
int cmp = _alpm_versioncmp(version1, version2);
int cmp = alpm_pkg_vercmp(version1, version2);
switch(mod) {
case PM_DEP_MOD_EQ: equal = (cmp == 0); break;
case PM_DEP_MOD_GE: equal = (cmp >= 0); break;
@@ -356,7 +368,7 @@ int SYMEXPORT alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
return(satisfy);
}
pmdepend_t SYMEXPORT *alpm_splitdep(const char *depstring)
pmdepend_t *_alpm_splitdep(const char *depstring)
{
pmdepend_t *depend;
char *ptr = NULL;
@@ -365,9 +377,9 @@ pmdepend_t SYMEXPORT *alpm_splitdep(const char *depstring)
if(depstring == NULL) {
return(NULL);
}
newstr = strdup(depstring);
STRDUP(newstr, depstring, RET_ERR(PM_ERR_MEMORY, NULL));
MALLOC(depend, sizeof(pmdepend_t), return(NULL));
CALLOC(depend, 1, sizeof(pmdepend_t), RET_ERR(PM_ERR_MEMORY, NULL));
/* Find a version comparator if one exists. If it does, set the type and
* increment the ptr accordingly so we can copy the right strings. */
@@ -391,25 +403,36 @@ pmdepend_t SYMEXPORT *alpm_splitdep(const char *depstring)
depend->mod = PM_DEP_MOD_GT;
*ptr = '\0';
ptr += 1;
} else {
/* no version specified - copy in the name and return it */
/* no version specified - copy the name and return it */
depend->mod = PM_DEP_MOD_ANY;
strncpy(depend->name, newstr, PKG_NAME_LEN);
depend->version[0] = '\0';
STRDUP(depend->name, newstr, RET_ERR(PM_ERR_MEMORY, NULL));
depend->version = NULL;
free(newstr);
return(depend);
}
/* if we get here, we have a version comparator, copy the right parts
* to the right places */
strncpy(depend->name, newstr, PKG_NAME_LEN);
strncpy(depend->version, ptr, PKG_VERSION_LEN);
STRDUP(depend->name, newstr, RET_ERR(PM_ERR_MEMORY, NULL));
STRDUP(depend->version, ptr, RET_ERR(PM_ERR_MEMORY, NULL));
free(newstr);
return(depend);
}
pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep)
{
pmdepend_t *newdep;
CALLOC(newdep, 1, sizeof(pmdepend_t), RET_ERR(PM_ERR_MEMORY, NULL));
STRDUP(newdep->name, dep->name, RET_ERR(PM_ERR_MEMORY, NULL));
STRDUP(newdep->version, dep->version, RET_ERR(PM_ERR_MEMORY, NULL));
newdep->mod = dep->mod;
return(newdep);
}
/* These parameters are messy. We check if this package, given a list of
* targets and a db is safe to remove. We do NOT remove it if it is in the
* target list, or if if the package was explictly installed and
@@ -417,9 +440,9 @@ pmdepend_t SYMEXPORT *alpm_splitdep(const char *depstring)
static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets,
int include_explicit)
{
alpm_list_t *i, *requiredby;
alpm_list_t *i;
if(_alpm_pkg_find(alpm_pkg_get_name(pkg), targets)) {
if(_alpm_pkg_find(targets, alpm_pkg_get_name(pkg))) {
return(0);
}
@@ -439,15 +462,12 @@ static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets,
* if checkdeps detected it would break something */
/* see if other packages need it */
requiredby = alpm_pkg_compute_requiredby(pkg);
for(i = requiredby; i; i = i->next) {
pmpkg_t *reqpkg = _alpm_db_get_pkgfromcache(db, i->data);
if(reqpkg && !_alpm_pkg_find(alpm_pkg_get_name(reqpkg), targets)) {
FREELIST(requiredby);
for(i = _alpm_db_get_pkgcache(db); i; i = i->next) {
pmpkg_t *lpkg = i->data;
if(_alpm_dep_edge(lpkg, pkg) && !_alpm_pkg_find(targets, lpkg->name)) {
return(0);
}
}
FREELIST(requiredby);
/* it's ok to remove */
return(1);
@@ -465,7 +485,7 @@ static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets,
*/
void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit)
{
alpm_list_t *i, *j, *k;
alpm_list_t *i, *j;
ALPM_LOG_FUNC;
@@ -475,149 +495,133 @@ void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit)
for(i = targs; i; i = i->next) {
pmpkg_t *pkg = i->data;
for(j = alpm_pkg_get_depends(pkg); j; j = j->next) {
pmdepend_t *depend = j->data;
for(k = _alpm_db_get_pkgcache(db); k; k = k->next) {
pmpkg_t *deppkg = k->data;
if(alpm_depcmp(deppkg,depend)
&& can_remove_package(db, deppkg, targs, include_explicit)) {
_alpm_log(PM_LOG_DEBUG, "adding '%s' to the targets\n",
alpm_pkg_get_name(deppkg));
/* add it to the target list */
targs = alpm_list_add(targs, _alpm_pkg_dup(deppkg));
}
for(j = _alpm_db_get_pkgcache(db); j; j = j->next) {
pmpkg_t *deppkg = j->data;
if(_alpm_dep_edge(pkg, deppkg)
&& can_remove_package(db, deppkg, targs, include_explicit)) {
_alpm_log(PM_LOG_DEBUG, "adding '%s' to the targets\n",
alpm_pkg_get_name(deppkg));
/* add it to the target list */
targs = alpm_list_add(targs, _alpm_pkg_dup(deppkg));
}
}
}
}
/* populates *list with packages that need to be installed to satisfy all
* dependencies (recursive) for syncpkg
/* helper function for resolvedeps: search for dep satisfier in dbs */
pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *excluding, pmpkg_t *tpkg)
{
alpm_list_t *i, *j;
/* 1. literals */
for(i = dbs; i; i = i->next) {
pmpkg_t *pkg = _alpm_db_get_pkgfromcache(i->data, dep->name);
if(pkg && alpm_depcmp(pkg, dep) && !_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(pkg)) {
int install;
QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg,
tpkg, NULL, &install);
if(!install) {
continue;
}
}
return(pkg);
}
}
/* 2. satisfiers (skip literals here) */
for(i = dbs; i; i = i->next) {
for(j = _alpm_db_get_pkgcache(i->data); j; j = j->next) {
pmpkg_t *pkg = j->data;
if(alpm_depcmp(pkg, dep) && strcmp(pkg->name, dep->name) &&
!_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(pkg)) {
int install;
QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg,
tpkg, NULL, &install);
if(!install) {
continue;
}
}
_alpm_log(PM_LOG_WARNING, _("provider package was selected (%s provides %s)\n"),
pkg->name, dep->name);
return(pkg);
}
}
}
return(NULL);
}
/* populates list with packages that need to be installed to satisfy all
* dependencies of packages in list
*
* @param remove contains packages elected for removal
* make sure **list is already initialized
*/
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
alpm_list_t **list, alpm_list_t *remove, pmtrans_t *trans, alpm_list_t **data)
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, alpm_list_t *list,
alpm_list_t *remove, alpm_list_t **data)
{
alpm_list_t *i, *j, *k;
alpm_list_t *i, *j;
alpm_list_t *targ;
alpm_list_t *deps = NULL;
ALPM_LOG_FUNC;
if(local == NULL || dbs_sync == NULL || syncpkg == NULL || list == NULL) {
if(local == NULL || dbs_sync == NULL) {
return(-1);
}
_alpm_log(PM_LOG_DEBUG, "started resolving dependencies\n");
targ = alpm_list_add(NULL, syncpkg);
deps = alpm_checkdeps(local, 0, remove, targ);
alpm_list_free(targ);
if(deps == NULL) {
return(0);
}
for(i = deps; i; i = i->next) {
int found = 0;
pmdepmissing_t *miss = i->data;
pmdepend_t *missdep = &(miss->depend);
pmpkg_t *sync = NULL;
/* check if one of the packages in *list already satisfies this dependency */
for(j = *list; j && !found; j = j->next) {
pmpkg_t *sp = j->data;
if(alpm_depcmp(sp, missdep)) {
for(i = list; i; i = i->next) {
pmpkg_t *tpkg = i->data;
targ = alpm_list_add(NULL, tpkg);
deps = alpm_checkdeps(local, 0, remove, targ);
alpm_list_free(targ);
for(j = deps; j; j = j->next) {
pmdepmissing_t *miss = j->data;
pmdepend_t *missdep = alpm_miss_get_dep(miss);
/* check if one of the packages in list already satisfies this dependency */
if(_alpm_find_dep_satisfier(list, missdep)) {
continue;
}
/* find a satisfier package in the given repositories */
pmpkg_t *spkg = _alpm_resolvedep(missdep, dbs_sync, list, tpkg);
if(!spkg) {
pm_errno = PM_ERR_UNSATISFIED_DEPS;
char *missdepstring = alpm_dep_get_string(missdep);
_alpm_log(PM_LOG_DEBUG, "%s satisfies dependency %s -- skipping\n",
alpm_pkg_get_name(sp), missdepstring);
_alpm_log(PM_LOG_ERROR, _("cannot resolve \"%s\", a dependency of \"%s\"\n"),
missdepstring, tpkg->name);
free(missdepstring);
found = 1;
if(data) {
pmdepmissing_t *missd = _alpm_depmiss_new(miss->target,
miss->depend, miss->causingpkg);
if(missd) {
*data = alpm_list_add(*data, missd);
}
}
alpm_list_free_inner(deps, (alpm_list_fn_free)_alpm_depmiss_free);
alpm_list_free(deps);
return(-1);
} else {
_alpm_log(PM_LOG_DEBUG, "pulling dependency %s (needed by %s)\n",
alpm_pkg_get_name(spkg), alpm_pkg_get_name(tpkg));
list = alpm_list_add(list, spkg);
}
}
if(found) {
continue;
}
alpm_list_free_inner(deps, (alpm_list_fn_free)_alpm_depmiss_free);
alpm_list_free(deps);
}
_alpm_log(PM_LOG_DEBUG, "finished resolving dependencies\n");
return(0);
}
/* find the package in one of the repositories */
/* check literals */
for(j = dbs_sync; j && !found; j = j->next) {
sync = _alpm_db_get_pkgfromcache(j->data, missdep->name);
if(!sync) {
continue;
}
found = alpm_depcmp(sync, missdep) && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove);
if(!found) {
continue;
}
/* If package is in the ignorepkg list, ask before we pull it */
if(_alpm_pkg_should_ignore(sync)) {
pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &found);
_alpm_pkg_free(dummypkg);
}
}
/*TODO this autoresolves the first 'satisfier' package... we should fix this
* somehow */
/* check provides */
/* we don't check literals again to avoid duplicated PM_TRANS_CONV_INSTALL_IGNOREPKG messages */
for(j = dbs_sync; j && !found; j = j->next) {
for(k = _alpm_db_get_pkgcache(j->data); k && !found; k = k->next) {
sync = k->data;
if(!sync) {
continue;
}
found = alpm_depcmp(sync, missdep) && strcmp(sync->name, missdep->name)
&& !_alpm_pkg_find(alpm_pkg_get_name(sync), remove);
if(!found) {
continue;
}
if(_alpm_pkg_should_ignore(sync)) {
pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &found);
_alpm_pkg_free(dummypkg);
}
}
}
if(!found) {
char *missdepstring = alpm_dep_get_string(missdep);
_alpm_log(PM_LOG_ERROR, _("cannot resolve \"%s\", a dependency of \"%s\"\n"),
missdepstring, miss->target);
free(missdepstring);
if(data) {
MALLOC(miss, sizeof(pmdepmissing_t),/*nothing*/);
if(!miss) {
pm_errno = PM_ERR_MEMORY;
FREELIST(*data);
goto error;
}
*miss = *(pmdepmissing_t *)i->data;
*data = alpm_list_add(*data, miss);
}
pm_errno = PM_ERR_UNSATISFIED_DEPS;
goto error;
} else {
_alpm_log(PM_LOG_DEBUG, "pulling dependency %s (needed by %s)\n",
alpm_pkg_get_name(sync), alpm_pkg_get_name(syncpkg));
*list = alpm_list_add(*list, sync);
if(_alpm_resolvedeps(local, dbs_sync, sync, list, remove, trans, data)) {
goto error;
}
/* Does pkg1 depend on pkg2, ie. does pkg2 satisfy a dependency of pkg1? */
int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2)
{
alpm_list_t *i;
for(i = alpm_pkg_get_depends(pkg1); i; i = i->next) {
if(alpm_depcmp(pkg2, i->data)) {
return(1);
}
}
_alpm_log(PM_LOG_DEBUG, "finished resolving dependencies\n");
FREELIST(deps);
return(0);
error:
FREELIST(deps);
return(-1);
}
const char SYMEXPORT *alpm_miss_get_target(const pmdepmissing_t *miss)
@@ -627,7 +631,17 @@ const char SYMEXPORT *alpm_miss_get_target(const pmdepmissing_t *miss)
/* Sanity checks */
ASSERT(miss != NULL, return(NULL));
return miss->target;
return(miss->target);
}
const char SYMEXPORT *alpm_miss_get_causingpkg(const pmdepmissing_t *miss)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(miss != NULL, return(NULL));
return miss->causingpkg;
}
pmdepend_t SYMEXPORT *alpm_miss_get_dep(pmdepmissing_t *miss)
@@ -637,7 +651,7 @@ pmdepend_t SYMEXPORT *alpm_miss_get_dep(pmdepmissing_t *miss)
/* Sanity checks */
ASSERT(miss != NULL, return(NULL));
return &(miss->depend);
return(miss->depend);
}
pmdepmod_t SYMEXPORT alpm_dep_get_mod(const pmdepend_t *dep)
@@ -647,7 +661,7 @@ pmdepmod_t SYMEXPORT alpm_dep_get_mod(const pmdepend_t *dep)
/* Sanity checks */
ASSERT(dep != NULL, return(-1));
return dep->mod;
return(dep->mod);
}
const char SYMEXPORT *alpm_dep_get_name(const pmdepend_t *dep)
@@ -657,7 +671,7 @@ const char SYMEXPORT *alpm_dep_get_name(const pmdepend_t *dep)
/* Sanity checks */
ASSERT(dep != NULL, return(NULL));
return dep->name;
return(dep->name);
}
const char SYMEXPORT *alpm_dep_get_version(const pmdepend_t *dep)
@@ -667,7 +681,7 @@ const char SYMEXPORT *alpm_dep_get_version(const pmdepend_t *dep)
/* Sanity checks */
ASSERT(dep != NULL, return(NULL));
return dep->version;
return(dep->version);
}
/** Reverse of splitdep; make a dep string from a pmdepend_t struct.
@@ -677,7 +691,7 @@ const char SYMEXPORT *alpm_dep_get_version(const pmdepend_t *dep)
*/
char SYMEXPORT *alpm_dep_get_string(const pmdepend_t *dep)
{
char *opr, *str = NULL;
char *name, *opr, *ver, *str = NULL;
size_t len;
ALPM_LOG_FUNC;
@@ -685,6 +699,12 @@ char SYMEXPORT *alpm_dep_get_string(const pmdepend_t *dep)
/* Sanity checks */
ASSERT(dep != NULL, return(NULL));
if(dep->name) {
name = dep->name;
} else {
name = "";
}
switch(dep->mod) {
case PM_DEP_MOD_ANY:
opr = "";
@@ -709,11 +729,18 @@ char SYMEXPORT *alpm_dep_get_string(const pmdepend_t *dep)
break;
}
if(dep->version) {
ver = dep->version;
} else {
ver = "";
}
/* we can always compute len and print the string like this because opr
* and ver will be empty when PM_DEP_MOD_ANY is the depend type */
len = strlen(dep->name) + strlen(opr) + strlen(dep->version) + 1;
* and ver will be empty when PM_DEP_MOD_ANY is the depend type. the
* reassignments above also ensure we do not do a strlen(NULL). */
len = strlen(name) + strlen(opr) + strlen(ver) + 1;
MALLOC(str, len, RET_ERR(PM_ERR_MEMORY, NULL));
snprintf(str, len, "%s%s%s", dep->name, opr, dep->version);
snprintf(str, len, "%s%s%s", name, opr, ver);
return(str);
}

View File

@@ -29,31 +29,30 @@
/* Dependency */
struct __pmdepend_t {
pmdepmod_t mod;
char name[PKG_NAME_LEN];
char version[PKG_VERSION_LEN];
char *name;
char *version;
};
/* Missing dependency */
struct __pmdepmissing_t {
char target[PKG_NAME_LEN];
pmdepend_t depend;
char *target;
pmdepend_t *depend;
char *causingpkg; /* this is used in case of remove dependency error only */
};
/* Graphs */
struct __pmgraph_t {
int state; /* 0: untouched, -1: entered, other: leaving time */
void *data;
struct __pmgraph_t *parent; /* where did we come from? */
alpm_list_t *children;
alpm_list_t *childptr; /* points to a child in children list */
};
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepmod_t depmod,
const char *depname, const char *depversion);
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode);
void _alpm_dep_free(pmdepend_t *dep);
pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep);
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepend_t *dep,
const char *causinpkg);
void _alpm_depmiss_free(pmdepmissing_t *miss);
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int reverse);
void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit);
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
alpm_list_t **list, alpm_list_t *remove, pmtrans_t *trans, alpm_list_t **data);
pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *excluding, pmpkg_t *tpkg);
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, alpm_list_t *list,
alpm_list_t *remove, alpm_list_t **data);
int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2);
pmdepend_t *_alpm_splitdep(const char *depstring);
pmpkg_t *_alpm_find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep);
#endif /* _ALPM_DEPS_H */

449
lib/libalpm/dload.c Normal file
View File

@@ -0,0 +1,449 @@
/*
* download.c
*
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
/* the following two are needed on BSD for libfetch */
#if defined(HAVE_SYS_SYSLIMITS_H)
#include <sys/syslimits.h> /* PATH_MAX */
#endif
#if defined(HAVE_SYS_PARAM_H)
#include <sys/param.h> /* MAXHOSTNAMELEN */
#endif
#if defined(HAVE_LIBDOWNLOAD)
#include <download.h>
#elif defined(HAVE_LIBFETCH)
#include <fetch.h>
#define downloadFreeURL fetchFreeURL
#define downloadLastErrCode fetchLastErrCode
#define downloadLastErrString fetchLastErrString
#define downloadParseURL fetchParseURL
#define downloadTimeout fetchTimeout
#define downloadXGet fetchXGet
#endif
/* libalpm */
#include "dload.h"
#include "alpm_list.h"
#include "alpm.h"
#include "log.h"
#include "util.h"
#include "handle.h"
static char *get_filename(const char *url) {
char *filename = strrchr(url, '/');
if(filename != NULL) {
filename++;
}
return(filename);
}
static char *get_destfile(const char *path, const char *filename) {
char *destfile;
/* len = localpath len + filename len + null */
int len = strlen(path) + strlen(filename) + 1;
CALLOC(destfile, len, sizeof(char), RET_ERR(PM_ERR_MEMORY, NULL));
snprintf(destfile, len, "%s%s", path, filename);
return(destfile);
}
static char *get_tempfile(const char *path, const char *filename) {
char *tempfile;
/* len = localpath len + filename len + '.part' len + null */
int len = strlen(path) + strlen(filename) + 6;
CALLOC(tempfile, len, sizeof(char), RET_ERR(PM_ERR_MEMORY, NULL));
snprintf(tempfile, len, "%s%s.part", path, filename);
return(tempfile);
}
#if defined(INTERNAL_DOWNLOAD)
/* Build a 'struct url' from an url. */
static struct url *url_for_string(const char *url)
{
struct url *ret = NULL;
ret = downloadParseURL(url);
if(!ret) {
_alpm_log(PM_LOG_ERROR, _("url '%s' is invalid\n"), url);
RET_ERR(PM_ERR_SERVER_BAD_URL, NULL);
}
/* if no URL scheme specified, assume HTTP */
if(strlen(ret->scheme) == 0) {
_alpm_log(PM_LOG_WARNING, _("url scheme not specified, assuming HTTP\n"));
strcpy(ret->scheme, SCHEME_HTTP);
}
/* add a user & password for anonymous FTP */
if(strcmp(ret->scheme,SCHEME_FTP) == 0 && strlen(ret->user) == 0) {
strcpy(ret->user, "anonymous");
strcpy(ret->pwd, "libalpm@guest");
}
return(ret);
}
static int download_internal(const char *url, const char *localpath,
time_t mtimeold, time_t *mtimenew) {
FILE *dlf, *localf = NULL;
struct url_stat ust;
struct stat st;
int chk_resume = 0;
size_t dl_thisfile = 0;
char *tempfile, *destfile, *filename;
int ret = 0;
struct url *fileurl = url_for_string(url);
if(!fileurl) {
return(-1);
}
filename = get_filename(url);
if(!filename) {
return(-1);
}
destfile = get_destfile(localpath, filename);
tempfile = get_tempfile(localpath, filename);
/* pass the raw filename for passing to the callback function */
_alpm_log(PM_LOG_DEBUG, "using '%s' for download progress\n", filename);
if(stat(tempfile, &st) == 0 && st.st_size > 0) {
_alpm_log(PM_LOG_DEBUG, "existing file found, using it\n");
fileurl->offset = (off_t)st.st_size;
dl_thisfile = st.st_size;
localf = fopen(tempfile, "ab");
chk_resume = 1;
} else {
fileurl->offset = (off_t)0;
dl_thisfile = 0;
}
/* libdownload does not reset the error code, reset it in
* the case of previous errors */
downloadLastErrCode = 0;
/* 10s timeout - TODO make a config option */
downloadTimeout = 10000;
dlf = downloadXGet(fileurl, &ust, (handle->nopassiveftp ? "" : "p"));
if(downloadLastErrCode != 0 || dlf == NULL) {
const char *host = _("disk");
if(strcmp(SCHEME_FILE, fileurl->scheme) != 0) {
host = fileurl->host;
}
pm_errno = PM_ERR_LIBDOWNLOAD;
_alpm_log(PM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"),
filename, host, downloadLastErrString);
ret = -1;
goto cleanup;
} else {
_alpm_log(PM_LOG_DEBUG, "connected to %s successfully\n", fileurl->host);
}
if(ust.mtime && mtimeold && ust.mtime == mtimeold) {
_alpm_log(PM_LOG_DEBUG, "mtimes are identical, skipping %s\n", filename);
ret = 1;
goto cleanup;
}
if(ust.mtime && mtimenew) {
*mtimenew = ust.mtime;
}
if(chk_resume && fileurl->offset == 0) {
_alpm_log(PM_LOG_WARNING, _("cannot resume download, starting over\n"));
if(localf != NULL) {
fclose(localf);
localf = NULL;
}
}
if(localf == NULL) {
_alpm_rmrf(tempfile);
fileurl->offset = (off_t)0;
dl_thisfile = 0;
localf = fopen(tempfile, "wb");
if(localf == NULL) { /* still null? */
_alpm_log(PM_LOG_ERROR, _("cannot write to file '%s'\n"), tempfile);
ret = -1;
goto cleanup;
}
}
/* Progress 0 - initialize */
if(handle->dlcb) {
handle->dlcb(filename, 0, ust.size);
}
size_t nread = 0;
char buffer[PM_DLBUF_LEN];
while((nread = fread(buffer, 1, PM_DLBUF_LEN, dlf)) > 0) {
if(ferror(dlf)) {
pm_errno = PM_ERR_LIBDOWNLOAD;
_alpm_log(PM_LOG_ERROR, _("error downloading '%s': %s\n"),
filename, downloadLastErrString);
ret = -1;
goto cleanup;
}
size_t nwritten = 0;
while(nwritten < nread) {
nwritten += fwrite(buffer, 1, (nread - nwritten), localf);
if(ferror(localf)) {
_alpm_log(PM_LOG_ERROR, _("error writing to file '%s': %s\n"),
destfile, strerror(errno));
ret = -1;
goto cleanup;
}
}
dl_thisfile += nread;
if(handle->dlcb) {
handle->dlcb(filename, dl_thisfile, ust.size);
}
}
/* probably safer to close the file descriptors now before renaming the file,
* for example to make sure the buffers are flushed.
*/
fclose(localf);
localf = NULL;
fclose(dlf);
dlf = NULL;
rename(tempfile, destfile);
ret = 0;
cleanup:
FREE(tempfile);
FREE(destfile);
if(localf != NULL) {
fclose(localf);
}
if(dlf != NULL) {
fclose(dlf);
}
downloadFreeURL(fileurl);
return(ret);
}
#endif
static int download_external(const char *url, const char *localpath,
time_t mtimeold, time_t *mtimenew) {
int ret = 0;
int retval;
int usepart = 0;
char *ptr1, *ptr2;
char origCmd[PATH_MAX];
char parsedCmd[PATH_MAX] = "";
char cwd[PATH_MAX];
char *destfile, *tempfile, *filename;
if(!handle->xfercommand) {
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
}
filename = get_filename(url);
if(!filename) {
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
}
destfile = get_destfile(localpath, filename);
tempfile = get_tempfile(localpath, filename);
/* replace all occurrences of %o with fn.part */
strncpy(origCmd, handle->xfercommand, sizeof(origCmd));
ptr1 = origCmd;
while((ptr2 = strstr(ptr1, "%o"))) {
usepart = 1;
ptr2[0] = '\0';
strcat(parsedCmd, ptr1);
strcat(parsedCmd, tempfile);
ptr1 = ptr2 + 2;
}
strcat(parsedCmd, ptr1);
/* replace all occurrences of %u with the download URL */
strncpy(origCmd, parsedCmd, sizeof(origCmd));
parsedCmd[0] = '\0';
ptr1 = origCmd;
while((ptr2 = strstr(ptr1, "%u"))) {
ptr2[0] = '\0';
strcat(parsedCmd, ptr1);
strcat(parsedCmd, url);
ptr1 = ptr2 + 2;
}
strcat(parsedCmd, ptr1);
/* cwd to the download directory */
getcwd(cwd, PATH_MAX);
if(chdir(localpath)) {
_alpm_log(PM_LOG_WARNING, _("could not chdir to %s\n"), localpath);
pm_errno = PM_ERR_EXTERNAL_DOWNLOAD;
ret = -1;
goto cleanup;
}
/* execute the parsed command via /bin/sh -c */
_alpm_log(PM_LOG_DEBUG, "running command: %s\n", parsedCmd);
retval = system(parsedCmd);
if(retval == -1) {
_alpm_log(PM_LOG_WARNING, _("running XferCommand: fork failed!\n"));
pm_errno = PM_ERR_EXTERNAL_DOWNLOAD;
ret = -1;
} else if(retval != 0) {
/* download failed */
_alpm_log(PM_LOG_DEBUG, "XferCommand command returned non-zero status "
"code (%d)\n", retval);
ret = -1;
} else {
/* download was successful */
if(usepart) {
rename(tempfile, destfile);
}
ret = 0;
}
cleanup:
chdir(cwd);
if(ret == -1) {
/* hack to let an user the time to cancel a download */
sleep(2);
}
FREE(destfile);
FREE(tempfile);
return(ret);
}
static int download(const char *url, const char *localpath,
time_t mtimeold, time_t *mtimenew) {
int ret;
/* We have a few things to take into account here.
* 1. If we have both internal/external available, choose based on
* whether xfercommand is populated.
* 2. If we only have external available, we should first check
* if a command was provided before we drop into download_external.
*/
if(handle->xfercommand == NULL) {
#if defined(INTERNAL_DOWNLOAD)
ret = download_internal(url, localpath, mtimeold, mtimenew);
#else
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
#endif
} else {
ret = download_external(url, localpath, mtimeold, mtimenew);
}
return(ret);
}
/*
* Download a single file
* - if mtimeold is non-NULL, then only download the file if it's different
* than mtimeold.
* - if *mtimenew is non-NULL, it will be filled with the mtime of the remote
* file.
* - servers must be a list of urls WITHOUT trailing slashes.
*
* RETURN: 0 for successful download
* 1 if the mtimes are identical
* -1 on error
*/
int _alpm_download_single_file(const char *filename,
alpm_list_t *servers, const char *localpath,
time_t mtimeold, time_t *mtimenew)
{
alpm_list_t *i;
int ret = -1;
for(i = servers; i; i = i->next) {
const char *server = i->data;
char *fileurl = NULL;
int len;
/* print server + filename into a buffer */
len = strlen(server) + strlen(filename) + 2;
CALLOC(fileurl, len, sizeof(char), RET_ERR(PM_ERR_MEMORY, -1));
snprintf(fileurl, len, "%s/%s", server, filename);
ret = download(fileurl, localpath, mtimeold, mtimenew);
FREE(fileurl);
if(ret != -1) {
break;
}
}
return(ret);
}
int _alpm_download_files(alpm_list_t *files,
alpm_list_t *servers, const char *localpath)
{
int ret = 0;
alpm_list_t *lp;
for(lp = files; lp; lp = lp->next) {
char *filename = lp->data;
if(_alpm_download_single_file(filename, servers,
localpath, 0, NULL) == -1) {
ret++;
}
}
return(ret);
}
/** Fetch a remote pkg.
* @param url URL of the package to download
* @return the downloaded filepath on success, NULL on error
* @addtogroup alpm_misc
*/
char SYMEXPORT *alpm_fetch_pkgurl(const char *url)
{
char *filename, *filepath;
const char *cachedir;
int ret;
ALPM_LOG_FUNC;
filename = get_filename(url);
/* find a valid cache dir to download to */
cachedir = _alpm_filecache_setup();
/* download the file */
ret = download(url, cachedir, 0, NULL);
if(ret == -1) {
_alpm_log(PM_LOG_WARNING, _("failed to download %s\n"), url);
return(NULL);
}
_alpm_log(PM_LOG_DEBUG, "successfully downloaded %s\n", url);
/* we should be able to find the file the second time around */
filepath = _alpm_filecache_find(filename);
return(filepath);
}
/* vim: set ts=2 sw=2 noet: */

View File

@@ -1,7 +1,7 @@
/*
* error.h
* dload.h
*
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,13 +16,23 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ALPM_ERROR_H
#define _ALPM_ERROR_H
#ifndef _ALPM_DLOAD_H
#define _ALPM_DLOAD_H
#define RET_ERR(err, ret) do { pm_errno = (err); \
_alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerrorlast()); \
return(ret); } while(0)
#include "alpm_list.h"
#include "alpm.h"
#endif /* _ALPM_ERROR_H */
#include <time.h>
#define PM_DLBUF_LEN (1024 * 10)
int _alpm_download_single_file(const char *filename,
alpm_list_t *servers, const char *localpath,
time_t mtimeold, time_t *mtimenew);
int _alpm_download_files(alpm_list_t *files,
alpm_list_t *servers, const char *localpath);
#endif /* _ALPM_DLOAD_H */
/* vim: set ts=2 sw=2 noet: */

View File

@@ -1,10 +1,7 @@
/*
* error.c
*
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,12 +19,28 @@
#include "config.h"
/* TODO: needed for the libfetch stuff, unfortunately- we should kill it */
#include <stdio.h>
#include <limits.h>
/* the following two are needed on BSD for libfetch */
#if defined(HAVE_SYS_SYSLIMITS_H)
#include <sys/syslimits.h> /* PATH_MAX */
#endif
#if defined(HAVE_SYS_PARAM_H)
#include <sys/param.h> /* MAXHOSTNAMELEN */
#endif
#if defined(HAVE_LIBDOWNLOAD)
#include <download.h> /* downloadLastErrString */
#elif defined(HAVE_LIBFETCH)
#include <fetch.h> /* fetchLastErrString */
#define downloadLastErrString fetchLastErrString
#endif
/* libalpm */
#include "error.h"
#include "util.h"
#include "alpm.h"
/* TODO does this really need a file all on its own? */
const char SYMEXPORT *alpm_strerrorlast(void)
{
return alpm_strerror(pm_errno);
@@ -74,13 +87,6 @@ const char SYMEXPORT *alpm_strerror(int err)
/* Servers */
case PM_ERR_SERVER_BAD_URL:
return _("invalid url for server");
/* Configuration */
case PM_ERR_OPT_LOGFILE:
case PM_ERR_OPT_DBPATH:
case PM_ERR_OPT_LOCALDB:
case PM_ERR_OPT_SYNCDB:
case PM_ERR_OPT_USESYSLOG:
return _("could not set parameter");
/* Transactions */
case PM_ERR_TRANS_NOT_NULL:
return _("transaction already initialized");
@@ -109,21 +115,17 @@ const char SYMEXPORT *alpm_strerror(int err)
return _("cannot open package file");
case PM_ERR_PKG_LOAD:
return _("cannot load package data");
case PM_ERR_PKG_INSTALLED:
return _("package already installed");
case PM_ERR_PKG_CANT_FRESH:
return _("package not installed or lesser version");
case PM_ERR_PKG_CANT_REMOVE:
return _("cannot remove all files for package");
case PM_ERR_PKG_INVALID_NAME:
return _("package name is not valid");
case PM_ERR_PKG_CORRUPTED:
return _("corrupted package");
return _("package filename is not valid");
case PM_ERR_PKG_REPO_NOT_FOUND:
return _("no such repository");
/* Deltas */
case PM_ERR_DLT_CORRUPTED:
return _("corrupted delta");
case PM_ERR_DLT_INVALID:
return _("invalid or corrupted delta");
case PM_ERR_DLT_PATCHFAILED:
return _("delta patch failed");
/* Groups */
@@ -141,16 +143,26 @@ const char SYMEXPORT *alpm_strerror(int err)
return _("user aborted the operation");
case PM_ERR_INTERNAL_ERROR:
return _("internal error");
case PM_ERR_LIBARCHIVE_ERROR:
return _("libarchive error");
case PM_ERR_PKG_HOLD:
/* TODO wow this is not descriptive at all... what does this mean? */
return _("not confirmed");
case PM_ERR_INVALID_REGEX:
return _("invalid regular expression");
/* Downloading */
case PM_ERR_CONNECT_FAILED:
return _("connection to remote host failed");
/* Errors from external libraries- our own wrapper error */
case PM_ERR_LIBARCHIVE:
/* it would be nice to use archive_error_string() here, but that
* requires the archive struct, so we can't. Just use a generic
* error string instead. */
return _("libarchive error");
case PM_ERR_LIBDOWNLOAD:
#if defined(INTERNAL_DOWNLOAD)
return downloadLastErrString;
#else
/* obviously shouldn't get here... */
return _("download library error");
#endif
case PM_ERR_EXTERNAL_DOWNLOAD:
return _("error invoking external downloader");
/* Unknown error! */
default:
return _("unexpected error");

58
lib/libalpm/graph.h Normal file
View File

@@ -0,0 +1,58 @@
/*
* graph.h - helpful graph structure and setup/teardown methods
*
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sys/types.h> /* off_t */
#include "alpm_list.h"
#include "util.h" /* MALLOC() */
#include "alpm.h"
struct __pmgraph_t {
char state; /* 0: untouched, -1: entered, other: leaving time */
void *data;
off_t weight; /* weight of the node */
struct __pmgraph_t *parent; /* where did we come from? */
alpm_list_t *children;
alpm_list_t *childptr; /* points to a child in children list */
};
typedef struct __pmgraph_t pmgraph_t;
static pmgraph_t *_alpm_graph_new(void)
{
pmgraph_t *graph = NULL;
MALLOC(graph, sizeof(pmgraph_t), RET_ERR(PM_ERR_MEMORY, NULL));
if(graph) {
graph->state = 0;
graph->data = NULL;
graph->parent = NULL;
graph->children = NULL;
graph->childptr = NULL;
}
return(graph);
}
static void _alpm_graph_free(void *data)
{
pmgraph_t *graph = data;
alpm_list_free(graph->children);
free(graph);
}

View File

@@ -27,17 +27,17 @@
#include "group.h"
#include "alpm_list.h"
#include "util.h"
#include "error.h"
#include "log.h"
#include "alpm.h"
pmgrp_t *_alpm_grp_new()
pmgrp_t *_alpm_grp_new(const char *name)
{
pmgrp_t* grp;
ALPM_LOG_FUNC;
CALLOC(grp, 1, sizeof(pmgrp_t), RET_ERR(PM_ERR_MEMORY, NULL));
STRDUP(grp->name, name, RET_ERR(PM_ERR_MEMORY, NULL));
return(grp);
}
@@ -50,20 +50,12 @@ void _alpm_grp_free(pmgrp_t *grp)
return;
}
FREELIST(grp->packages);
FREE(grp->name);
/* do NOT free the contents of the list, just the nodes */
alpm_list_free(grp->packages);
FREE(grp);
}
/* Helper function for sorting groups
*/
int _alpm_grp_cmp(const void *g1, const void *g2)
{
pmgrp_t *grp1 = (pmgrp_t *)g1;
pmgrp_t *grp2 = (pmgrp_t *)g2;
return(strcmp(grp1->name, grp2->name));
}
const char SYMEXPORT *alpm_grp_get_name(const pmgrp_t *grp)
{
ALPM_LOG_FUNC;
@@ -74,7 +66,7 @@ const char SYMEXPORT *alpm_grp_get_name(const pmgrp_t *grp)
return grp->name;
}
const alpm_list_t SYMEXPORT *alpm_grp_get_pkgs(const pmgrp_t *grp)
alpm_list_t SYMEXPORT *alpm_grp_get_pkgs(const pmgrp_t *grp)
{
ALPM_LOG_FUNC;

View File

@@ -19,19 +19,17 @@
#ifndef _ALPM_GROUP_H
#define _ALPM_GROUP_H
/* Groups */
#define GRP_NAME_LEN 256
#include "alpm.h"
struct __pmgrp_t {
char name[GRP_NAME_LEN];
alpm_list_t *packages; /* List of strings */
/** group name */
char *name;
/** list of pmpkg_t packages */
alpm_list_t *packages;
};
pmgrp_t *_alpm_grp_new(void);
pmgrp_t *_alpm_grp_new(const char *name);
void _alpm_grp_free(pmgrp_t *grp);
int _alpm_grp_cmp(const void *g1, const void *g2);
#endif /* _ALPM_GROUP_H */

View File

@@ -23,7 +23,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <sys/types.h>
#include <syslog.h>
@@ -36,10 +35,8 @@
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "error.h"
#include "trans.h"
#include "alpm.h"
#include "server.h"
/* global var for handle (private to libalpm) */
pmhandle_t *handle = NULL;
@@ -55,8 +52,6 @@ pmhandle_t *_alpm_handle_new()
handle->lckfd = -1;
handle->logstream = NULL;
/* see if we're root or not */
handle->uid = geteuid();
handle->root = NULL;
handle->dbpath = NULL;
handle->cachedirs = NULL;
@@ -120,6 +115,15 @@ alpm_cb_download SYMEXPORT alpm_option_get_dlcb()
return handle->dlcb;
}
alpm_cb_totaldl SYMEXPORT alpm_option_get_totaldlcb()
{
if (handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
return handle->totaldlcb;
}
const char SYMEXPORT *alpm_option_get_root()
{
if (handle == NULL) {
@@ -273,6 +277,15 @@ void SYMEXPORT alpm_option_set_dlcb(alpm_cb_download cb)
handle->dlcb = cb;
}
void SYMEXPORT alpm_option_set_totaldlcb(alpm_cb_totaldl cb)
{
if (handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return;
}
handle->totaldlcb = cb;
}
int SYMEXPORT alpm_option_set_root(const char *root)
{
struct stat st;
@@ -386,7 +399,7 @@ void SYMEXPORT alpm_option_set_cachedirs(alpm_list_t *cachedirs)
int SYMEXPORT alpm_option_remove_cachedir(const char *cachedir)
{
void *vdata = NULL;
char *vdata = NULL;
char *newcachedir;
size_t cachedirlen;
/* verify cachedir ends in a '/' */
@@ -397,8 +410,7 @@ int SYMEXPORT alpm_option_remove_cachedir(const char *cachedir)
newcachedir = calloc(cachedirlen + 1, sizeof(char));
strncpy(newcachedir, cachedir, cachedirlen);
newcachedir[cachedirlen-1] = '/';
handle->cachedirs = alpm_list_remove(handle->cachedirs, newcachedir,
_alpm_str_cmp, &vdata);
handle->cachedirs = alpm_list_remove_str(handle->cachedirs, newcachedir, &vdata);
FREE(newcachedir);
if(vdata != NULL) {
FREE(vdata);
@@ -427,6 +439,7 @@ int SYMEXPORT alpm_option_set_logfile(const char *logfile)
}
if(handle->logstream) {
fclose(handle->logstream);
handle->logstream = NULL;
}
_alpm_log(PM_LOG_DEBUG, "option 'logfile' = %s\n", handle->logfile);
return(0);
@@ -450,9 +463,8 @@ void SYMEXPORT alpm_option_set_noupgrades(alpm_list_t *noupgrade)
int SYMEXPORT alpm_option_remove_noupgrade(const char *pkg)
{
void *vdata = NULL;
handle->noupgrade = alpm_list_remove(handle->noupgrade, pkg,
_alpm_str_cmp, &vdata);
char *vdata = NULL;
handle->noupgrade = alpm_list_remove_str(handle->noupgrade, pkg, &vdata);
if(vdata != NULL) {
FREE(vdata);
return(1);
@@ -473,9 +485,8 @@ void SYMEXPORT alpm_option_set_noextracts(alpm_list_t *noextract)
int SYMEXPORT alpm_option_remove_noextract(const char *pkg)
{
void *vdata = NULL;
handle->noextract = alpm_list_remove(handle->noextract, pkg,
_alpm_str_cmp, &vdata);
char *vdata = NULL;
handle->noextract = alpm_list_remove_str(handle->noextract, pkg, &vdata);
if(vdata != NULL) {
FREE(vdata);
return(1);
@@ -496,9 +507,8 @@ void SYMEXPORT alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs)
int SYMEXPORT alpm_option_remove_ignorepkg(const char *pkg)
{
void *vdata = NULL;
handle->ignorepkg = alpm_list_remove(handle->ignorepkg, pkg,
_alpm_str_cmp, &vdata);
char *vdata = NULL;
handle->ignorepkg = alpm_list_remove_str(handle->ignorepkg, pkg, &vdata);
if(vdata != NULL) {
FREE(vdata);
return(1);
@@ -519,9 +529,8 @@ void SYMEXPORT alpm_option_set_holdpkgs(alpm_list_t *holdpkgs)
int SYMEXPORT alpm_option_remove_holdpkg(const char *pkg)
{
void *vdata = NULL;
handle->holdpkg = alpm_list_remove(handle->holdpkg, pkg,
_alpm_str_cmp, &vdata);
char *vdata = NULL;
handle->holdpkg = alpm_list_remove_str(handle->holdpkg, pkg, &vdata);
if(vdata != NULL) {
FREE(vdata);
return(1);
@@ -542,9 +551,8 @@ void SYMEXPORT alpm_option_set_ignoregrps(alpm_list_t *ignoregrps)
int SYMEXPORT alpm_option_remove_ignoregrp(const char *grp)
{
void *vdata = NULL;
handle->ignoregrp = alpm_list_remove(handle->ignoregrp, grp,
_alpm_str_cmp, &vdata);
char *vdata = NULL;
handle->ignoregrp = alpm_list_remove_str(handle->ignoregrp, grp, &vdata);
if(vdata != NULL) {
FREE(vdata);
return(1);

View File

@@ -30,7 +30,6 @@
typedef struct _pmhandle_t {
/* internal usage */
uid_t uid; /* current UID */ /* TODO is this used? */
pmdb_t *db_local; /* local db pointer */
alpm_list_t *dbs_sync; /* List of (pmdb_t *) */
FILE *logstream; /* log file stream pointer */
@@ -40,6 +39,7 @@ typedef struct _pmhandle_t {
/* callback functions */
alpm_cb_log logcb; /* Log callback function */
alpm_cb_download dlcb; /* Download callback function */
alpm_cb_totaldl totaldlcb; /* Total download callback function */
/* filesystem paths */
char *root; /* Root path, default '/' */
@@ -50,7 +50,7 @@ typedef struct _pmhandle_t {
/* package lists */
alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */
alpm_list_t *noextract; /* List of packages NOT to extract */ /*TODO is this used?*/
alpm_list_t *noextract; /* List of files NOT to extract */
alpm_list_t *ignorepkg; /* List of packages to ignore */
alpm_list_t *holdpkg; /* List of packages which 'hold' pacman */
alpm_list_t *ignoregrp; /* List of groups to ignore */

View File

@@ -30,7 +30,6 @@
#include "log.h"
#include "handle.h"
#include "util.h"
#include "error.h"
#include "alpm.h"
/** \addtogroup alpm_log Logging Functions

View File

@@ -3,18 +3,18 @@
*
* Copyright (C) 2006-2007 Christophe Devine
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License, version 2.1 as published by the Free Software Foundation.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* The MD5 algorithm was designed by Ron Rivest in 1991.
@@ -25,8 +25,9 @@
* Pacman Notes:
*
* Taken from the XySSL project at www.xyssl.org under terms of the
* LGPL. This is from version 0.7 of the library, and has been modified
* GPL. This is from version 0.9 of the library, and has been modified
* as following, which may be helpful for future updates:
* * remove "xyssl/config.h" include
* * change include from "xyssl/md5.h" to "md5.h"
* * removal of HMAC code
* * removal of SELF_TEST code
@@ -35,12 +36,9 @@
* int md5_file( char *path, unsigned char *output )
* to
* int md5_file( const char *path, unsigned char *output )
* * various static/inline changes
*/
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
#include <string.h>
#include <stdio.h>
@@ -49,8 +47,8 @@
/*
* 32-bit integer manipulation macros (little endian)
*/
#ifndef GET_UINT32_LE
#define GET_UINT32_LE(n,b,i) \
#ifndef GET_ULONG_LE
#define GET_ULONG_LE(n,b,i) \
{ \
(n) = ( (unsigned long) (b)[(i) ] ) \
| ( (unsigned long) (b)[(i) + 1] << 8 ) \
@@ -59,8 +57,8 @@
}
#endif
#ifndef PUT_UINT32_LE
#define PUT_UINT32_LE(n,b,i) \
#ifndef PUT_ULONG_LE
#define PUT_ULONG_LE(n,b,i) \
{ \
(b)[(i) ] = (unsigned char) ( (n) ); \
(b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
@@ -87,22 +85,22 @@ static inline void md5_process( md5_context *ctx, unsigned char data[64] )
{
unsigned long X[16], A, B, C, D;
GET_UINT32_LE( X[ 0], data, 0 );
GET_UINT32_LE( X[ 1], data, 4 );
GET_UINT32_LE( X[ 2], data, 8 );
GET_UINT32_LE( X[ 3], data, 12 );
GET_UINT32_LE( X[ 4], data, 16 );
GET_UINT32_LE( X[ 5], data, 20 );
GET_UINT32_LE( X[ 6], data, 24 );
GET_UINT32_LE( X[ 7], data, 28 );
GET_UINT32_LE( X[ 8], data, 32 );
GET_UINT32_LE( X[ 9], data, 36 );
GET_UINT32_LE( X[10], data, 40 );
GET_UINT32_LE( X[11], data, 44 );
GET_UINT32_LE( X[12], data, 48 );
GET_UINT32_LE( X[13], data, 52 );
GET_UINT32_LE( X[14], data, 56 );
GET_UINT32_LE( X[15], data, 60 );
GET_ULONG_LE( X[ 0], data, 0 );
GET_ULONG_LE( X[ 1], data, 4 );
GET_ULONG_LE( X[ 2], data, 8 );
GET_ULONG_LE( X[ 3], data, 12 );
GET_ULONG_LE( X[ 4], data, 16 );
GET_ULONG_LE( X[ 5], data, 20 );
GET_ULONG_LE( X[ 6], data, 24 );
GET_ULONG_LE( X[ 7], data, 28 );
GET_ULONG_LE( X[ 8], data, 32 );
GET_ULONG_LE( X[ 9], data, 36 );
GET_ULONG_LE( X[10], data, 40 );
GET_ULONG_LE( X[11], data, 44 );
GET_ULONG_LE( X[12], data, 48 );
GET_ULONG_LE( X[13], data, 52 );
GET_ULONG_LE( X[14], data, 56 );
GET_ULONG_LE( X[15], data, 60 );
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
@@ -250,7 +248,7 @@ static inline void md5_update( md5_context *ctx, unsigned char *input, int ilen
}
}
static unsigned char md5_padding[64] =
static const unsigned char md5_padding[64] =
{
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -261,7 +259,7 @@ static unsigned char md5_padding[64] =
/*
* MD5 final digest
*/
static inline void md5_finish( md5_context *ctx, unsigned char *output )
static inline void md5_finish( md5_context *ctx, unsigned char output[16] )
{
unsigned long last, padn;
unsigned long high, low;
@@ -271,8 +269,8 @@ static inline void md5_finish( md5_context *ctx, unsigned char *output )
| ( ctx->total[1] << 3 );
low = ( ctx->total[0] << 3 );
PUT_UINT32_LE( low, msglen, 0 );
PUT_UINT32_LE( high, msglen, 4 );
PUT_ULONG_LE( low, msglen, 0 );
PUT_ULONG_LE( high, msglen, 4 );
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
@@ -280,17 +278,16 @@ static inline void md5_finish( md5_context *ctx, unsigned char *output )
md5_update( ctx, (unsigned char *) md5_padding, padn );
md5_update( ctx, msglen, 8 );
PUT_UINT32_LE( ctx->state[0], output, 0 );
PUT_UINT32_LE( ctx->state[1], output, 4 );
PUT_UINT32_LE( ctx->state[2], output, 8 );
PUT_UINT32_LE( ctx->state[3], output, 12 );
PUT_ULONG_LE( ctx->state[0], output, 0 );
PUT_ULONG_LE( ctx->state[1], output, 4 );
PUT_ULONG_LE( ctx->state[2], output, 8 );
PUT_ULONG_LE( ctx->state[3], output, 12 );
}
/*
* Output = MD5( input buffer )
* output = MD5( input buffer )
*/
void md5( unsigned char *input, int ilen,
unsigned char *output )
void md5( unsigned char *input, int ilen, unsigned char output[16] )
{
md5_context ctx;
@@ -302,9 +299,9 @@ void md5( unsigned char *input, int ilen,
}
/*
* Output = MD5( file contents )
* output = MD5( file contents )
*/
int md5_file( const char *path, unsigned char *output )
int md5_file( const char *path, unsigned char output[16] )
{
FILE *f;
size_t n;

View File

@@ -3,29 +3,24 @@
*
* Copyright (C) 2006-2007 Christophe Devine
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License, version 2.1 as published by the Free Software Foundation.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MD5_H
#define _MD5_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* \internal
* \brief MD5 context structure
*/
typedef struct
@@ -37,18 +32,15 @@ typedef struct
md5_context;
/**
* \internal
* \brief Output = MD5( input buffer )
*
* \param input buffer holding the data
* \param ilen length of the input data
* \param output MD5 checksum result
*/
void md5( unsigned char *input, int ilen,
unsigned char *output );
void md5( unsigned char *input, int ilen, unsigned char output[16] );
/**
* \internal
* \brief Output = MD5( file contents )
*
* \param path input file name
@@ -57,10 +49,6 @@ void md5( unsigned char *input, int ilen,
* \return 0 if successful, 1 if fopen failed,
* or 2 if fread failed
*/
int md5_file( const char *path, unsigned char *output );
#ifdef __cplusplus
}
#endif
int md5_file( const char *path, unsigned char output[16] );
#endif /* md5.h */

View File

@@ -31,7 +31,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <locale.h> /* setlocale */
/* libarchive */
#include <archive.h>
@@ -42,7 +41,6 @@
#include "alpm_list.h"
#include "log.h"
#include "util.h"
#include "error.h"
#include "db.h"
#include "cache.h"
#include "delta.h"
@@ -54,39 +52,13 @@
* @{
*/
/** Create a package from a file.
* @param filename location of the package tarball
* @param full whether to stop the load after metadata is read or continue
* through the full archive
* @param pkg address of the package pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int SYMEXPORT alpm_pkg_load(const char *filename, unsigned short full,
pmpkg_t **pkg)
{
_alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_load\n");
/* Sanity checks */
ASSERT(filename != NULL && strlen(filename) != 0,
RET_ERR(PM_ERR_WRONG_ARGS, -1));
ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
*pkg = _alpm_pkg_load(filename, full);
if(*pkg == NULL) {
/* pm_errno is set by pkg_load */
return(-1);
}
return(0);
}
/** Free a package.
* @param pkg package pointer to free
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg)
{
_alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_free\n");
ALPM_LOG_FUNC;
ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
@@ -105,8 +77,7 @@ int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg)
int SYMEXPORT alpm_pkg_checkmd5sum(pmpkg_t *pkg)
{
char *fpath;
char *md5sum = NULL;
int retval = 0;
int retval;
ALPM_LOG_FUNC;
@@ -116,44 +87,19 @@ int SYMEXPORT alpm_pkg_checkmd5sum(pmpkg_t *pkg)
ASSERT(pkg->origin_data.db != handle->db_local, RET_ERR(PM_ERR_PKG_INVALID, -1));
fpath = _alpm_filecache_find(alpm_pkg_get_filename(pkg));
md5sum = alpm_get_md5sum(fpath);
if(md5sum == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not get md5sum for package %s-%s\n"),
alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
pm_errno = PM_ERR_NOT_A_FILE;
retval = _alpm_test_md5sum(fpath, alpm_pkg_get_md5sum(pkg));
if(retval == 0) {
return(0);
} else if (retval == 1) {
pm_errno = PM_ERR_PKG_INVALID;
retval = -1;
} else {
if(strcmp(md5sum, alpm_pkg_get_md5sum(pkg)) == 0) {
_alpm_log(PM_LOG_DEBUG, "md5sums for package %s-%s match\n",
alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
} else {
_alpm_log(PM_LOG_ERROR, _("md5sums do not match for package %s-%s\n"),
alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
pm_errno = PM_ERR_PKG_INVALID;
retval = -1;
}
}
FREE(fpath);
FREE(md5sum);
return(retval);
}
/** Compare versions.
* @param ver1 first version
* @param ver2 secont version
* @return postive, 0 or negative if ver1 is less, equal or more
* than ver2, respectively.
*/
int SYMEXPORT alpm_pkg_vercmp(const char *ver1, const char *ver2)
{
ALPM_LOG_FUNC;
return(_alpm_versioncmp(ver1, ver2));
}
const char SYMEXPORT *alpm_pkg_get_filename(pmpkg_t *pkg)
{
ALPM_LOG_FUNC;
@@ -166,45 +112,18 @@ const char SYMEXPORT *alpm_pkg_get_filename(pmpkg_t *pkg)
_alpm_db_read(pkg->origin_data.db, pkg, INFRQ_DESC);
}
if(!strlen(pkg->filename)) {
/* construct the file name, it's not in the desc file */
if(pkg->arch && strlen(pkg->arch) > 0) {
snprintf(pkg->filename, PKG_FILENAME_LEN, "%s-%s-%s" PKGEXT,
pkg->name, pkg->version, pkg->arch);
} else {
snprintf(pkg->filename, PKG_FILENAME_LEN, "%s-%s" PKGEXT,
pkg->name, pkg->version);
}
}
return pkg->filename;
}
const char SYMEXPORT *alpm_pkg_get_name(pmpkg_t *pkg)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_BASE)) {
_alpm_db_read(pkg->origin_data.db, pkg, INFRQ_BASE);
}
return pkg->name;
}
const char SYMEXPORT *alpm_pkg_get_version(pmpkg_t *pkg)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(pkg != NULL, return(NULL));
if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_BASE)) {
_alpm_db_read(pkg->origin_data.db, pkg, INFRQ_BASE);
}
return pkg->version;
}
@@ -306,7 +225,7 @@ const char SYMEXPORT *alpm_pkg_get_arch(pmpkg_t *pkg)
return pkg->arch;
}
unsigned long SYMEXPORT alpm_pkg_get_size(pmpkg_t *pkg)
off_t SYMEXPORT alpm_pkg_get_size(pmpkg_t *pkg)
{
ALPM_LOG_FUNC;
@@ -320,7 +239,7 @@ unsigned long SYMEXPORT alpm_pkg_get_size(pmpkg_t *pkg)
return pkg->size;
}
unsigned long SYMEXPORT alpm_pkg_get_isize(pmpkg_t *pkg)
off_t SYMEXPORT alpm_pkg_get_isize(pmpkg_t *pkg)
{
ALPM_LOG_FUNC;
@@ -376,6 +295,20 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_groups(pmpkg_t *pkg)
return pkg->groups;
}
unsigned short SYMEXPORT alpm_pkg_has_force(pmpkg_t *pkg)
{
ALPM_LOG_FUNC;
/* Sanity checks */
ASSERT(handle != NULL, return(-1));
ASSERT(pkg != NULL, return(-1));
if(pkg->origin == PKG_FROM_CACHE && !(pkg->infolevel & INFRQ_DESC)) {
_alpm_db_read(pkg->origin_data.db, pkg, INFRQ_DESC);
}
return pkg->force;
}
alpm_list_t SYMEXPORT *alpm_pkg_get_depends(pmpkg_t *pkg)
{
ALPM_LOG_FUNC;
@@ -520,7 +453,7 @@ void SYMEXPORT *alpm_pkg_changelog_open(pmpkg_t *pkg)
int ret = ARCHIVE_OK;
if((archive = archive_read_new()) == NULL) {
RET_ERR(PM_ERR_LIBARCHIVE_ERROR, NULL);
RET_ERR(PM_ERR_LIBARCHIVE, NULL);
}
archive_read_support_compression_all(archive);
@@ -618,12 +551,10 @@ unsigned short SYMEXPORT alpm_pkg_has_scriptlet(pmpkg_t *pkg)
* @brief Compute the packages requiring a given package.
* @param pkg a package
* @return the list of packages requiring pkg
*
* A depends on B through n depends <=> A listed in B's requiredby n times
* n == 0 or 1 in almost all cases */
*/
alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg)
{
const alpm_list_t *i, *j;
const alpm_list_t *i;
alpm_list_t *reqs = NULL;
pmdb_t *localdb = alpm_option_get_localdb();
@@ -632,123 +563,188 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg)
continue;
}
pmpkg_t *cachepkg = i->data;
const char *cachepkgname = alpm_pkg_get_name(cachepkg);
for(j = alpm_pkg_get_depends(cachepkg); j; j = j->next) {
pmdepend_t *dep = j->data;
if(alpm_depcmp(pkg, dep)) {
_alpm_log(PM_LOG_DEBUG, "adding '%s' in requiredby field for '%s'\n",
cachepkgname, pkg->name);
reqs = alpm_list_add(reqs, strdup(cachepkgname));
}
if(_alpm_dep_edge(cachepkg, pkg)) {
const char *cachepkgname = alpm_pkg_get_name(cachepkg);
reqs = alpm_list_add(reqs, strdup(cachepkgname));
}
}
return(reqs);
}
/** @} */
/* this function was taken from rpm 4.0.4 and rewritten */
int _alpm_versioncmp(const char *a, const char *b)
/** Compare two version strings and determine which one is 'newer'.
* Returns a value comparable to the way strcmp works. Returns 1
* if a is newer than b, 0 if a and b are the same version, or -1
* if b is newer than a.
*
* This function has been adopted from the rpmvercmp function located
* at lib/rpmvercmp.c, and was most recently updated against rpm
* version 4.4.2.3. Small modifications have been made to make it more
* consistent with the libalpm coding style.
*
* Keep in mind that the pkgrel is only compared if it is available
* on both versions handed to this function. For example, comparing
* 1.5-1 and 1.5 will yield 0; comparing 1.5-1 and 1.5-2 will yield
* -1 as expected. This is mainly for supporting versioned dependencies
* that do not include the pkgrel.
*/
int SYMEXPORT alpm_pkg_vercmp(const char *a, const char *b)
{
char str1[64], str2[64];
char oldch1, oldch2;
char *str1, *str2;
char *ptr1, *ptr2;
char *one, *two;
char *rel1 = NULL, *rel2 = NULL;
char oldch1, oldch2;
int is1num, is2num;
int rc;
int isnum;
int ret = 0;
ALPM_LOG_FUNC;
if(!strcmp(a,b)) {
return(0);
/* libalpm added code. ensure our strings are not null */
if(!a) {
if(!b) return(0);
return(-1);
}
if(!b) return(1);
strncpy(str1, a, 64);
str1[63] = 0;
strncpy(str2, b, 64);
str2[63] = 0;
/* easy comparison to see if versions are identical */
if(strcmp(a, b) == 0) return(0);
/* lose the release number */
for(one = str1; *one && *one != '-'; one++);
if(one) {
*one = '\0';
rel1 = ++one;
}
for(two = str2; *two && *two != '-'; two++);
if(two) {
*two = '\0';
rel2 = ++two;
}
str1 = strdup(a);
str2 = strdup(b);
one = str1;
two = str2;
while(*one || *two) {
/* loop through each version segment of str1 and str2 and compare them */
while(*one && *two) {
while(*one && !isalnum((int)*one)) one++;
while(*two && !isalnum((int)*two)) two++;
/* If we ran to the end of either, we are finished with the loop */
if(!(*one && *two)) break;
ptr1 = one;
ptr2 = two;
/* find the next segment for each string */
/* grab first completely alpha or completely numeric segment */
/* leave one and two pointing to the start of the alpha or numeric */
/* segment and walk ptr1 and ptr2 to end of segment */
if(isdigit((int)*ptr1)) {
is1num = 1;
while(*ptr1 && isdigit((int)*ptr1)) ptr1++;
} else {
is1num = 0;
while(*ptr1 && isalpha((int)*ptr1)) ptr1++;
}
if(isdigit((int)*ptr2)) {
is2num = 1;
while(*ptr2 && isdigit((int)*ptr2)) ptr2++;
isnum = 1;
} else {
is2num = 0;
while(*ptr1 && isalpha((int)*ptr1)) ptr1++;
while(*ptr2 && isalpha((int)*ptr2)) ptr2++;
isnum = 0;
}
/* save character at the end of the alpha or numeric segment */
/* so that they can be restored after the comparison */
oldch1 = *ptr1;
*ptr1 = '\0';
oldch2 = *ptr2;
*ptr2 = '\0';
/* see if we ran out of segments on one string */
if(one == ptr1 && two != ptr2) {
return(is2num ? -1 : 1);
}
if(one != ptr1 && two == ptr2) {
return(is1num ? 1 : -1);
/* this cannot happen, as we previously tested to make sure that */
/* the first string has a non-null segment */
if (one == ptr1) {
ret = -1; /* arbitrary */
goto cleanup;
}
/* see if we have a type mismatch (ie, one is alpha and one is digits) */
if(is1num && !is2num) return(1);
if(!is1num && is2num) return(-1);
/* take care of the case where the two version segments are */
/* different types: one numeric, the other alpha (i.e. empty) */
/* numeric segments are always newer than alpha segments */
/* XXX See patch #60884 (and details) from bugzilla #50977. */
if (two == ptr2) {
ret = isnum ? 1 : -1;
goto cleanup;
}
if(is1num) while(*one == '0') one++;
if(is2num) while(*two == '0') two++;
if (isnum) {
/* this used to be done by converting the digit segments */
/* to ints using atoi() - it's changed because long */
/* digit segments can overflow an int - this should fix that. */
rc = strverscmp(one, two);
if(rc) return(rc);
/* throw away any leading zeros - it's a number, right? */
while (*one == '0') one++;
while (*two == '0') two++;
/* whichever number has more digits wins */
if (strlen(one) > strlen(two)) {
ret = 1;
goto cleanup;
}
if (strlen(two) > strlen(one)) {
ret = -1;
goto cleanup;
}
}
/* strcmp will return which one is greater - even if the two */
/* segments are alpha or if they are numeric. don't return */
/* if they are equal because there might be more segments to */
/* compare */
rc = strcmp(one, two);
if (rc) {
ret = rc < 1 ? -1 : 1;
goto cleanup;
}
/* restore character that was replaced by null above */
*ptr1 = oldch1;
*ptr2 = oldch2;
one = ptr1;
*ptr2 = oldch2;
two = ptr2;
/* libalpm added code. check if version strings have hit the pkgrel
* portion. depending on which strings have hit, take correct action.
* this is all based on the premise that we only have one dash in
* the version string, and it separates pkgver from pkgrel. */
if(*ptr1 == '-' && *ptr2 == '-') {
/* no-op, continue comparing since we are equivalent throughout */
} else if(*ptr1 == '-') {
/* ptr1 has hit the pkgrel and ptr2 has not. continue version
* comparison after stripping the pkgrel from ptr1. */
*ptr1 = '\0';
} else if(*ptr2 == '-') {
/* ptr2 has hit the pkgrel and ptr1 has not. continue version
* comparison after stripping the pkgrel from ptr2. */
*ptr2 = '\0';
}
}
if((!*one) && (!*two)) {
/* compare release numbers */
if(rel1 && rel2 && strlen(rel1) && strlen(rel2)) return(_alpm_versioncmp(rel1, rel2));
return(0);
/* this catches the case where all numeric and alpha segments have */
/* compared identically but the segment separating characters were */
/* different */
if ((!*one) && (!*two)) {
ret = 0;
goto cleanup;
}
return(*one ? 1 : -1);
/* the final showdown. we never want a remaining alpha string to
* beat an empty string. the logic is a bit weird, but:
* - if one is empty and two is not an alpha, two is newer.
* - if one is an alpha, two is newer.
* - otherwise one is newer.
* */
if ( ( !*one && !isalpha((int)*two) )
|| isalpha((int)*one) ) {
ret = -1;
} else {
ret = 1;
}
cleanup:
free(str1);
free(str2);
return(ret);
}
/** @} */
pmpkg_t *_alpm_pkg_new(const char *name, const char *version)
pmpkg_t *_alpm_pkg_new(void)
{
pmpkg_t* pkg;
@@ -756,47 +752,55 @@ pmpkg_t *_alpm_pkg_new(const char *name, const char *version)
CALLOC(pkg, 1, sizeof(pmpkg_t), RET_ERR(PM_ERR_MEMORY, NULL));
if(name && name[0] != 0) {
strncpy(pkg->name, name, PKG_NAME_LEN);
} else {
pkg->name[0] = '\0';
}
if(version && version[0] != 0) {
strncpy(pkg->version, version, PKG_VERSION_LEN);
} else {
pkg->version[0] = '\0';
}
return(pkg);
}
pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg)
{
pmpkg_t* newpkg;
pmpkg_t *newpkg;
alpm_list_t *i;
ALPM_LOG_FUNC;
CALLOC(newpkg, 1, sizeof(pmpkg_t), RET_ERR(PM_ERR_MEMORY, NULL));
memcpy(newpkg, pkg, sizeof(pmpkg_t));
newpkg->licenses = alpm_list_strdup(alpm_pkg_get_licenses(pkg));
newpkg->conflicts = alpm_list_strdup(alpm_pkg_get_conflicts(pkg));
newpkg->files = alpm_list_strdup(alpm_pkg_get_files(pkg));
newpkg->backup = alpm_list_strdup(alpm_pkg_get_backup(pkg));
newpkg->depends = alpm_list_copy_data(alpm_pkg_get_depends(pkg),
sizeof(pmdepend_t));
newpkg->optdepends = alpm_list_strdup(alpm_pkg_get_optdepends(pkg));
newpkg->groups = alpm_list_strdup(alpm_pkg_get_groups(pkg));
newpkg->provides = alpm_list_strdup(alpm_pkg_get_provides(pkg));
newpkg->replaces = alpm_list_strdup(alpm_pkg_get_replaces(pkg));
newpkg->deltas = alpm_list_copy_data(alpm_pkg_get_deltas(pkg),
sizeof(pmdelta_t));
STRDUP(newpkg->filename, pkg->filename, RET_ERR(PM_ERR_MEMORY, newpkg));
STRDUP(newpkg->name, pkg->name, RET_ERR(PM_ERR_MEMORY, newpkg));
STRDUP(newpkg->version, pkg->version, RET_ERR(PM_ERR_MEMORY, newpkg));
STRDUP(newpkg->desc, pkg->desc, RET_ERR(PM_ERR_MEMORY, newpkg));
STRDUP(newpkg->url, pkg->url, RET_ERR(PM_ERR_MEMORY, newpkg));
newpkg->builddate = pkg->builddate;
newpkg->installdate = pkg->installdate;
STRDUP(newpkg->packager, pkg->packager, RET_ERR(PM_ERR_MEMORY, newpkg));
STRDUP(newpkg->md5sum, pkg->md5sum, RET_ERR(PM_ERR_MEMORY, newpkg));
STRDUP(newpkg->arch, pkg->arch, RET_ERR(PM_ERR_MEMORY, newpkg));
newpkg->size = pkg->size;
newpkg->isize = pkg->isize;
newpkg->scriptlet = pkg->scriptlet;
newpkg->force = pkg->force;
newpkg->reason = pkg->reason;
newpkg->licenses = alpm_list_strdup(pkg->licenses);
newpkg->replaces = alpm_list_strdup(pkg->replaces);
newpkg->groups = alpm_list_strdup(pkg->groups);
newpkg->files = alpm_list_strdup(pkg->files);
newpkg->backup = alpm_list_strdup(pkg->backup);
for(i = pkg->depends; i; i = alpm_list_next(i)) {
newpkg->depends = alpm_list_add(newpkg->depends, _alpm_dep_dup(i->data));
}
newpkg->optdepends = alpm_list_strdup(pkg->optdepends);
newpkg->conflicts = alpm_list_strdup(pkg->conflicts);
newpkg->provides = alpm_list_strdup(pkg->provides);
newpkg->deltas = alpm_list_copy_data(pkg->deltas, sizeof(pmdelta_t));
/* internal */
newpkg->origin = pkg->origin;
if(newpkg->origin == PKG_FROM_FILE) {
newpkg->origin_data.file = strdup(pkg->origin_data.file);
} else {
newpkg->origin_data.db = pkg->origin_data.db;
}
newpkg->infolevel = pkg->infolevel;
return(newpkg);
}
@@ -809,48 +813,46 @@ void _alpm_pkg_free(pmpkg_t *pkg)
return;
}
FREE(pkg->filename);
FREE(pkg->name);
FREE(pkg->version);
FREE(pkg->desc);
FREE(pkg->url);
FREE(pkg->packager);
FREE(pkg->md5sum);
FREE(pkg->arch);
FREELIST(pkg->licenses);
FREELIST(pkg->replaces);
FREELIST(pkg->groups);
FREELIST(pkg->files);
FREELIST(pkg->backup);
FREELIST(pkg->depends);
alpm_list_free_inner(pkg->depends, (alpm_list_fn_free)_alpm_dep_free);
alpm_list_free(pkg->depends);
FREELIST(pkg->optdepends);
FREELIST(pkg->conflicts);
FREELIST(pkg->groups);
FREELIST(pkg->provides);
FREELIST(pkg->replaces);
FREELIST(pkg->deltas);
alpm_list_free_inner(pkg->deltas, (alpm_list_fn_free)_alpm_delta_free);
alpm_list_free(pkg->deltas);
alpm_list_free(pkg->delta_path);
if(pkg->origin == PKG_FROM_FILE) {
FREE(pkg->origin_data.file);
}
FREE(pkg);
}
/* Is pkgB an upgrade for pkgA ? */
int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg)
/* Is spkg an upgrade for locapkg? */
int _alpm_pkg_compare_versions(pmpkg_t *spkg, pmpkg_t *localpkg)
{
int cmp = 0;
ALPM_LOG_FUNC;
if(pkg->origin == PKG_FROM_CACHE) {
/* ensure we have the /desc file, which contains the 'force' option */
_alpm_db_read(pkg->origin_data.db, pkg, INFRQ_DESC);
}
cmp = alpm_pkg_vercmp(alpm_pkg_get_version(spkg),
alpm_pkg_get_version(localpkg));
/* compare versions and see if we need to upgrade */
cmp = _alpm_versioncmp(alpm_pkg_get_version(pkg), alpm_pkg_get_version(local_pkg));
if(cmp != 0 && pkg->force) {
if(cmp < 0 && alpm_pkg_has_force(spkg)) {
cmp = 1;
_alpm_log(PM_LOG_WARNING, _("%s: forcing upgrade to version %s\n"),
alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
} else if(cmp < 0) {
/* local version is newer */
pmdb_t *db = pkg->origin_data.db;
_alpm_log(PM_LOG_WARNING, _("%s: local (%s) is newer than %s (%s)\n"),
alpm_pkg_get_name(local_pkg), alpm_pkg_get_version(local_pkg),
alpm_db_get_name(db), alpm_pkg_get_version(pkg));
cmp = 0;
}
return(cmp);
@@ -860,269 +862,15 @@ int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg)
*/
int _alpm_pkg_cmp(const void *p1, const void *p2)
{
pmpkg_t *pk1 = (pmpkg_t *)p1;
pmpkg_t *pk2 = (pmpkg_t *)p2;
return(strcmp(alpm_pkg_get_name(pk1), alpm_pkg_get_name(pk2)));
}
/* Parses the package description file for the current package
* TODO: this should ALL be in a backend interface (be_files), we should
* be dealing with the abstracted concepts only in this file
* Returns: 0 on success, 1 on error
*
*/
static int parse_descfile(const char *descfile, pmpkg_t *info)
{
FILE* fp = NULL;
char line[PATH_MAX];
char *ptr = NULL;
char *key = NULL;
int linenum = 0;
ALPM_LOG_FUNC;
if((fp = fopen(descfile, "r")) == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), descfile, strerror(errno));
return(-1);
}
while(!feof(fp)) {
fgets(line, PATH_MAX, fp);
linenum++;
_alpm_strtrim(line);
if(strlen(line) == 0 || line[0] == '#') {
continue;
}
ptr = line;
key = strsep(&ptr, "=");
if(key == NULL || ptr == NULL) {
_alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d\n",
info->name[0] != '\0' ? info->name : "error", linenum);
} else {
_alpm_strtrim(key);
_alpm_strtrim(ptr);
if(!strcmp(key, "pkgname")) {
strncpy(info->name, ptr, sizeof(info->name));
} else if(!strcmp(key, "pkgver")) {
strncpy(info->version, ptr, sizeof(info->version));
} else if(!strcmp(key, "pkgdesc")) {
strncpy(info->desc, ptr, sizeof(info->desc));
} else if(!strcmp(key, "group")) {
info->groups = alpm_list_add(info->groups, strdup(ptr));
} else if(!strcmp(key, "url")) {
strncpy(info->url, ptr, sizeof(info->url));
} else if(!strcmp(key, "license")) {
info->licenses = alpm_list_add(info->licenses, strdup(ptr));
} else if(!strcmp(key, "builddate")) {
char first = tolower(ptr[0]);
if(first > 'a' && first < 'z') {
struct tm tmp_tm = {0}; //initialize to null incase of failure
setlocale(LC_TIME, "C");
strptime(ptr, "%a %b %e %H:%M:%S %Y", &tmp_tm);
info->builddate = mktime(&tmp_tm);
setlocale(LC_TIME, "");
} else {
info->builddate = atol(ptr);
}
} else if(!strcmp(key, "packager")) {
strncpy(info->packager, ptr, sizeof(info->packager));
} else if(!strcmp(key, "arch")) {
strncpy(info->arch, ptr, sizeof(info->arch));
} else if(!strcmp(key, "size")) {
/* size in the raw package is uncompressed (installed) size */
info->isize = atol(ptr);
} else if(!strcmp(key, "depend")) {
pmdepend_t *dep = alpm_splitdep(ptr);
info->depends = alpm_list_add(info->depends, dep);
} else if(!strcmp(key, "optdepend")) {
info->optdepends = alpm_list_add(info->optdepends, strdup(ptr));
} else if(!strcmp(key, "conflict")) {
info->conflicts = alpm_list_add(info->conflicts, strdup(ptr));
} else if(!strcmp(key, "replaces")) {
info->replaces = alpm_list_add(info->replaces, strdup(ptr));
} else if(!strcmp(key, "provides")) {
info->provides = alpm_list_add(info->provides, strdup(ptr));
} else if(!strcmp(key, "backup")) {
info->backup = alpm_list_add(info->backup, strdup(ptr));
} else {
_alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d\n",
info->name[0] != '\0' ? info->name : "error", linenum);
}
}
line[0] = '\0';
}
fclose(fp);
unlink(descfile);
return(0);
}
/**
* Load a package and create the corresponding pmpkg_t struct.
* @param pkgfile path to the package file
* @param full whether to stop the load after metadata is read or continue
* through the full archive
* @return An information filled pmpkg_t struct
*/
pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full)
{
int ret = ARCHIVE_OK;
int config = 0;
struct archive *archive;
struct archive_entry *entry;
pmpkg_t *info = NULL;
char *descfile = NULL;
int fd = -1;
struct stat st;
ALPM_LOG_FUNC;
if(pkgfile == NULL || strlen(pkgfile) == 0) {
RET_ERR(PM_ERR_WRONG_ARGS, NULL);
}
if((archive = archive_read_new()) == NULL) {
RET_ERR(PM_ERR_LIBARCHIVE_ERROR, NULL);
}
archive_read_support_compression_all(archive);
archive_read_support_format_all(archive);
if (archive_read_open_filename(archive, pkgfile,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
RET_ERR(PM_ERR_PKG_OPEN, NULL);
}
info = _alpm_pkg_new(NULL, NULL);
if(info == NULL) {
archive_read_finish(archive);
RET_ERR(PM_ERR_MEMORY, NULL);
}
if(stat(pkgfile, &st) == 0) {
info->size = st.st_size;
}
/* TODO there is no reason to make temp files to read
* from a libarchive archive, it can be done by reading
* directly from the archive
* See: archive_read_data_into_buffer
* requires changes 'parse_descfile' as well
* */
/* If full is false, only read through the archive until we find our needed
* metadata. If it is true, read through the entire archive, which serves
* as a verfication of integrity and allows us to create the filelist. */
while((ret = archive_read_next_header(archive, &entry)) == ARCHIVE_OK) {
const char *entry_name = archive_entry_pathname(entry);
/* NOTE: we used to look for .FILELIST, but it is easier (and safer) for
* us to just generate this on our own. */
if(strcmp(entry_name, ".PKGINFO") == 0) {
/* extract this file into /tmp. it has info for us */
descfile = strdup("/tmp/alpm_XXXXXX");
fd = mkstemp(descfile);
if(archive_read_data_into_fd(archive, fd) != ARCHIVE_OK) {
_alpm_log(PM_LOG_ERROR, _("error extracting package description file to %s\n"),
descfile);
goto pkg_invalid;
}
/* parse the info file */
if(parse_descfile(descfile, info) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not parse package description file in %s\n"),
pkgfile);
goto pkg_invalid;
}
if(!strlen(info->name)) {
_alpm_log(PM_LOG_ERROR, _("missing package name in %s\n"), pkgfile);
goto pkg_invalid;
}
if(!strlen(info->version)) {
_alpm_log(PM_LOG_ERROR, _("missing package version in %s\n"), pkgfile);
goto pkg_invalid;
}
config = 1;
unlink(descfile);
FREE(descfile);
close(fd);
continue;
} else if(strcmp(entry_name, ".INSTALL") == 0) {
info->scriptlet = 1;
} else if(*entry_name == '.') {
/* for now, ignore all files starting with '.' that haven't
* already been handled (for future possibilities) */
} else {
/* Keep track of all files for filelist generation */
info->files = alpm_list_add(info->files, strdup(entry_name));
}
if(archive_read_data_skip(archive)) {
_alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"),
pkgfile, archive_error_string(archive));
pm_errno = PM_ERR_LIBARCHIVE_ERROR;
goto error;
}
/* if we are not doing a full read, see if we have all we need */
if(!full && config) {
break;
}
}
if(ret != ARCHIVE_EOF && ret != ARCHIVE_OK) { /* An error occured */
_alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"),
pkgfile, archive_error_string(archive));
pm_errno = PM_ERR_LIBARCHIVE_ERROR;
goto error;
}
if(!config) {
_alpm_log(PM_LOG_ERROR, _("missing package metadata in %s\n"), pkgfile);
goto pkg_invalid;
}
archive_read_finish(archive);
/* internal fields for package struct */
info->origin = PKG_FROM_FILE;
info->origin_data.file = strdup(pkgfile);
if(full) {
/* "checking for conflicts" requires a sorted list, so we ensure that here */
_alpm_log(PM_LOG_DEBUG, "sorting package filelist for %s\n", pkgfile);
info->files = alpm_list_msort(info->files, alpm_list_count(info->files),
_alpm_str_cmp);
info->infolevel = INFRQ_ALL;
} else {
/* get rid of any partial filelist we may have collected, as it is invalid */
FREELIST(info->files);
info->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_DEPENDS;
}
return(info);
pkg_invalid:
pm_errno = PM_ERR_PKG_INVALID;
if(descfile) {
unlink(descfile);
FREE(descfile);
}
if(fd != -1) {
close(fd);
}
error:
_alpm_pkg_free(info);
archive_read_finish(archive);
return(NULL);
pmpkg_t *pkg1 = (pmpkg_t *)p1;
pmpkg_t *pkg2 = (pmpkg_t *)p2;
return(strcmp(alpm_pkg_get_name(pkg1), alpm_pkg_get_name(pkg2)));
}
/* Test for existence of a package in a alpm_list_t*
* of pmpkg_t*
*/
pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack)
pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle)
{
alpm_list_t *lp;

View File

@@ -23,7 +23,8 @@
#ifndef _ALPM_PACKAGE_H
#define _ALPM_PACKAGE_H
#include <time.h>
#include <sys/types.h> /* off_t */
#include <time.h> /* time_t */
#include "alpm.h"
#include "db.h"
@@ -33,32 +34,20 @@ typedef enum _pmpkgfrom_t {
PKG_FROM_FILE
} pmpkgfrom_t;
/* Packages */
#define PKG_FILENAME_LEN 512
#define PKG_NAME_LEN 256
#define PKG_VERSION_LEN 64
#define PKG_FULLNAME_LEN (PKG_NAME_LEN + PKG_VERSION_LEN)
#define PKG_DESC_LEN 512
#define PKG_URL_LEN 256
#define PKG_DATE_LEN 32
#define PKG_TYPE_LEN 32
#define PKG_PACKAGER_LEN 64
#define PKG_MD5SUM_LEN 33
#define PKG_ARCH_LEN 32
struct __pmpkg_t {
char filename[PKG_FILENAME_LEN];
char name[PKG_NAME_LEN];
char version[PKG_VERSION_LEN];
char desc[PKG_DESC_LEN];
char url[PKG_URL_LEN];
char *filename;
char *name;
char *version;
char *desc;
char *url;
time_t builddate;
time_t installdate;
char packager[PKG_PACKAGER_LEN];
char md5sum[PKG_MD5SUM_LEN];
char arch[PKG_ARCH_LEN];
unsigned long size;
unsigned long isize;
char *packager;
char *md5sum;
char *arch;
off_t size;
off_t isize;
off_t download_size;
unsigned short scriptlet;
unsigned short force;
pmpkgreason_t reason;
@@ -72,6 +61,7 @@ struct __pmpkg_t {
alpm_list_t *conflicts;
alpm_list_t *provides;
alpm_list_t *deltas;
alpm_list_t *delta_path;
/* internal */
pmpkgfrom_t origin;
/* Replaced 'void *data' with this union as follows:
@@ -85,14 +75,12 @@ struct __pmpkg_t {
pmdbinfrq_t infolevel;
};
int _alpm_versioncmp(const char *a, const char *b);
pmpkg_t* _alpm_pkg_new(const char *name, const char *version);
pmpkg_t* _alpm_pkg_new(void);
pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg);
void _alpm_pkg_free(pmpkg_t *pkg);
int _alpm_pkg_cmp(const void *p1, const void *p2);
int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg);
pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full);
pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack);
pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle);
int _alpm_pkg_should_ignore(pmpkg_t *pkg);
#endif /* _ALPM_PACKAGE_H */

View File

@@ -9,4 +9,6 @@ it
pl
pt_BR
ru
tr
uk
zh_CN

View File

@@ -1,23 +1,26 @@
# List of source files with translatable strings
# If a file is commented out, it is because it shouldn't have any
# translatable strings
lib/libalpm/add.c
lib/libalpm/alpm.c
lib/libalpm/alpm_list.c
#lib/libalpm/alpm_list.c
lib/libalpm/backup.c
lib/libalpm/be_files.c
lib/libalpm/be_package.c
lib/libalpm/cache.c
lib/libalpm/conflict.c
lib/libalpm/db.c
lib/libalpm/delta.c
lib/libalpm/deps.c
lib/libalpm/dload.c
lib/libalpm/error.c
lib/libalpm/group.c
lib/libalpm/handle.c
lib/libalpm/log.c
lib/libalpm/md5.c
#lib/libalpm/md5.c
lib/libalpm/package.c
lib/libalpm/remove.c
lib/libalpm/server.c
lib/libalpm/sync.c
lib/libalpm/trans.c
lib/libalpm/util.c

View File

@@ -7,22 +7,23 @@ msgid ""
msgstr ""
"Project-Id-Version: cs\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2008-02-12 09:28+0100\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-24 08:16+0200\n"
"Last-Translator: Vojtěch Gondžala <vojtech.gondzala@gmail.com>\n"
"Language-Team: Čeština\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
#, c-format
msgid "replacing older version %s-%s by %s in target list\n"
msgstr "v seznamu cílů nahrazuji starší verzi %s-%s za %s\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "v seznamu cílů je novější veze %s-%s -- přeskakuji\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "přeskakuji %s-%s protože v seznamu cílů je novější veze %s\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
@@ -33,8 +34,8 @@ msgid "you cannot install two conflicting packages at the same time\n"
msgstr "nemůžete instalovat dva konfliktní balíčky společně\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "nahrazování balíčků pomocí -A a -U není nyní podporováno\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "nahrazování balíčků pomocí -U není nyní podporováno\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -54,27 +55,23 @@ msgstr "rozbalení: symbolický odkaz %s neodkazuje na adresář\n"
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "rozbalení: nepřepisuji adreř souborem %s\n"
msgstr "rozbalení: adresář nebyl přepn souborem %s\n"
#, c-format
msgid "could not extract %s (%s)\n"
msgstr "nelze rozbalit %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "nelze přejmenovat %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "nelze zkopírovat dočasný soubor do %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "nelze přejmenovat %s na %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s uložen jako %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "nelze nainstalovat %s jako %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "nelze nainstalovat %s jako %s (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -104,17 +101,49 @@ msgstr "nelze aktualizovat záznam databáze %s-%s\n"
msgid "could not add entry '%s' in cache\n"
msgstr "nelze přidat položku '%s' do cache\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "nelze odstranit záznam v databázi %s%s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "chybný název záznamu v databázi '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "poškozený záznam v databázi '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "nelze otevřít soubor %s: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "nelze odstranit záznam v databázi %s%s\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "databáze %s je nekonzistentní: nesouhlasí jméno balíčku %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "databáze %s je nekonzistentní: nesouhlasí verze balíčku %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "nelze zpracovat soubor s popisem balíčku v %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "chybí jméno balíčku v %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "chybí veze balíčku v %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "chyba při čtení balíčku %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "chybí metadata balíčku v %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -136,10 +165,58 @@ msgstr "%s bude odstraněn po %s, na kterém závisí\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "%s bude nainstalován před %s, na kterém závisí\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "byl vybrán nahrazující balíček (%s poskytuje %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "nemohu vyřešit \"%s\", závislost \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' je chybná\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "schéma url nedefinováno, předpokládám HTTP\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "selhalo získání souboru '%s' z %s: %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "nelze navázat stahování, začínám znovu\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "nelze zapisovat do souboru '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "chyba při stahování '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "chyba při zápisu do souboru '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "nelze změnit adresář na %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "spouštím XferCommand: větvení selhalo!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "selhalo stahování %s\n"
#, c-format
msgid "out of memory!"
msgstr "nedostatek paměti!"
@@ -208,10 +285,6 @@ msgstr "nelze odstranit záznam v databázi"
msgid "invalid url for server"
msgstr "nesprávná url pro server"
#, c-format
msgid "could not set parameter"
msgstr "nelze nastavit parametr"
#, c-format
msgid "transaction already initialized"
msgstr "transakce inicializována"
@@ -260,10 +333,6 @@ msgstr "nelze otevřít soubor balíčku"
msgid "cannot load package data"
msgstr "nelze načíst data z balíčku"
#, c-format
msgid "package already installed"
msgstr "balíček je již nainstalován"
#, c-format
msgid "package not installed or lesser version"
msgstr "balíček není nainstalovaný nebo má nižší verzi"
@@ -273,20 +342,16 @@ msgid "cannot remove all files for package"
msgstr "nelze odstranit všechny soubory balíčku"
#, c-format
msgid "package name is not valid"
msgstr "jméno balíčku není platné"
#, c-format
msgid "corrupted package"
msgstr "poškozený balíček"
msgid "package filename is not valid"
msgstr "jméno souboru balíčku není platné"
#, c-format
msgid "no such repository"
msgstr "není žádný takový repositář"
#, c-format
msgid "corrupted delta"
msgstr "poškozený delta rozdíl"
msgid "invalid or corrupted delta"
msgstr "neplatný nebo poškozený rozdíl"
#, c-format
msgid "delta patch failed"
@@ -316,10 +381,6 @@ msgstr "uživatel zrušil operaci"
msgid "internal error"
msgstr "interní chyba"
#, c-format
msgid "libarchive error"
msgstr "chyba knihovny libarchive"
#, c-format
msgid "not confirmed"
msgstr "nepotvrzeno"
@@ -329,53 +390,21 @@ msgid "invalid regular expression"
msgstr "nesprávný regulární výraz"
#, c-format
msgid "connection to remote host failed"
msgstr "spojení se vzdáleným hostitelem selhalo"
msgid "libarchive error"
msgstr "chyba knihovny libarchive"
#, c-format
msgid "download library error"
msgstr "chyba knihovny pro stahování souborů"
#, c-format
msgid "error invoking external downloader"
msgstr "chyba volání externího programu pro stahování souborů"
#, c-format
msgid "unexpected error"
msgstr "neočekávaná chyba"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "nelze zjistit md5 kontrolní součet balíčku %s-%s\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "md5 kontrolní součet balíčku %s-%s nesouhlasí\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: vynucená aktualizace na verzi %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: lokální (%s) je novější než %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "nelze získat soubor s popisem balíčku k %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "nelze zpracovat soubor s popisem balíčku v %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "chybí jméno balíčku v %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "chybí veze balíčku v %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "chyba při čtení balíčku %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "chybí metadata balíčku v %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "nelze nalézt %s v databázi -- přeskakuji\n"
@@ -392,58 +421,14 @@ msgstr "nelze odstranit záznam databáze %s-%s\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "nelze odstranit položku '%s' z cache\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "url '%s' je chybná, ignoruji\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "schéma url nedefinováno, předpokládám http\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "selhalo získání souboru '%s' z %s: %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "nelze navázat stahování, začínám znovu\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "nelze zapisovat do souboru '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "chyba při stahování '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "chyba při zápisu do souboru '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "nelze změnit adresář na %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "spouštím XferCommand: větvení selhalo!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "URL neobsahuje soubor pro stažení\n"
#, c-format
msgid "failed to download %s\n"
msgstr "selhalo stahování %s\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s: ignoruji aktualizaci balíčku (bude nahrazen %s-%s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: lokální (%s) je novější než %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ignoruji aktualizaci balíčku (%s => %s)\n"
@@ -460,26 +445,22 @@ msgstr "%s-%s je aktuální -- přeskakuji\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s je aktuální -- přeinstalovávám\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "ponížení verze balíčku %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "zjištěn konflikt nerozlišitelných balíčků\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "selhala alokace paměti: nelze alokovat %zd bytů\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "odstraňuji '%s' ze seznamu cílů, protože je konfliktní s '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "příkaz: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "nelze získat md5 kontrolní součet pro soubor %s\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "soubor %s byl poškozen (nesouhlasí MD5 kontrolní součet)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "selhalo stažení některých souborů z %s\n"
@@ -528,6 +509,10 @@ msgstr "V rodičovském prostředí chybí /bin/sh, ruším provádění skript
msgid "could not create temp directory\n"
msgstr "nelze vytvořit dočasný adresář\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "nelze zkopírovat dočasný soubor do %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "nelze změnit adresář na %s (%s)\n"
@@ -560,10 +545,6 @@ msgstr "správné spuštění skriptu selhalo\n"
msgid "could not remove tmpdir %s\n"
msgstr "nelze odstranit dočasný adresář %s\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "selhalo vytvoření cesty '%s': %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "nelze otevřít %s: %s\n"
@@ -575,11 +556,3 @@ msgstr "neexistuje cache %s, vytvářím...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "nelze vytvořit cache balíčků, používám /tmp\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: %s nemohl být otevřen\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: %s nemohl být přečten\n"

View File

@@ -11,8 +11,8 @@ msgid ""
msgstr ""
"Project-Id-Version: de\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2008-02-15 09:26+0100\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-24 12:41+0100\n"
"Last-Translator: Matthias Gorissen <matthias@archlinux.de>\n"
"Language-Team: German <archlinux.de>\n"
"MIME-Version: 1.0\n"
@@ -26,8 +26,8 @@ msgid "replacing older version %s-%s by %s in target list\n"
msgstr "Ersetze ältere Version %s-%s durch %s in der Ziel-Liste\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "Neuere Version %s-%s ist in der Ziel-Liste -- Überspringe\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "Überspringe %s-%s, da die Ziel-Liste die neuere Version %s enthält\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
@@ -40,8 +40,8 @@ msgstr ""
"installieren\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "Das Ersetzen von Paketen mit -A und -U wird noch nicht unterstützt\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "Das Ersetzen von Paketen mit -U wird noch nicht unterstützt\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -68,20 +68,16 @@ msgid "could not extract %s (%s)\n"
msgstr "Konnte %s nicht entpacken (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "Konnte %s nicht umbenennen (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "Konnte temporäre Datei nicht nach %s kopieren (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "Konnte %s nicht in %s umbenennen (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s gespeichert als %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "Konnte %s nicht als %s installieren: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "Konnte %s nicht als %s installieren (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -111,17 +107,53 @@ msgstr "Konnte Datenbankeintrag %s-%s nicht aktualisieren\n"
msgid "could not add entry '%s' in cache\n"
msgstr "Konnte Eintrag '%s' nicht zum Pufferspeicher hinzufügen\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "Konnte Datenbank-Eintrag %s%s nicht entfernen\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "Ungültiger Name für Datenbank-Eintrag '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "Beschädigter Datenbank-Eintrag '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "Konnte Datei %s nicht öffnen: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "Konnte Datenbank-Eintrag %s%s nicht entfernen\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr ""
"Die Datenbank von %s ist inkonsistent: Die Paketnamen für %s stimmen nicht "
"überein\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr ""
"Die Datenbank von %s ist inkonsistent: Die Versionsnummern für das Paket %s "
"stimmen nicht überein\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "Konnte Paket-Beschreibungsdatei in %s nicht analysieren\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "Fehlender Paketname in %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "Fehlende Paket-Version in %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "Fehler beim Lesen des Paketes %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "Fehlende Paket-Metadaten in %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -143,10 +175,58 @@ msgstr "%s wird nach seiner Abhängigkeit %s entfernt werden\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "%s wird vor seiner Abhängigkeit %s installiert werden\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "Bereitstellendes Paket wurde ausgewählt (%s enthält %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "Kann \"%s\" nicht auflösen (eine Abhängigkeit von \"%s\")\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "URL '%s' ist ungültig\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "URL-Schema nicht spezifiziert, vermute HTTP\n"
#, c-format
msgid "disk"
msgstr "Platte"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "Konnte Datei '%s' nicht von %s übertragen : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "Kann den Download nicht wieder aufnehmen, starte neu\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "Kann Datei '%s' nicht beschreiben\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "Fehler beim Download von '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "Fehler beim Beschreiben von Datei '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "Konnte nicht zu Verzeichnis %s wechseln\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "Nutze XferCommand: Zweig versagte!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "Konnte %s nicht herunterladen\n"
#, c-format
msgid "out of memory!"
msgstr "Speicher ist voll!"
@@ -215,10 +295,6 @@ msgstr "Konnte Datenbank-Eintrag nicht entfernen"
msgid "invalid url for server"
msgstr "Ungültige URL für den Server"
#, c-format
msgid "could not set parameter"
msgstr "Konnte Parameter nicht setzen"
#, c-format
msgid "transaction already initialized"
msgstr "Vorgang bereits gestartet"
@@ -267,10 +343,6 @@ msgstr "Kann Paketdatei nicht öffnen"
msgid "cannot load package data"
msgstr "Kann Paketdaten nicht laden"
#, c-format
msgid "package already installed"
msgstr "Paket ist bereits installiert"
#, c-format
msgid "package not installed or lesser version"
msgstr "Paket ist nicht installiert oder ältere Version"
@@ -280,20 +352,16 @@ msgid "cannot remove all files for package"
msgstr "Konnte nicht alle Dateien des Paketes entfernen"
#, c-format
msgid "package name is not valid"
msgstr "Paketname ist nicht gültig"
#, c-format
msgid "corrupted package"
msgstr "Beschädigtes Paket"
msgid "package filename is not valid"
msgstr "Der Dateiname des Paketes ist nicht gültig"
#, c-format
msgid "no such repository"
msgstr "Kein solches Repositorium"
#, c-format
msgid "corrupted delta"
msgstr "Beschädigtes Delta"
msgid "invalid or corrupted delta"
msgstr "Ungültiges oder beschädigtes Delta"
#, c-format
msgid "delta patch failed"
@@ -323,10 +391,6 @@ msgstr "Benutzer brach die Aktion ab"
msgid "internal error"
msgstr "Interner Fehler"
#, c-format
msgid "libarchive error"
msgstr "libarchive-Fehler"
#, c-format
msgid "not confirmed"
msgstr "Nicht bestätigt"
@@ -336,53 +400,21 @@ msgid "invalid regular expression"
msgstr "Ungültiger Regulärer Ausdruck"
#, c-format
msgid "connection to remote host failed"
msgstr "Verbindung zum Server fehlgeschlagen"
msgid "libarchive error"
msgstr "libarchive-Fehler"
#, c-format
msgid "download library error"
msgstr "Fehler in der Bibliothek für Downloads"
#, c-format
msgid "error invoking external downloader"
msgstr "Fehler beim Aufruf eines externen Downloaders"
#, c-format
msgid "unexpected error"
msgstr "Unerwarteter Fehler"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "Konnte MD5-Prüfsumme für Paket %s-%s nicht ermitteln\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "MD5-Prüfsummen für Paket %s-%s stimmen nicht überein\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: Erzwungene Aktualisierung auf Version %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: Lokale Version (%s) ist neuer als %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "Fehler beim Entpacken der Paket-Beschreibungsdatei nach %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "Konnte Paket-Beschreibungsdatei in %s nicht analysieren\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "Fehlender Paketname in %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "Fehlende Paket-Version in %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "Fehler beim Lesen des Paketes %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "Fehlende Paket-Metadaten in %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "Konnte %s nicht in Datenbank finden -- Überspringe\n"
@@ -399,58 +431,14 @@ msgstr "Konnte Datenbank-Eintrag %s-%s nicht entfernen\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "Konnte Eintrag '%s' nicht aus dem Puffer entfernen\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "URL '%s' ist ungültig, wird ignoriert\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "URL-Schema nicht spezifiziert, vermute http\n"
#, c-format
msgid "disk"
msgstr "Platte"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "Konnte Datei '%s' nicht von %s übertragen : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "Kann den Download nicht wieder aufnehmen, starte neu\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "Kann Datei '%s' nicht beschreiben\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "Fehler beim Download von '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "Fehler beim Beschreiben von Datei '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "Konnte nicht zu Verzeichnis %s wechseln\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "Nutze XferCommand: Zweig versagte!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "Die URL enthält keine Datei zum Download\n"
#, c-format
msgid "failed to download %s\n"
msgstr "Konnte %s nicht herunterladen\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s: Ignoriere zu aktualisierendes Paket (zu ersetzen durch %s-%s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: Lokale Version (%s) ist neuer als %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: Ignoriere Paket-Aktualisierung (%s => %s)\n"
@@ -465,28 +453,24 @@ msgstr "%s-%s ist aktuell -- Überspringe\n"
#, c-format
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s ist aktuell -- Überspringe\n"
msgstr "%s-%s ist aktuell -- Reinstalliere\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "Downgrade des Paketes %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "Nicht lösbare Paketkonflikte gefunden\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "malloc-Fehler: Konnte %zd Bytes nicht zuweisen\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "Entferne '%s' aus der Ziel-Liste, da es mit '%s' in Konflikt steht\n"
#, c-format
msgid "command: %s\n"
msgstr "Befehl: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "Kann MD5-Prüfsumme für Paket %s nicht ermitteln\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "Datei %s war beschädigt (falsche MD5-Prüfsumme)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "Konnte manche Dateien von %s nicht übertragen\n"
@@ -535,6 +519,10 @@ msgstr "Kein /bin/sh im übergeordneten Verzeichnis, breche Skript ab\n"
msgid "could not create temp directory\n"
msgstr "Konnte temporäres Verzeichnis nicht erstellen\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "Konnte temporäre Datei nicht nach %s kopieren (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "Konnte nicht zu Verzeichnis %s wechseln (%s)\n"
@@ -567,10 +555,6 @@ msgstr "Skript konnte nicht korrekt ausgeführt werden\n"
msgid "could not remove tmpdir %s\n"
msgstr "Konnte temporäres Verzeichnis %s nicht entfernen\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "Konnte Pfad '%s' nicht erstellen: %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "Konnte Datei %s nicht öffnen: %s\n"
@@ -583,10 +567,3 @@ msgstr "Es existiert kein %s-Puffer. Erstelle... \n"
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "Konnte Paketpuffer nicht erstellen, benutze stattdessen /tmp\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: %s kann nicht geöffnet werden\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: %s kann nicht gelesen werden\n"

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Pacman package manager 3.0.0\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2008-01-16 10:40+1000\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-23 23:38+0200\n"
"Last-Translator: Jeff Bailes <thepizzaking@gmail.com>\n"
"Language-Team: English <en_gb@li.org>\n"
"MIME-Version: 1.0\n"
@@ -21,8 +21,8 @@ msgid "replacing older version %s-%s by %s in target list\n"
msgstr "replacing older version %s-%s by %s in target list\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "newer version %s-%s is in the target list -- skipping\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "skipping %s-%s because newer version %s is in the target list\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
@@ -33,8 +33,8 @@ msgid "you cannot install two conflicting packages at the same time\n"
msgstr "you cannot install two conflicting packages at the same time\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "replacing packages with -A and -U is not supported yet\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "replacing packages with -U is not supported yet\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -61,20 +61,16 @@ msgid "could not extract %s (%s)\n"
msgstr "could not extract %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "could not rename %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "could not copy tempfile to %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "could not rename %s to %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s saved as %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "could not install %s as %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "could not install %s as %s (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -104,17 +100,49 @@ msgstr "could not update database entry %s-%s\n"
msgid "could not add entry '%s' in cache\n"
msgstr "could not add entry '%s' in cache\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "could not remove database entry %s%s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "invalid name for database entry '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "corrupted database entry '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "could not open file %s: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "could not remove database entry %s%s\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "%s database is inconsistent: name mismatch on package %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "%s database is inconsistent: version mismatch on package %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "could not parse package description file in %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "missing package name in %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "missing package version in %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "error while reading package %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "missing package metadata in %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -136,10 +164,58 @@ msgstr "%s will be removed after its %s dependency\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "%s will be installed before its %s dependency\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "provider package was selected (%s provides %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "cannot resolve \"%s\", a dependency of \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "URL '%s' is invalid\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "URL scheme not specified, assuming HTTP\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "failed retrieving file '%s' from %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "cannot resume download, starting over\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "cannot write to file '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "error downloading '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "error writing to file '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "could not chdir to %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "running XferCommand: fork failed!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "failed to download %s\n"
#, c-format
msgid "out of memory!"
msgstr "out of memory!"
@@ -208,10 +284,6 @@ msgstr "could not remove database entry"
msgid "invalid url for server"
msgstr "invalid url for server"
#, c-format
msgid "could not set parameter"
msgstr "could not set parameter"
#, c-format
msgid "transaction already initialized"
msgstr "transaction already initialised"
@@ -260,10 +332,6 @@ msgstr "cannot open package file"
msgid "cannot load package data"
msgstr "cannot load package data"
#, c-format
msgid "package already installed"
msgstr "package already installed"
#, c-format
msgid "package not installed or lesser version"
msgstr "package not installed or lesser version"
@@ -273,20 +341,16 @@ msgid "cannot remove all files for package"
msgstr "cannot remove all files for package"
#, c-format
msgid "package name is not valid"
msgstr "package name is not valid"
#, c-format
msgid "corrupted package"
msgstr "corrupted package"
msgid "package filename is not valid"
msgstr "package filename is not valid"
#, c-format
msgid "no such repository"
msgstr "no such repository"
#, c-format
msgid "corrupted delta"
msgstr "corrupted delta"
msgid "invalid or corrupted delta"
msgstr "invalid or corrupted delta"
#, c-format
msgid "delta patch failed"
@@ -316,10 +380,6 @@ msgstr "user aborted the operation"
msgid "internal error"
msgstr "internal error"
#, c-format
msgid "libarchive error"
msgstr "libarchive error"
#, c-format
msgid "not confirmed"
msgstr "not confirmed"
@@ -329,53 +389,21 @@ msgid "invalid regular expression"
msgstr "invalid regular expression"
#, c-format
msgid "connection to remote host failed"
msgstr "connection to remote host failed"
msgid "libarchive error"
msgstr "libarchive error"
#, c-format
msgid "download library error"
msgstr "download library error"
#, c-format
msgid "error invoking external downloader"
msgstr "error invoking external downloader"
#, c-format
msgid "unexpected error"
msgstr "unexpected error"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "could not get md5sum for package %s-%s\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "md5sums do not match for package %s-%s\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: forcing upgrade to version %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: local (%s) is newer than %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "error extracting package description file to %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "could not parse package description file in %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "missing package name in %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "missing package version in %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "error while reading package %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "missing package metadata in %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "could not find %s in database -- skipping\n"
@@ -392,58 +420,14 @@ msgstr "could not remove database entry %s-%s\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "could not remove entry '%s' from cache\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "URL '%s' is invalid, ignoring\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "URL scheme not specified, assuming http\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "failed retrieving file '%s' from %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "cannot resume download, starting over\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "cannot write to file '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "error downloading '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "error writing to file '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "could not chdir to %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "running XferCommand: fork failed!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "URL does not contain a file for download\n"
#, c-format
msgid "failed to download %s\n"
msgstr "failed to download %s\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: local (%s) is newer than %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ignoring package upgrade (%s => %s)\n"
@@ -460,26 +444,22 @@ msgstr "%s-%s is up to date -- skipping\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s is up to date -- reinstalling\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "downgrading package %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "unresolvable package conflicts detected\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "malloc failure: could not allocate %zd bytes\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "removing '%s' from target list because it conflicts with '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "command: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "can't get md5 checksum for file %s\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "file %s was corrupted (bad MD5 checksum)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "failed to retrieve some files from %s\n"
@@ -528,6 +508,10 @@ msgstr "No /bin/sh in parent environment, aborting scriptlet\n"
msgid "could not create temp directory\n"
msgstr "could not create temp directory\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "could not copy tempfile to %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "could not change directory to %s (%s)\n"
@@ -560,10 +544,6 @@ msgstr "scriptlet failed to execute correctly\n"
msgid "could not remove tmpdir %s\n"
msgstr "could not remove tmpdir %s\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "failed to make path '%s' : %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "could not open %s: %s\n"
@@ -576,10 +556,3 @@ msgstr "no %s cache exists, creating...\n"
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "couldn't create package cache, using /tmp instead\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: %s can't be opened\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: %s can't be read\n"

View File

@@ -1,20 +1,20 @@
# translation of es.po to
# Juan Pablo Gonzalez <jotapesan@gmail.com>, 2008.
# Juan Pablo González Tognarelli <jotapesan@gmail.com>, 2008.
msgid ""
msgstr ""
"Project-Id-Version: es\n"
"Project-Id-Version: libalpm\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2008-01-16 16:04-0300\n"
"Last-Translator: Juan Pablo Gonzalez <jotapesan@gmail.com>\n"
"Language-Team: <es@li.org>\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-23 23:35+0200\n"
"Last-Translator: Juan Pablo González Tognarelli <jotapesan@gmail.com>\n"
"Language-Team: Spanish <kde-i18n-doc@lists.kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Spanish\n"
"X-Poedit-Country: CHILE\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: KBabel 1.11.4\n"
"X-Generator: Lokalize 0.2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#, c-format
msgid "replacing older version %s-%s by %s in target list\n"
@@ -22,9 +22,8 @@ msgstr ""
"reemplazando la versión antigua %s-%s por %s en la lista de objetivos\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr ""
"una nueva versión %s-%s esta en la lista de objetivos list -- saltándola\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "saltando %s-%s debido a que una nueva versión de %s esta en la lista\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
@@ -37,8 +36,8 @@ msgstr ""
"entre si\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "el reemplazo de paquetes con -A y -U aún no esta soportado\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "reemplazar paquetes con -U aún no esta soportado\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -65,20 +64,16 @@ msgid "could not extract %s (%s)\n"
msgstr "no se pudo extraer %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "no se pudo renombrar %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "no se pudo copiar el archivo temporal a %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "no se pudo renombrar %s a %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s guardado como %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "no se pudo instalar %s como %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "no se pudo instalar %s como %s (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -108,17 +103,53 @@ msgstr "no se pudo actualizar en la base de datos la entrada %s-%s\n"
msgid "could not add entry '%s' in cache\n"
msgstr "no se pudo agregar '%s' en la cache\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "no se pudo quitar la entrada %s%s en la base de datos\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "nombre invalido para la entrada de la base de datos '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "entrada corrupta en la base de datos '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "no se pudo abrir el archivo %s: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "no se pudo quitar la entrada %s%s en la base de datos\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr ""
"la base de datos %s es inconsistente: nombre mal emparejado en el paquete %"
"s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr ""
"la base de datos %s es inconsistente: versión mal emparejada en el paquete %"
"s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "no se pudo analizar sintácticamente el archivo de descripción en %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "nombre de paquete ausente en %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "versión del paquete ausente en %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "error mientras se leía el paquete %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "metadatos del paquete faltantes en %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -140,13 +171,61 @@ msgstr "%s será quitado tras su dependencia %s\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "%s será instalado antes de su dependencia %s\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "El paquete proveedor fue seleccionado (%s provee %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "no se pudo resolver \"%s\", una dependencia para \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "la url %s no es válida\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "no fue especificado el esquema de url, asumiendo HTTP\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "falló al obtener archivo '%s' desde %s: %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "no se puede resumir la descarga, empezando de nuevo\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "no se puede escribir en el archivo '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "error descargando '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "no se pudo escribir al archivo '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "no se pudo cambiar el directorio a %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "ejecutando XferCommand: falló en el fork\n"
#, c-format
msgid "failed to download %s\n"
msgstr "no se pudo descargar %s\n"
#, c-format
msgid "out of memory!"
msgstr "no hay memoria!"
msgstr "memoria insuficiente!"
#, c-format
msgid "unexpected system error"
@@ -170,11 +249,11 @@ msgstr "argumento erroneo o NULO"
#, c-format
msgid "library not initialized"
msgstr "librería no inicializada"
msgstr "biblioteca no inicializada"
#, c-format
msgid "library already initialized"
msgstr "la librería ya fue inicializada"
msgstr "la biblioteca ya fue inicializada"
#, c-format
msgid "unable to lock database"
@@ -212,10 +291,6 @@ msgstr "no se pudo quitar la entrada de la base de datos"
msgid "invalid url for server"
msgstr "dirección inválida para el servidor"
#, c-format
msgid "could not set parameter"
msgstr "no se pudo fijar el parámetro"
#, c-format
msgid "transaction already initialized"
msgstr "la operación ya se inicializó"
@@ -264,10 +339,6 @@ msgstr "no se pudo abrir el archivo de paquetes"
msgid "cannot load package data"
msgstr "no se pudo cargar la información del paquete"
#, c-format
msgid "package already installed"
msgstr "el paquete ya está instalado"
#, c-format
msgid "package not installed or lesser version"
msgstr "el paquete no está instalado o es una versión menor"
@@ -277,20 +348,16 @@ msgid "cannot remove all files for package"
msgstr "no se pudo quitar todos los archivos del paquete"
#, c-format
msgid "package name is not valid"
msgstr "el nombre del paquete no es válido"
#, c-format
msgid "corrupted package"
msgstr "paquete corrupto"
msgid "package filename is not valid"
msgstr "el nombre de archivo del paquete no es válido"
#, c-format
msgid "no such repository"
msgstr "no existe el repositorio"
#, c-format
msgid "corrupted delta"
msgstr "delta corrupto"
msgid "invalid or corrupted delta"
msgstr "invalido o diferencial corrupto"
#, c-format
msgid "delta patch failed"
@@ -320,10 +387,6 @@ msgstr "el usuario abortó la operación"
msgid "internal error"
msgstr "error interno"
#, c-format
msgid "libarchive error"
msgstr "error de libarchive"
#, c-format
msgid "not confirmed"
msgstr "no confirmado"
@@ -333,53 +396,21 @@ msgid "invalid regular expression"
msgstr "expresión regular inválida"
#, c-format
msgid "connection to remote host failed"
msgstr "falló la conexión con el host remoto"
msgid "libarchive error"
msgstr "error de libarchive"
#, c-format
msgid "download library error"
msgstr "error de descarga de biblioteca"
#, c-format
msgid "error invoking external downloader"
msgstr "error invocando el descargador externo"
#, c-format
msgid "unexpected error"
msgstr "error inesperado"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "no se pudo obtener la verificación md5 para %s-%s\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "la verificación md5 para el paquete %s-%s no concuerda\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: forzando la actualización a la versión %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: local (%s) es más nuevo que %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "error descomprimiendo el paquete de descripción a %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "no se pudo interpretar el archivo de descripción en %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "nombre de paquete perdido en %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "versión de paquete perdida en %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "error mientras se leía el paquete %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "faltan los metadatos del paquete en %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "no se pudo encontrar %s en la base de datos -- saltando\n"
@@ -396,60 +427,16 @@ msgstr "no se pudo quitar de la base de datos %s-%s\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "no se pudo quitar la entrada '%s' de la cache\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "la url %s no es válida, ignorando\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "no fue especificado el esquema de url, asumiendo http\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "fallo al obtener archivo '%s' desde %s: %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "no se puede resumir la descarga, empezando de nuevo\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "no se pudo escribir al archivo '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "error descargando %s: %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "no se pudo escribir al archivo '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "no se pudo cambiar el directorio a %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "ejecutando XferCommand: fallo en el fork\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "la URL no contiene un archivo para descargar\n"
#, c-format
msgid "failed to download %s\n"
msgstr "no se pudo descargar %s\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr ""
"%s-%s: ignorando la actualización del paquete (para ser reemplazado por %s-%"
"s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: local (%s) es más nuevo que %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ignorando la actualización del paquete (%s => %s)\n"
@@ -466,29 +453,27 @@ msgstr "%s-%s esta al día -- saltando\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s esta al día -- re-instalando\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "decrementando la versión del paquete %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "se han detectado paquetes con conflictos no resueltos\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "falla en malloc: no se pudo alocar %zd bytes\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr ""
"quitando '%s' de la lista de objetivos debido a que posee conflictos con '%"
"s'\n"
#, c-format
msgid "command: %s\n"
msgstr "comando: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "no se pudo verificar md5 para el paquete %s\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "el archivo %s estaba corrupto (no coincidió la verificación MD5)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "fallo al descargar algunos archivos desde %s\n"
msgstr "falló al descargar algunos archivos desde %s\n"
#, c-format
msgid "could not create removal transaction\n"
@@ -534,6 +519,10 @@ msgstr "No existe /bin/sh en el ambiente padre, abortando los scripts\n"
msgid "could not create temp directory\n"
msgstr "no se puede crear el directorio temporal\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "no se pudo copiar el archivo temporal a %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "no se pudo cambiar el directorio a %s (%s)\n"
@@ -566,10 +555,6 @@ msgstr "scriplet falló en ejecutarse correctamente\n"
msgid "could not remove tmpdir %s\n"
msgstr "no se pudo eliminar el directorio temporal %s\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "fallo al crear la ruta '%s' : %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "no se pudo abrir %s: %s\n"
@@ -582,10 +567,3 @@ msgstr "no existe la cache %s, creando...\n"
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "no se pudo crear la cache de paquetes, usando /tmp en su lugar\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: no se puede abrir %s\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: no se puede leer %s\n"

View File

@@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Pacman package manager 3.0.1\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2007-12-22 22:29+0100\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-23 22:51+0200\n"
"Last-Translator: Xavier <shiningxc@gmail.com>\n"
"Language-Team: solsTiCe d'Hiver <solstice.dhiver@laposte.net>\n"
"MIME-Version: 1.0\n"
@@ -21,22 +21,22 @@ msgstr ""
"remplacement de l'ancienne version %s-%s par %s dans la liste des cibles\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr ""
"une version plus récente %s-%s est dans la liste des cibles -- paquet "
"ignoré\n"
"ignore le paquet %s-%s car une version plus récente %s est dans la liste des "
"cibles\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
msgstr "Des paquets en conflit ont été trouvés dans la liste des cibles\n"
msgstr "des paquets en conflit ont été trouvés dans la liste des cibles\n"
#, c-format
msgid "you cannot install two conflicting packages at the same time\n"
msgstr "vous ne pouvez pas installer deux paquets en conflit en même temps\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "remplacer un paquet avec -A ou -U n'est pas encore possible\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "remplacer un paquet avec -U n'est pas encore possible\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -64,20 +64,16 @@ msgid "could not extract %s (%s)\n"
msgstr "l'extraction de %s a échoué (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "renommer %s a échoué (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "la copie du fichier temporaire vers %s a échoué (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "impossible de renommer %s en %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s enregistré en tant que %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "l'installation de %s en tant que %s a échoué: (%s)\n"
msgid "could not install %s as %s (%s)\n"
msgstr "l'installation de %s en tant que %s a échoué (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -108,17 +104,49 @@ msgstr "la mise à jour l'entrée de base de données %s-%s a échoué\n"
msgid "could not add entry '%s' in cache\n"
msgstr "l'ajout au cache de l'entrée '%s' a échoué\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "la suppression de l'entrée de base de données %s%s a échoué\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "nom invalide pour l'entrée de base de données '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "l'entrée '%s' de la base de données est corrompue\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "l'ouverture du fichier %s a échoué: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "la suppression de l'entrée de base de données %s%s a échoué\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "Le dépôt %s est inconsistant: noms différents pour le paquet %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "Le dépôt %s est inconsistant: versions différentes pour le paquet %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "l'analyse du fichier de description a échoué dans %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "nom de paquet manquant dans %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "version de paquet manquante dans %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "erreur lors de la lecture du paquet %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "méta-données du paquet manquantes dans %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -140,10 +168,58 @@ msgstr "%s sera supprimé après sa dépendance %s\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "%s sera installé avant sa dépendance %s\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "Une provision a été sélectionnée (%s fournit %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "impossible de résoudre \"%s\", une dépendance de \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "l'url '%s' est invalide\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "Le protocole n'a pas été spécifié dans l'url, assume http\n"
#, c-format
msgid "disk"
msgstr "disque"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "échec de récupération du fichier '%s' depuis %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "le téléchargement ne peut pas être repris, relance\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "écriture dans le fichier '%s' impossible\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "erreur lors du téléchargement de '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "écriture dans le fichier '%s' impossible: %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "changer de répertoire vers %s a échoué\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "lancement de XferCommand: le fork a échoué!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "le fichier %s n'a pas pu être téléchargé\n"
#, c-format
msgid "out of memory!"
msgstr "dépassement de mémoire!"
@@ -212,10 +288,6 @@ msgstr "la suppression de l'entrée de base de données a échoué"
msgid "invalid url for server"
msgstr "URL invalide pour le serveur"
#, c-format
msgid "could not set parameter"
msgstr "définir le paramètre a échoué"
#, c-format
msgid "transaction already initialized"
msgstr "transaction déjà initialisée"
@@ -264,10 +336,6 @@ msgstr "ouverture du fichier paquet impossible"
msgid "cannot load package data"
msgstr "chargement des données du paquet impossible"
#, c-format
msgid "package already installed"
msgstr "paquet déjà installé"
#, c-format
msgid "package not installed or lesser version"
msgstr "paquet non installé ou version plus ancienne"
@@ -277,20 +345,16 @@ msgid "cannot remove all files for package"
msgstr "suppression de certains fichiers du paquet impossible"
#, c-format
msgid "package name is not valid"
msgid "package filename is not valid"
msgstr "nom de paquet invalide"
#, c-format
msgid "corrupted package"
msgstr "paquet corrompu"
#, c-format
msgid "no such repository"
msgstr "ce dépôt n'existe pas"
#, c-format
msgid "corrupted delta"
msgstr "delta corrompu"
msgid "invalid or corrupted delta"
msgstr "delta invalide ou corrompu"
#, c-format
msgid "delta patch failed"
@@ -320,10 +384,6 @@ msgstr "opération annulée par l'utilisateur"
msgid "internal error"
msgstr "erreur interne"
#, c-format
msgid "libarchive error"
msgstr "erreur de libarchive"
#, c-format
msgid "not confirmed"
msgstr "non confirmé"
@@ -333,53 +393,21 @@ msgid "invalid regular expression"
msgstr "expression régulière incorrecte"
#, c-format
msgid "connection to remote host failed"
msgstr "échec de connexion à l'hôte distant "
msgid "libarchive error"
msgstr "erreur de libarchive"
#, c-format
msgid "download library error"
msgstr "erreur de la bibliothèque de téléchargement"
#, c-format
msgid "error invoking external downloader"
msgstr "erreur en invoquant le client externe de téléchargement"
#, c-format
msgid "unexpected error"
msgstr "erreur non prévue"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "l'obtention du hache md5 pour le paquet %s-%s a échoué\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "les 'haches' md5 ne correspondent pas pour le paquet %s-%s\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: force la mise à jour à la version %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: la version locale (%s) est plus récente que %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "l'extraction du fichier de description vers %s a échoué\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "l'analyse du fichier de description a échoué dans %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "nom de paquet manquant dans %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "version de paquet manquante dans %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "erreur lors de la lecture du paquet %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "méta-données du paquet manquantes dans %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "trouver %s dans la base de données a échoué -- ignoré\n"
@@ -396,58 +424,14 @@ msgstr "la suppression de l'entrée de base de données %s-%s a échoué\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "la suppression du cache de l'entrée '%s' a échoué\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "l'url '%s' est invalide, ignorée\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "Le protocole n'a pas été spécifié dans l'url, assume http\n"
#, c-format
msgid "disk"
msgstr "disque"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "échec de récupération du fichier '%s' depuis %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "le téléchargement ne peut pas être repris, relance\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "écriture dans le fichier '%s' impossible\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "erreur lors du téléchargement de '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "écriture dans le fichier '%s' impossible: %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "changer de répertoire vers %s a échoué\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "lancement de XferCommand: le fork a échoué!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "l'URL ne contient pas un fichier à télécharger\n"
#, c-format
msgid "failed to download %s\n"
msgstr "le fichier %s n'a pas pu être téléchargé\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s: ignore la mise à jour du paquet (à remplacer par %s-%s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: la version locale (%s) est plus récente que %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ignore la mise à jour du paquet (%s => %s)\n"
@@ -464,26 +448,22 @@ msgstr "%s-%s est à jour -- ignoré\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s est à jour -- réinstalle\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "retourne à la version antérieure du paquet %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "un conflit de paquets impossible à résoudre a été détecté\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "erreur malloc: n'a pas pu allouer %zd bytes\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "supprime '%s' de la liste de cible car il est en conflit avec '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "commande: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "ne peut obtenir le 'hach' md5 pour le paquet %s\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "l'archive %s était corrompue (mauvaise somme MD5)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "échec de récupération de certains fichiers depuis %s\n"
@@ -533,6 +513,10 @@ msgstr ""
msgid "could not create temp directory\n"
msgstr "la création du répertoire temporaire a échoué\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "la copie du fichier temporaire vers %s a échoué (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "changer de répertoire vers %s a échoué (%s)\n"
@@ -565,10 +549,6 @@ msgstr "le scriptlet n'a pas pu être exécuté correctement\n"
msgid "could not remove tmpdir %s\n"
msgstr "la suppression du répertoire temporaire %s a échoué\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "échec de la création du chemin '%s' : %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "l'ouverture de %s: %s a échoué\n"
@@ -581,10 +561,3 @@ msgstr "le cache %s n'existe pas, création...\n"
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "n'a pas pu créer le cache de paquets, /tmp sera utilisé à la place\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: l'ouverture de %s a échoué\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: la lecture de %s a échoué\n"

View File

@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: hu\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2007-03-14 13:45+0100\n"
"Last-Translator: Nagy Gabor <ngaba@bibl.u-szeged.hu>\n"
"Language-Team: <hu@li.org>\n"
@@ -19,23 +19,23 @@ msgstr ""
#, c-format
msgid "replacing older version %s-%s by %s in target list\n"
msgstr "régebbi verzió (%s-%s) lecserélése %s verzióra a cél listában\n"
msgstr "régebbi verzió (%s-%s) lecserélése %s verzióra a célok listában\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "újabb verzió (%s-%s) már megtalálható a cél listában -- kihagyás\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "%s-%s kihagyása, mert újabb verzió (%s) van a célok között\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
msgstr "ütköző csomagokat találtam a cél listában\n"
msgstr "ütköző csomagokat találtam a célok között\n"
#, c-format
msgid "you cannot install two conflicting packages at the same time\n"
msgstr "nem telepíthető két ütköző csomag egyszerre\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "csomagok lecserélése még nem támogatott -A és -U esetén\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "csomagok lecserélése még nem támogatott -U esetén\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -62,20 +62,16 @@ msgid "could not extract %s (%s)\n"
msgstr "nem sikerült kicsomagolni: %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "nem sikerült átnevezni: %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "nem sikerült az ideiglenes fájlt ide másolni: %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "nem sikerült az átnevezés: %s -> %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s elmentve %s néven\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "nem sikerült %s telepítése %s néven: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "nem sikerült %s telepítése %s néven (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -105,17 +101,49 @@ msgstr "nem sikerült a(z) %s-%s adatbázisbejegyzés frissítése\n"
msgid "could not add entry '%s' in cache\n"
msgstr "sikertelen a '%s' bejegyzés hozzáadása a gyorsítótárhoz\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "sikertelen a %s%s adatbázis-bejegyzés eltávolítása\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "érvénytelen név a '%s' adatbázis-bejegyzés számára\n"
msgstr "hibás név a '%s' adatbázis-bejegyzés számára\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "sérült adatbázis bejegyzés: '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "nem sikerült megnyitni a %s fájlt: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "sikertelen a %s%s adatbázis-bejegyzés eltávolítása\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "a(z) %s adatbázis inkonzisztens: eltérő nevek a(z) %s csomagnál\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "a(z) %s adatbázis inkonzisztens: eltérő verziók a(z) %s csomagnál\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "nem sikerült értelmezni a(z) %s csomagleíró fájlját\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "hiányzó csomagnév itt: %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "hiányzó csomagverzió itt: %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "hiba a(z) %s csomag olvasása közben: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "hiányzó csomaginformációs fájl itt: %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -137,9 +165,57 @@ msgstr "a(z) %s csomag saját %s függősége után lesz eltávolítva\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "a(z) %s csomag saját %s függősége előtt lesz telepítve\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "közvetett csomagválasztás (%s szolgáltatja %s-t)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "nem sikerült a(z) \"%s\" csomag \"%s\" függőségét feloldani\n"
msgstr "nem sikerült a(z) \"%2$s\" csomag \"%1$s\" függőségét feloldani\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "a '%s' URL hibás\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "az URL séma nem definiált, http feltételezése\n"
#, c-format
msgid "disk"
msgstr "diszk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "nem sikerült a(z) '%s' fájlt letölteni a %s helyről : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "nem tudom folytatni a letöltést, újrakezdem\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "nem sikerült a(z) '%s' fájlba írni\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "hiba '%s' letöltése közben: %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "hiba a(z) '%s' fájl írása során: %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "nem sikerült a könyvtárváltás ide: %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "XferCommand futtatása: sikertelen fork!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "nem sikerült a(z) %s letöltése\n"
#, c-format
msgid "out of memory!"
@@ -207,11 +283,7 @@ msgstr "nem sikerült eltávolítani az adatbázis-bejegyzést"
#, c-format
msgid "invalid url for server"
msgstr "érvénytelen szerver-URL"
#, c-format
msgid "could not set parameter"
msgstr "nem sikerült beállítani a paramétert"
msgstr "hibás szerver-URL"
#, c-format
msgid "transaction already initialized"
@@ -251,7 +323,7 @@ msgstr "nem található vagy nem olvasható a csomag"
#, c-format
msgid "invalid or corrupted package"
msgstr "nem érvényes vagy sérült csomag"
msgstr "hibás vagy sérült csomag"
#, c-format
msgid "cannot open package file"
@@ -261,10 +333,6 @@ msgstr "nem sikerült megnyitni a csomagfájlt"
msgid "cannot load package data"
msgstr "nem sikerült betölteni a csomagadatokat"
#, c-format
msgid "package already installed"
msgstr "a csomag már telepítve van"
#, c-format
msgid "package not installed or lesser version"
msgstr "a csomag nincs telepítve vagy kisebb verziójú"
@@ -274,20 +342,16 @@ msgid "cannot remove all files for package"
msgstr "nem sikerült eltávolítani a csomag összes fájlját"
#, c-format
msgid "package name is not valid"
msgstr "nem érvényes a csomagnév"
#, c-format
msgid "corrupted package"
msgstr "sérült csomag"
msgid "package filename is not valid"
msgstr "érvénytelen csomagnév"
#, c-format
msgid "no such repository"
msgstr "nincs ilyen repó"
#, c-format
msgid "corrupted delta"
msgstr "sérült delta"
msgid "invalid or corrupted delta"
msgstr "hibás vagy sérült delta"
#, c-format
msgid "delta patch failed"
@@ -317,66 +381,30 @@ msgstr "felhasználói megszakítás"
msgid "internal error"
msgstr "belső hiba"
#, c-format
msgid "libarchive error"
msgstr "libarchive hiba"
#, c-format
msgid "not confirmed"
msgstr "nem megerősített"
#, c-format
msgid "invalid regular expression"
msgstr "érvénytelen reguláris kifejezés"
msgstr "hibás reguláris kifejezés"
#, c-format
msgid "connection to remote host failed"
msgstr "nem sikerült csatlakozni a távoli géphez"
msgid "libarchive error"
msgstr "libarchive hiba"
#, c-format
msgid "download library error"
msgstr "letöltőkönyvtár hiba"
#, c-format
msgid "error invoking external downloader"
msgstr "hiba a külső letöltő meghívásakor"
#, c-format
msgid "unexpected error"
msgstr "nemvárt hiba"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "nem sikerült meghatározni a(z) %s-%s csomag md5 ellenőrző összegét\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "a(z) %s-%s csomag md5 ellenőrző összegei nem egyeznek meg\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: erőltetett frissítés a %s verzióra\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: a helyi (%s) újabb, mint %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "nem sikerült kicsomagolni a csomagleíró fájlt %s-ként\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "nem sikerült értelmezni a(z) %s csomagleíró fájlját\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "hiányzó csomagnév itt: %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "hiányzó csomagverzió itt: %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "hiba a(z) %s csomag olvasása közben: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "hiányzó csomaginformációs fájl itt: %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "nem található a(z) %s az adatbázisban -- kihagyás\n"
@@ -393,58 +421,14 @@ msgstr "nem sikerült eltávolítani a(z) %s-%s adatbázis-bejegyzést\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "nem sikerült eltávolítani a(z) '%s' bejegyzést a gyorsítótárból\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "a '%s' URL érvénytelen, figyelmen kívül hagyom\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "az URL séma nem definiált, http feltételezése\n"
#, c-format
msgid "disk"
msgstr "diszk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "nem sikerült a(z) '%s' fájlt letölteni a %s helyről : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "nem tudom folytatni a letöltést, újrakezdem\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "nem sikerült a(z) '%s' fájlba írni\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "hiba '%s' letöltése közben: %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "hiba a(z) '%s' fájl írása során: %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "nem sikerült a könyvtárváltás ide: %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "XferCommand futtatása: sikertelen fork!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "az URL nem tartalmaz letöltendő fájlt\n"
#, c-format
msgid "failed to download %s\n"
msgstr "nem sikerült a(z) %s letöltése\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s: csomagfrissítés kihagyása (a(z) %s-%s le fogja cserélni)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: a helyi (%s) újabb, mint %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: csomagfrissítés kihagyása (%s => %s)\n"
@@ -461,26 +445,22 @@ msgstr "a(z) %s-%s naprakész -- kihagyás\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "a(z) %s-%s naprakész -- újratelepítés\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "visszatérés egy régebbi %s verzióhoz (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "feloldhatatlan csomagütközéseket találtam\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "malloc hiba: nem sikerült lefoglalni %zd byte-ot\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "'%s' kihagyása, mert ütközik a következővel: '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "parancs: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "nem sikerült meghatározni a(z) %s fájl md5 ellenőrző összegét\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "a(z) %s fájl sérült volt (rossz MD5 összeg)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "nem sikerült néhány fájlt letölteni innen: %s\n"
@@ -529,6 +509,10 @@ msgstr "Nincs /bin/sh a szülő környezetben, szkript megszakítása\n"
msgid "could not create temp directory\n"
msgstr "nem sikerült létrehozni az ideiglenes könyvtárat\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "nem sikerült az ideiglenes fájlt ide másolni: %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "nem sikerült a könyvtárváltás ide: %s (%s)\n"
@@ -561,10 +545,6 @@ msgstr "a szkript hibásan futott\n"
msgid "could not remove tmpdir %s\n"
msgstr "nem sikerült eltávolítani a %s ideiglenes könyvtárat\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "nem sikerült a '%s' útvonal létrehozása: %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "nem sikerült megnyitni a %s fájlt: %s\n"
@@ -576,11 +556,3 @@ msgstr "nem létezik a(z) %s gyorsítótár. létrehozás...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "nem sikerült létrehozni a csomaggyorsítótárat, a /tmp használata\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: nem sikerült megnyitni a következőt: %s\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: nem sikerült olvasni a következőt: %s\n"

View File

@@ -1,29 +1,30 @@
# Italian translation of libalpm.
# Copyright (C) 2007 THE libalpm'S COPYRIGHT HOLDER
# This file is distributed under the same license as the libalpm package.
# Giovanni 'voidnull' Scafora <linuxmania@gmail.com>, 2007.
# Alessio 'mOLOk' Bolognino <themolok@gmail.com>, 2007.
# Lorenzo '^zanDarK' Masini <lorenxo86@gmail.com>, 2007.
# Giovanni 'voidnull' Scafora <linuxmania@gmail.com>, 2007, 2008
# Andrea 'bash' Scarpino <bash.lnx@gmail.com>, 2008
# Alessio 'mOLOk' Bolognino <themolok@gmail.com>, 2007
# Lorenzo '^zanDarK' Masini <lorenxo86@gmail.com>, 2007
#
msgid ""
msgstr ""
"Project-Id-Version: libalpm VERSION\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2007-12-18 23:30+0100\n"
"Last-Translator: Giovanni Scafora <linuxmania@gmail.com>\n"
"Language-Team: Arch Linux Italian Team <linuxmania@gmail.com>\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-23 19:30+0200\n"
"Last-Translator: Giovanni Scafora <giovanni@archlinux.org>\n"
"Language-Team: Arch Linux Italian Team <giovanni@archlinux.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bitPlural-Forms: nplurals=2; plural=(n != 1);\n"
"Content-Transfer-Encoding: 8bit\n"
#, c-format
msgid "replacing older version %s-%s by %s in target list\n"
msgstr "sostituzione in corso della vecchia versione di %s-%s con %s\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "la versione di %s-%s è più recente e sarà ignorata\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "salto %s-%s perché la nuova versione %s è nella lista\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
@@ -34,8 +35,8 @@ msgid "you cannot install two conflicting packages at the same time\n"
msgstr "impossibile installare due pacchetti che vanno in conflitto\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "la sostituzione dei pacchetti con -A e -U non è ancora supportata\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "la sostituzione dei pacchetti con -U non è ancora supportata\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -63,20 +64,16 @@ msgid "could not extract %s (%s)\n"
msgstr "impossibile estrarre %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "impossibile rinominare %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "impossibile copiare il file temporaneo in %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "impossibile rinominare %s in %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s salvato come %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "impossibile installare %s come %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "impossibile installare %s come %s (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -106,17 +103,49 @@ msgstr "impossibile aggiornare la voce %s-%s nel database\n"
msgid "could not add entry '%s' in cache\n"
msgstr "impossible includere la voce '%s' nella cache\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "impossibile rimuovere la voce %s%s dal database\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "nome non valido per la voce del database '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "la voce nel database '%s' non è valida\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "impossibile aprire il file %s: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "impossibile rimuovere la voce %s%s dal database\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "il database %s è corrotto: il nome del pacchetto %s è sbagliato\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "il database %s è corrotto: la versione del pacchetto %s è sbagliata\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "impossibile analizzare il file di descrizione del pacchetto in %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "manca il nome del pacchetto in %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "manca la versione del pacchetto in %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "si è verificato un errore durante la lettura del pacchetto %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "manca il metadata del pacchetto in %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -138,10 +167,58 @@ msgstr "%s sarà rimosso dopo la sua dipendenza %s\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "%s sarà installato prima della sua dipendenza %s\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "il pacchetto fornito era selezionato (%s fornisce %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "impossibile risolvere \"%s\", una dipendenza di \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "l'url '%s' non è corretto\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "il protocollo dell'url non è specificato, sarà usato HTTP\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "impossibile recuperare il file '%s' da %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "impossibile riprendere il download\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "impossibile scrivere nel file '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "si è verificato un errore durante il download di '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "si è verificato un errore durante la scrittura nel file '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "impossibile spostarsi nella directory %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "avvio di XferCommand: processo non riuscito!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "impossibile scaricare %s\n"
#, c-format
msgid "out of memory!"
msgstr "memoria insufficiente!"
@@ -210,10 +287,6 @@ msgstr "impossibile rimuovere la voce dal database"
msgid "invalid url for server"
msgstr "url non valido per il server"
#, c-format
msgid "could not set parameter"
msgstr "impossibile impostare il parametro"
#, c-format
msgid "transaction already initialized"
msgstr "operazione già inizializzata"
@@ -262,10 +335,6 @@ msgstr "impossibile aprire il pacchetto"
msgid "cannot load package data"
msgstr "impossibile caricare i dati del pacchetto"
#, c-format
msgid "package already installed"
msgstr "pacchetto già installato"
#, c-format
msgid "package not installed or lesser version"
msgstr "pacchetto non installato o una versione precedente"
@@ -275,20 +344,16 @@ msgid "cannot remove all files for package"
msgstr "impossibile rimuovere tutti i file del pacchetto"
#, c-format
msgid "package name is not valid"
msgid "package filename is not valid"
msgstr "il nome del pacchetto non è valido"
#, c-format
msgid "corrupted package"
msgstr "pacchetto corrotto"
#, c-format
msgid "no such repository"
msgstr "nessun repository corrispondente"
#, c-format
msgid "corrupted delta"
msgstr "il delta è corrotto"
msgid "invalid or corrupted delta"
msgstr "delta non valido o corrotto"
#, c-format
msgid "delta patch failed"
@@ -318,10 +383,6 @@ msgstr "operazione annullata"
msgid "internal error"
msgstr "errore interno"
#, c-format
msgid "libarchive error"
msgstr "errore di libarchive"
#, c-format
msgid "not confirmed"
msgstr "non confermato"
@@ -331,54 +392,21 @@ msgid "invalid regular expression"
msgstr "espressione regolare non valida"
#, c-format
msgid "connection to remote host failed"
msgstr "impossibile stabilire una connessione con l'host remoto"
msgid "libarchive error"
msgstr "errore di libarchive"
#, c-format
msgid "download library error"
msgstr "si è verificato un errore della libreria durante il download"
#, c-format
msgid "error invoking external downloader"
msgstr "errore nell'inizializzare il download"
#, c-format
msgid "unexpected error"
msgstr "errore inaspettato"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "impossibile recuperare la somma md5 del pacchetto %s-%s\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "la somma md5 del pacchetto %s-%s non corrisponde\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: aggiornamento forzato alla versione %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr ""
"%s: la versione installata (%s) è più recente di quella presente in %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "impossibile estrarre il file di descrizione del pacchetto in %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "impossibile analizzare il file di descrizione del pacchetto in %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "manca il nome del pacchetto in %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "manca la versione del pacchetto in %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "si è verificato un errore durante la lettura del pacchetto %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "manca il metadata del pacchetto in %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "impossibile trovare %s nel database, sarà ignorato\n"
@@ -395,60 +423,17 @@ msgstr "impossibile rimuovere la voce %s-%s dal database\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "impossibile rimuovere la voce '%s' dalla cache\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "l'url '%s' non è corretto, sarà ignorato\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "il protocollo dell'url non è specificato, sarà usato http\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "impossibile recuperare il file '%s' da %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "impossibile riprendere il download\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "impossibile scrivere nel file '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "si è verificato un errore durante il download di '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "si è verificato un errore durante la scrittura nel file '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "impossibile spostarsi nella directory %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "avvio di XferCommand: processo non riuscito!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "URL non contiene nessun file da scaricare\n"
#, c-format
msgid "failed to download %s\n"
msgstr "impossibile scaricare %s\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr ""
"%s-%s: aggiornamento del pacchetto ignorato (per essere sostituito con %s-%"
"s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr ""
"%s: la versione installata (%s) è più recente di quella presente in %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: aggiornamento del pacchetto ignorato (%s => %s)\n"
@@ -465,26 +450,24 @@ msgstr "%s-%s è aggiornato, sarà ignorato\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s è aggiornato, sarà reinstallato\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr ""
"installazione in corso di una versione meno recente del pacchetto %s (%s => %"
"s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "sono stati rilevati dei conflitti irrisolvibili\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "malloc failure: impossibile allocare %zd byte\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "rimozione di '%s' dalla lista perché va in conflitto con '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "comando: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "impossibile recuperare il checksum md5 del file %s\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "il file %s è corrotto (MD5 errato)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "impossibile recuperare alcuni file da %s\n"
@@ -533,6 +516,10 @@ msgstr "/bin/sh non è presente nell'ambiente, lo scriptlet sarà interrotto\n"
msgid "could not create temp directory\n"
msgstr "impossibile creare la directory temporanea\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "impossibile copiare il file temporaneo in %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "impossibile spostarsi nella directory %s (%s)\n"
@@ -565,10 +552,6 @@ msgstr "L'esecuzione dello scriptlet non è riuscita correttamente\n"
msgid "could not remove tmpdir %s\n"
msgstr "impossibile rimuovere la directory temporanea %s\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "impossibile seguire il percorso '%s' : %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "impossibile aprire %s: %s\n"
@@ -581,29 +564,3 @@ msgstr "la cache di %s non esiste, creazione in corso...\n"
msgid "couldn't create package cache, using /tmp instead\n"
msgstr ""
"impossibile creare la cache del pacchetto, al suo posto sarà usata /tmp\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: impossibile aprire %s\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: impossibile leggere %s\n"
#~ msgid "loading package data for %s : level=%d\n"
#~ msgstr "caricamento in corso dei dati del pacchetto %s : livello=%d\n"
#~ msgid "adding '%s' to package cache for db '%s'\n"
#~ msgstr "aggiunta di '%s' alla cache del pacchetto per il database '%s'\n"
#~ msgid "could not remove tempfile %s\n"
#~ msgstr "impossibile rimuovere il file temporaneo %s\n"
#~ msgid "please remove '%s' first, using -Rd\n"
#~ msgstr "Si consiglia di rimuovere prima '%s', usando l'opzione -Rd\n"
#~ msgid "cannot resolve dependencies for \"%s\"\n"
#~ msgstr "impossibile risolvere le dipendenze per \"%s\"\n"
#~ msgid "could not update new database entry %s-%s\n"
#~ msgstr "impossibile aggiornare la nuova voce del database %s-%s\n"

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -21,7 +21,7 @@ msgid "replacing older version %s-%s by %s in target list\n"
msgstr ""
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr ""
#, c-format
@@ -33,7 +33,7 @@ msgid "you cannot install two conflicting packages at the same time\n"
msgstr ""
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr ""
#, c-format
@@ -59,11 +59,7 @@ msgid "could not extract %s (%s)\n"
msgstr ""
#, c-format
msgid "could not rename %s (%s)\n"
msgstr ""
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr ""
#, c-format
@@ -71,7 +67,7 @@ msgid "%s saved as %s\n"
msgstr ""
#, c-format
msgid "could not install %s as %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr ""
#, c-format
@@ -102,16 +98,48 @@ msgstr ""
msgid "could not add entry '%s' in cache\n"
msgstr ""
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr ""
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr ""
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr ""
#, c-format
msgid "could not open file %s: %s\n"
msgstr ""
#, c-format
msgid "could not remove database entry %s%s\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr ""
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr ""
#, c-format
msgid "could not parse package description file in %s\n"
msgstr ""
#, c-format
msgid "missing package name in %s\n"
msgstr ""
#, c-format
msgid "missing package version in %s\n"
msgstr ""
#, c-format
msgid "error while reading package %s: %s\n"
msgstr ""
#, c-format
msgid "missing package metadata in %s\n"
msgstr ""
#, c-format
@@ -134,10 +162,58 @@ msgstr ""
msgid "%s will be installed before its %s dependency\n"
msgstr ""
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr ""
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr ""
#, c-format
msgid "url '%s' is invalid\n"
msgstr ""
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr ""
#, c-format
msgid "disk"
msgstr ""
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr ""
#, c-format
msgid "cannot resume download, starting over\n"
msgstr ""
#, c-format
msgid "cannot write to file '%s'\n"
msgstr ""
#, c-format
msgid "error downloading '%s': %s\n"
msgstr ""
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr ""
#, c-format
msgid "could not chdir to %s\n"
msgstr ""
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr ""
#, c-format
msgid "failed to download %s\n"
msgstr ""
#, c-format
msgid "out of memory!"
msgstr ""
@@ -206,10 +282,6 @@ msgstr ""
msgid "invalid url for server"
msgstr ""
#, c-format
msgid "could not set parameter"
msgstr ""
#, c-format
msgid "transaction already initialized"
msgstr ""
@@ -258,10 +330,6 @@ msgstr ""
msgid "cannot load package data"
msgstr ""
#, c-format
msgid "package already installed"
msgstr ""
#, c-format
msgid "package not installed or lesser version"
msgstr ""
@@ -271,11 +339,7 @@ msgid "cannot remove all files for package"
msgstr ""
#, c-format
msgid "package name is not valid"
msgstr ""
#, c-format
msgid "corrupted package"
msgid "package filename is not valid"
msgstr ""
#, c-format
@@ -283,7 +347,7 @@ msgid "no such repository"
msgstr ""
#, c-format
msgid "corrupted delta"
msgid "invalid or corrupted delta"
msgstr ""
#, c-format
@@ -314,10 +378,6 @@ msgstr ""
msgid "internal error"
msgstr ""
#, c-format
msgid "libarchive error"
msgstr ""
#, c-format
msgid "not confirmed"
msgstr ""
@@ -327,53 +387,21 @@ msgid "invalid regular expression"
msgstr ""
#, c-format
msgid "connection to remote host failed"
msgid "libarchive error"
msgstr ""
#, c-format
msgid "download library error"
msgstr ""
#, c-format
msgid "error invoking external downloader"
msgstr ""
#, c-format
msgid "unexpected error"
msgstr ""
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr ""
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr ""
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr ""
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr ""
#, c-format
msgid "error extracting package description file to %s\n"
msgstr ""
#, c-format
msgid "could not parse package description file in %s\n"
msgstr ""
#, c-format
msgid "missing package name in %s\n"
msgstr ""
#, c-format
msgid "missing package version in %s\n"
msgstr ""
#, c-format
msgid "error while reading package %s: %s\n"
msgstr ""
#, c-format
msgid "missing package metadata in %s\n"
msgstr ""
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr ""
@@ -390,58 +418,14 @@ msgstr ""
msgid "could not remove entry '%s' from cache\n"
msgstr ""
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr ""
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr ""
#, c-format
msgid "disk"
msgstr ""
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr ""
#, c-format
msgid "cannot resume download, starting over\n"
msgstr ""
#, c-format
msgid "cannot write to file '%s'\n"
msgstr ""
#, c-format
msgid "error downloading '%s': %s\n"
msgstr ""
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr ""
#, c-format
msgid "could not chdir to %s\n"
msgstr ""
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr ""
#, c-format
msgid "URL does not contain a file for download\n"
msgstr ""
#, c-format
msgid "failed to download %s\n"
msgstr ""
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr ""
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr ""
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr ""
@@ -458,26 +442,22 @@ msgstr ""
msgid "%s-%s is up to date -- reinstalling\n"
msgstr ""
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr ""
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr ""
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr ""
#, c-format
msgid "command: %s\n"
msgstr ""
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr ""
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr ""
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr ""
@@ -526,6 +506,10 @@ msgstr ""
msgid "could not create temp directory\n"
msgstr ""
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr ""
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr ""
@@ -558,10 +542,6 @@ msgstr ""
msgid "could not remove tmpdir %s\n"
msgstr ""
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr ""
#, c-format
msgid "could not open %s: %s\n"
msgstr ""
@@ -573,11 +553,3 @@ msgstr ""
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr ""
#, c-format
msgid "md5: %s can't be opened\n"
msgstr ""
#, c-format
msgid "md5: %s can't be read\n"
msgstr ""

View File

@@ -9,8 +9,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Pacman package manager 3.0.1\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2008-02-25 22:16+0100\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-07-19 20:58+0200\n"
"Last-Translator: Mateusz Herych <heniekk@gmail.com>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
@@ -24,8 +24,8 @@ msgid "replacing older version %s-%s by %s in target list\n"
msgstr "zastępowanie starszej wersji %s-%s na %s z listy celów\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "nowsza wersja %s-%s znajduje się w liście celów -- pomijam\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "pomijam %s-%s ponieważ na liście celów znajduje się nowsza wersja %s\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
@@ -39,9 +39,10 @@ msgstr ""
"samym czasie\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "zastępowanie pakietów za pomocą -A i -U nie jest jeszcze wspierane\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "zastępowanie pakietów za pomocą -U nie jest j wspierane\n"
# hmm
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
msgstr "możesz zastąpić pakiety ręcznie, używając opcji -Rd oraz -U\n"
@@ -67,20 +68,16 @@ msgid "could not extract %s (%s)\n"
msgstr "nie udało się rozpakować %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "nie udało się zmienić nazwy %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "nie udało się skopiować pliku tymczasowego do %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "nie udało się zmienić nazwy %s na %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s zachowane jako %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "nie udało się zainstalować %s jako %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "nie udało się zainstalować %s jako %s (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -110,17 +107,49 @@ msgstr "nie udało się zaktualizować pozycji bazy danych %s-%s\n"
msgid "could not add entry '%s' in cache\n"
msgstr "nie udało się dodać pozycji '%s' w pliku podręcznym\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "nie udało się usunąć wpisu %s%s z bazy danych\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "nieprawidłowa nazwa dla wpisu bazy danych '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "zepsuty wpis w bazie danych '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "nie udało się otworzyć pliku %s: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "nie udało się usunąć wpisu %s%s z bazy danych\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "baza danych %s jest sprzeczna: niedopasowana nazwa w pakiecie %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "baza danych %s jest sprzeczna: niedopasowana wersja w pakiecie %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "nie udało się przeczytać opisu pliku w %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "brak nazwy pakietu w %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "brak wersji pakietu w %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "błąd odczytywania pakietu: %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "brak metadanych pakietu w %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -142,10 +171,58 @@ msgstr "%s zostanie usunięta po zależniościach %s\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "%s zostanie zainstalowane przed zależnościami %s\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "dostawca pakietu został wybrany (%s dostarcza %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "nie można rozwiązać \"%s\", zależności od \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' jest błędny\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "schemat url nie został sprecyzowany, wybieranie HTTP\n"
#, c-format
msgid "disk"
msgstr "dysk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "nie udało się pobrać pliku '%s' z %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "nie można kontynuować pobieranie, zaczynanie od początku\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "nie można zapisywać do pliku '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "błąd podczas pobierania '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "Błąd podczas zapisywania do pliku '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "nie udało się zmienić katalogu na / %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "uruchamianie XferCommand: klonowanie nieudane!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "nie udało się pobrać %s\n"
#, c-format
msgid "out of memory!"
msgstr "brak pamięci!"
@@ -214,10 +291,6 @@ msgstr "nie udało się usunąć wpisu do bazy danych"
msgid "invalid url for server"
msgstr "nieprawidłowy url dla serwera"
#, c-format
msgid "could not set parameter"
msgstr "nie udało się ustawić parametru"
#, c-format
msgid "transaction already initialized"
msgstr "tranzakcja została już zainicjowana"
@@ -266,10 +339,6 @@ msgstr "nie udało się otworzyć pliku pakietu"
msgid "cannot load package data"
msgstr "nie udało się załadować danych pakietu"
#, c-format
msgid "package already installed"
msgstr "pakiet został już zainstalowany"
#, c-format
msgid "package not installed or lesser version"
msgstr "pakiet nie zainstalowany lub zainstalowany w niższej wersji"
@@ -279,20 +348,16 @@ msgid "cannot remove all files for package"
msgstr "nie udało się usunąć wszystkich plików pakietu"
#, c-format
msgid "package name is not valid"
msgstr "nieprawidłowa nazwa pakietu"
#, c-format
msgid "corrupted package"
msgstr "uszkodzony pakiet"
msgid "package filename is not valid"
msgstr "nazwa pakietu jest nieprawidłowa"
#, c-format
msgid "no such repository"
msgstr "nie ma takiego repozytorium"
#, c-format
msgid "corrupted delta"
msgstr "Pakiet przyrostowy jest uszkodzony"
msgid "invalid or corrupted delta"
msgstr "nieprawidłowy bądź uszkodzony pakiet przyrostowy"
#, c-format
msgid "delta patch failed"
@@ -322,10 +387,6 @@ msgstr "użytkownik zaniechał operacji"
msgid "internal error"
msgstr "błąd wewnętrzny"
#, c-format
msgid "libarchive error"
msgstr "błąd libarchive"
#, c-format
msgid "not confirmed"
msgstr "nie potwierdzono"
@@ -335,53 +396,22 @@ msgid "invalid regular expression"
msgstr "nieprawidłowe wyrażenie regularne"
#, c-format
msgid "connection to remote host failed"
msgstr "połączenie ze zdalnym hostem nieudane"
msgid "libarchive error"
msgstr "błąd libarchive"
#, c-format
msgid "download library error"
msgstr "błąd pobierania biblioteki"
#, c-format
msgid "error invoking external downloader"
msgstr ""
"wystąpił błąd podczas odwoływania się do zewnętrznego programu pobierającego"
#, c-format
msgid "unexpected error"
msgstr "niespodziewany błąd"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "nie udało się otrzymać sumy md5 dla pakietu %s-%s\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "sumy kontrolne md5 dla pakietu %s-%s nie zgadzają się\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: wymuszanie aktualizacji do wersji %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: local (%s) jest nowsze niż %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "nie udało się przeczytać opisu do %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "nie udało się przeczytać opisu pliku w %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "brak nazwy pakietu w %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "brak wersji pakietu w %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "błąd odczytywania pakietu: %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "brak metadanych pakietu w %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "nie udało się odnaleźć %s w bazie danych -- pomijanie\n"
@@ -398,59 +428,15 @@ msgstr "nie udało się usunąć wpisu %s-%s z bazy danych\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "nie udało się usunąć wpisu '%s' z pamięci podręcznej\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "url '%s' jest błędny, ignoruję\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "schemat url nie został sprecyzowany, wybieranie http\n"
#, c-format
msgid "disk"
msgstr "dysk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "nie udało się pobrać pliku '%s' z %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "nie można kontynuować pobieranie, zaczynanie od początku\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "nie można zapisywać do pliku '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "błąd podczas pobierania '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "Błąd podczas zapisywania do pliku '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "nie udało się zmienić katalogu na / %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "uruchamianie XferCommand: klonowanie nieudane!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "URL nie wskazuje na plik do pobrania\n"
#, c-format
msgid "failed to download %s\n"
msgstr "nie udało się pobrać %s\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr ""
"%s-%s: ignorowanie aktualizowania pakietu (do zastąpienia przez %s-%s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: local (%s) jest nowsze niż %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ignorowanie aktualizacji pakietu (%s => %s)\n"
@@ -467,26 +453,22 @@ msgstr "%s-%s jest w najnowszej wersji -- pomijanie\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s jest w najnowszej wersji -- ponowne instalowanie\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "dezaktualizowanie pakietu %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "odkryto nierozwiązywalne konflikty pakietów\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "błąd malloc: nie udało się zaalokować %zd bajtów\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "usuwanie '%s' z listy celów ponieważ konfliktuje z '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "komenda: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "nie udało się otrzymać sum kontrolnych md5 dla pliku %s\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "plik %s był uszkodzony (błąd sumy kontrolnej MD5)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "nie udało się pobrać niektórych plików z %s\n"
@@ -535,6 +517,10 @@ msgstr "Brak /bin/sh w środowisku, przerywanie wykonywania skryptu\n"
msgid "could not create temp directory\n"
msgstr "nie udało się stworzyć katalogu tymczasowego\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "nie udało się skopiować pliku tymczasowego do %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "nie udało się zmienić katalogu na %s (%s)\n"
@@ -567,10 +553,6 @@ msgstr "skrypt nie mógł zostać poprawnie wykonany\n"
msgid "could not remove tmpdir %s\n"
msgstr "nie udało się usunąć katalogu tymczasowego %s\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "nie udało się stworzyć ścieżki '%s' : %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "nie udało się otworzyć %s: %s\n"
@@ -584,56 +566,3 @@ msgid "couldn't create package cache, using /tmp instead\n"
msgstr ""
"nie udało się stworzyć pamięci podręcznej pakietu, używanie /tmp w zamian\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: %s nie może zostać otwarte\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: %s nie może zostać przeczytane\n"
#, fuzzy
#~ msgid "loading package data for %s : level=%d\n"
#~ msgstr "ładowanie danych pakietu dla %s : poziom=%d"
#, fuzzy
#~ msgid "adding '%s' to package cache for db '%s'\n"
#~ msgstr "dodawanie '%s' do pamięci podręcznej pakietów dla bd '%s'"
#, fuzzy
#~ msgid "could not remove tempfile %s\n"
#~ msgstr "nie udało się usunąć pliku tymczasowego %s"
#~ msgid "please remove '%s' first, using -Rd"
#~ msgstr "proszę usunąć pierw '%s', korzystając z -Rd"
#~ msgid "could not extract %s (%s)"
#~ msgstr "nie udało się rozpakować %s (%s)"
#~ msgid "could not update provision '%s' from '%s'"
#~ msgstr "nie udało się zaktualizować zasobu '%s' z '%s'"
#, fuzzy
#~ msgid "%s: description file is missing"
#~ msgstr "%s: błąd składni w pliku opisu linia %d"
#~ msgid "malloc failed: could not allocate %d bytes"
#~ msgstr "błąd malloc: nie udało się zaalokować %d bajtów"
#~ msgid ""
#~ "cannot resolve dependencies for \"%s\" (\"%s\" is not in the package set)"
#~ msgstr ""
#~ "nie udało się rozwiązać zależności dla \"%s\" (\"%s\" nie znajduje się w "
#~ "zbiorze pakietów)"
#~ msgid "cannot canonicalize specified root path '%s'"
#~ msgstr "nie udało się skanonizować podanej ścieżki docelowej '%s'"
#~ msgid "cannot remove file %s: %s"
#~ msgstr "nie udało się usunąć pliku %s: %s"
#~ msgid "sha1: %s can't be opened\n"
#~ msgstr "sha1: %s nie może zostać otwarty\n"
#~ msgid "could not update new database entry %s-%s"
#~ msgstr "nie udało się zaktualizować nowego wpisu %s-%s w bazie danych"

View File

@@ -3,43 +3,49 @@
# Copyright (C) 2002-2007 Judd Vinet <jvinet@zeroflux.org>
# This file is distributed under the same license as the Pacman package manager package.
# Lincoln de Sousa <lincoln@archlinux-br.org>, 2007.
# Hugo Doria <hugodoria@archlinux-br.org>, 2008.
# Hugo Doria <hugodoria@archlinux-br.org>, 2007-2008.
# Douglas Soares de Andrade <dsandrade@gmail.com>, 2008.
# João Felipe Santos <jfsantos@archlinux-br.org>, 2008.
# Kayo Hamid <kayohf@archlinux-br.org>, 2008
# Armando M. Baratti <ambaratti@archlinux-br.org>, 2008.
#
msgid ""
msgstr ""
"Project-Id-Version: pt_BR\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2008-01-18 08:04-0200\n"
"Last-Translator: João Felipe Santos <jfsantos@archlinux-br.org>\n"
"Language-Team: Português do Brasil <contato@archlinux-br.org>\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-24 11:24-0300\n"
"Last-Translator: Hugo Doria <hugo@archlinux.org>\n"
"Language-Team: Português do Brasil <www.archlinux-br.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#, c-format
msgid "replacing older version %s-%s by %s in target list\n"
msgstr "substituindo a versão antiga %s-%s por %s na lista de alvos\n"
msgstr ""
"substituindo a versão antiga %s-%s por %s na lista de pacotes a serem "
"atualizados\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "versão atualizada %s-%s está na lista de alvos -- pulando\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr ""
"ignorando %s-%s porque uma nova versão %s está na lista de pacotes a serem "
"atualizados\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
msgstr "pacotes conflitantes foram encontrados na lista de alvos\n"
msgstr ""
"pacotes conflitantes foram encontrados na lista de pacotes a serem "
"atualizados\n"
#, c-format
msgid "you cannot install two conflicting packages at the same time\n"
msgstr "você não pode instalar dois pacotes conflitantes ao mesmo tempo\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "substituir pacotes com -A e -U ainda não é suportado\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "substituir pacotes com -U ainda não é suportado\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -66,20 +72,16 @@ msgid "could not extract %s (%s)\n"
msgstr "não foi possível extrair %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "não foi possível renomear %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "não foi possível copiar arquivo temporário para %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "não foi possível renomear %s para %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s salvo como %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "não foi possível instalar %s como %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "não foi possível instalar %s como %s: (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -109,21 +111,54 @@ msgstr "não foi possível atualizar a entrada na base de dados %s-%s\n"
msgid "could not add entry '%s' in cache\n"
msgstr "não foi possível adicionar a entrada '%s' ao cache\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "não foi possível remover a entrada da base de dados %s%s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "nome inválido para a entrada na base de dados '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "entrada corrompida na base de dados '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "não foi possível abrir o arquivo %s: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "não foi possível remover a entrada da base de dados %s%s\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "%s base de dados está inconsistente: nome no pacote %s não coincide\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr ""
"%s base de dados está inconsistente: versão no pacote %s não coincide\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "não foi possível interpretar o arquivo de descrição do pacote em %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "faltando o nome do pacote em %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "faltando a versão do pacote em %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "erro ao ler o pacote %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "faltando metadata do pacote em %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
msgstr "tentativa de re-registrar a base de dados 'local'\n"
msgstr "tentativa de registrar a base de dados 'local' novamente\n"
#, c-format
msgid "database path is undefined\n"
@@ -141,10 +176,58 @@ msgstr "%s será removido após sua dependência %s\n"
msgid "%s will be installed before its %s dependency\n"
msgstr "%s será instalado antes de sua dependência %s\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "pacote provedor foi selecionado (%s provê %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "não é possível resolver \"%s\", uma dependência de \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' é inválida\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "esquema da url não especificado, assumindo HTTP\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "falha ao obter arquivo '%s' de %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "não foi possível resumir o download, reiniciando\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "não foi possível escrever no arquivo '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "erro no download de '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "erro ao escrever no arquivo '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "não foi possível mudar para o diretório %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "rodando XferCommand: fork falhou!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "falha ao fazer o download de %s\n"
#, c-format
msgid "out of memory!"
msgstr "sem memória!"
@@ -167,7 +250,7 @@ msgstr "não foi possível encontrar ou ler o diretório"
#, c-format
msgid "wrong or NULL argument passed"
msgstr "argumento errado ou NULO passado"
msgstr "argumento passo está errado ou NULO"
#, c-format
msgid "library not initialized"
@@ -213,10 +296,6 @@ msgstr "não foi possível remover a entrada da base de dados"
msgid "invalid url for server"
msgstr "url inválida para servidor"
#, c-format
msgid "could not set parameter"
msgstr "não foi possível setar parâmetro"
#, c-format
msgid "transaction already initialized"
msgstr "transação já inicializada"
@@ -227,7 +306,7 @@ msgstr "transação não inicializada"
#, c-format
msgid "duplicate target"
msgstr "alvo duplicado"
msgstr "pacote duplicado"
#, c-format
msgid "transaction not prepared"
@@ -265,10 +344,6 @@ msgstr "não foi possível abrir arquivo do pacote"
msgid "cannot load package data"
msgstr "não foi possível carregar dados do pacote"
#, c-format
msgid "package already installed"
msgstr "pacote já instalado"
#, c-format
msgid "package not installed or lesser version"
msgstr "pacote não instalado ou versão inferior"
@@ -278,20 +353,16 @@ msgid "cannot remove all files for package"
msgstr "não foi possível remover todos os arquivos para o pacote"
#, c-format
msgid "package name is not valid"
msgstr "o nome do pacote não é valido"
#, c-format
msgid "corrupted package"
msgstr "pacote corrompido"
msgid "package filename is not valid"
msgstr "o nome do arquivo do pacote não é valido"
#, c-format
msgid "no such repository"
msgstr "repositório não existe"
#, c-format
msgid "corrupted delta"
msgstr "delta corrompido"
msgid "invalid or corrupted delta"
msgstr "delta inválido ou corrompido"
#, c-format
msgid "delta patch failed"
@@ -321,10 +392,6 @@ msgstr "usuário abortou a operação"
msgid "internal error"
msgstr "erro interno"
#, c-format
msgid "libarchive error"
msgstr "erro da libarchive"
#, c-format
msgid "not confirmed"
msgstr "não confirmado"
@@ -334,53 +401,21 @@ msgid "invalid regular expression"
msgstr "expressão regular inválida"
#, c-format
msgid "connection to remote host failed"
msgstr "conexão ao host remoto falhou"
msgid "libarchive error"
msgstr "erro da libarchive"
#, c-format
msgid "download library error"
msgstr "erro na biblioteca de download"
#, c-format
msgid "error invoking external downloader"
msgstr "erro invocando programa de download externo"
#, c-format
msgid "unexpected error"
msgstr "erro inesperado"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "não foi possível obter a soma md5 para o pacote %s-%s\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "somas md5 não coincidem para o pacote %s-%s\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: forçando upgrade para a versão %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: local (%s) é mais novo que %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "erro ao extrair o arquivo de descrição do pacote para %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "não foi possível interpretar o arquivo de descrição do pacote em %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "faltando o nome do pacote em %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "faltando a versão do pacote em %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "erro ao ler o pacote %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "faltando metadata do pacote em %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "não foi possível encontrar %s na base de dados - pulando\n"
@@ -397,61 +432,17 @@ msgstr "não foi possível remover a entrada da base de dados %s-%s\n"
msgid "could not remove entry '%s' from cache\n"
msgstr "não foi possível remover a entrada '%s' da cache\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "url '%s' é inválida, ignorando\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "esquema da url não especificado, assumindo http\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "falha ao obter arquivo '%s' de %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "não foi possível resumir o download, reiniciando\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "não foi possível escrever no arquivo '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "erro no download de '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "erro ao escrever no arquivo '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "não foi possível mudar para o diretório %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "rodando XferCommand: fork falhou!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "URL não contém um arquivo para download\n"
#, c-format
msgid "failed to download %s\n"
msgstr "falha ao fazer o download de %s\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s: ignorando upgrade do pacote (a ser substituido por %s-%s)\n"
msgstr "%s-%s: ignorando atualização do pacote (a ser substituido por %s-%s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: local (%s) é mais novo que %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ignorando upgrade do pacote (%s => %s)\n"
msgstr "%s: ignorando atualização do pacote (%s => %s)\n"
#, c-format
msgid "repository '%s' not found\n"
@@ -465,26 +456,22 @@ msgstr "%s-%s está atualizado -- pulando\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s está atualizado -- reinstalando\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "fazendo downgrade do pacote %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "conflito de pacotes não solucionável detectado\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "falha de malloc: não foi possível alocar %zd bytes\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "removendo '%s' da lista de pacotes porque ele conflita com '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "comando: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "não foi possível obter a soma md5 para o pacote %s\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "arquivo %s estava corrompido (checksum MD5 inválida)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "falha ao obter alguns arquivos de %s\n"
@@ -533,6 +520,10 @@ msgstr "/bin/sh não encontrado no diretório pai, abortando scriptlet\n"
msgid "could not create temp directory\n"
msgstr "não foi possível criar diretório temporário\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "não foi possível copiar arquivo temporário para %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "não foi possível mudar diretório para %s (%s)\n"
@@ -565,10 +556,6 @@ msgstr "scriptlet falhou em executar corretamente\n"
msgid "could not remove tmpdir %s\n"
msgstr "não foi possível remover o diretório temporário %s\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "falha ao criar caminho '%s' : %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "não foi possível abrir %s : %s\n"
@@ -581,10 +568,3 @@ msgstr "cache %s não existe, criando...\n"
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "não foi possível criar cache de pacotes, usando /tmp\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: %s não pôde ser aberto\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: %s não pôde ser lido\n"

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Pacman package manager 3.0.0\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2008-02-18 19:46+0300\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-24 02:00+0200\n"
"Last-Translator: Sergey Tereschenko <serg.partizan@gmail.com>\n"
"Language-Team: Russian\n"
"MIME-Version: 1.0\n"
@@ -22,8 +22,8 @@ msgid "replacing older version %s-%s by %s in target list\n"
msgstr "заменяю устаревшую версию %s-%s на %s в списке целей\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "новая версия %s-%s в списке целей -- пропускаю\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "пропускается %s-%s, поскольку новая версия %s в списке целей\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
@@ -34,7 +34,7 @@ msgid "you cannot install two conflicting packages at the same time\n"
msgstr "вы не можете установить два конфликтующих пакета одновременно\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "замещение пакетов с использованием опций -A и -U еще не реализовано\n"
#, c-format
@@ -62,19 +62,15 @@ msgid "could not extract %s (%s)\n"
msgstr "не могу извлечь %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "не могу переименовать %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "не могу скопировать временный файл в %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "не могу переименовать %s в %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s сохранен как %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "не могу установить %s как %s: %s\n"
#, c-format
@@ -105,17 +101,51 @@ msgstr "не могу обновить в базе данных запись %s-
msgid "could not add entry '%s' in cache\n"
msgstr "не могу добавить запись '%s' в кэш\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "не могу удалить из базы данных запись %s%s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "неправильное имя для записи базы данных '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "повреждённая запись в базе данных '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "не могу открыть файл %s: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "не могу удалить из базы данных запись %s%s\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr ""
"противоречивая информация в базе данных %s: не совпадает имя пакета %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr ""
"противоречивая информация в базе данных %s: не совпадает версия пакета %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "не могу проанализировать файл с описанием пакета в %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "пропущено имя пакета в %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "пропущена версия пакета в %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "ошибка при чтении пакета %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "отсутствуют метаданые пакета в %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -137,10 +167,58 @@ msgstr "%s будет удалён после %s, как зависимость\
msgid "%s will be installed before its %s dependency\n"
msgstr "%s будет установлен перед %s, как зависимость\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "выбран пакет %s, предоставляющий %s\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "не удается разрешить \"%s\", зависимость \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "ссылка '%s' недействительна\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "схема ссылки не определена, подразумевается HTTP\n"
#, c-format
msgid "disk"
msgstr "диск"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "не удалось получить файл '%s' из %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "не удалось продолжить закачку, начинаю заново\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "не могу записать в файл '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "ошибка загрузки '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "не могу записать в файл '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "не могу изменить директорию на %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "запуск XferCommand: неудача\n"
#, c-format
msgid "failed to download %s\n"
msgstr "не могу загрузить %s\n"
#, c-format
msgid "out of memory!"
msgstr "недостаточно памяти!"
@@ -209,10 +287,6 @@ msgstr "не удается удалить запись в базе данных
msgid "invalid url for server"
msgstr "неверный url"
#, c-format
msgid "could not set parameter"
msgstr "ну могу установить параметр"
#, c-format
msgid "transaction already initialized"
msgstr "запрос уже инициализирован"
@@ -261,10 +335,6 @@ msgstr "не удается открыть файл пакета"
msgid "cannot load package data"
msgstr "не удается загрузить данные пакета"
#, c-format
msgid "package already installed"
msgstr "пакет уже установлен"
#, c-format
msgid "package not installed or lesser version"
msgstr "пекет не установлен или ранней версии"
@@ -274,20 +344,16 @@ msgid "cannot remove all files for package"
msgstr "не могу удалить все файлы пакета"
#, c-format
msgid "package name is not valid"
msgstr "неверное имя пакета"
#, c-format
msgid "corrupted package"
msgstr "пакет поврежден"
msgid "package filename is not valid"
msgstr "неверное имя файла пакета"
#, c-format
msgid "no such repository"
msgstr "нет такого репозитория"
#, c-format
msgid "corrupted delta"
msgstr "дельта-патчи повреждены"
msgid "invalid or corrupted delta"
msgstr "ошибка или повреждение в дельта-файле"
#, c-format
msgid "delta patch failed"
@@ -317,10 +383,6 @@ msgstr "пользователь прервал операцию"
msgid "internal error"
msgstr "внутренняя ошибка"
#, c-format
msgid "libarchive error"
msgstr "ошибка в libarchive"
#, c-format
msgid "not confirmed"
msgstr "не подтверждено"
@@ -330,53 +392,21 @@ msgid "invalid regular expression"
msgstr "неверное регулярное выражение"
#, c-format
msgid "connection to remote host failed"
msgstr "не удалось подключиться к удаленному хосту"
msgid "libarchive error"
msgstr "ошибка в libarchive"
#, c-format
msgid "download library error"
msgstr "ошибка в download library"
#, c-format
msgid "error invoking external downloader"
msgstr "ошибка вызова внешнего менеджера загрузки"
#, c-format
msgid "unexpected error"
msgstr "непредвиденная ошибка"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "не могу получить контрольную сумму md5 для пакета %s-%s\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "контрольные суммы md5 для пакета %s-%s не совпали\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s: принудительно обновляю до версии %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: установленная версия (%s) новее, чем в %s (%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "ошибка извлечения файла описания пакета в %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "не могу проанализировать файл с описанием пакета в %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "пропущено имя пакета в %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "пропущена версия пакета в %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "ошибка при чтении пакета %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "отсутствуют метаданые пакета в %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "не могу найти %s в базе данных -- пропускаю\n"
@@ -393,58 +423,14 @@ msgstr "не могу удалить из базы данных запись %s-
msgid "could not remove entry '%s' from cache\n"
msgstr "не могу удалить запись '%s' из кеша\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "url '%s' недействительный, пропускаю\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "url не определён, подразумевается http\n"
#, c-format
msgid "disk"
msgstr "диск"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "не удалось получить файл '%s' из %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "не удалось продолжить закачку, начинаю заново\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "не могу записать в файл '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "ошибка загрузки '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "не могу записать в файл '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "не могу изменить директорию на %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "запуск XferCommand: неудача\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "URL не содержит имени файла для загрузки\n"
#, c-format
msgid "failed to download %s\n"
msgstr "не могу загрузить %s\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s: игнорирую обновление пакета (он будет заменен на %s-%s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: установленная версия (%s) новее, чем в %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: игнорирую обновление пакета (%s => %s)\n"
@@ -461,26 +447,22 @@ msgstr "%s-%s не устарел -- пропускаю\n"
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s не устарел -- переустанавливаю\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "откат версии пакета %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "обнаружен неразрешимый конфликт пакетов\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "сбой malloc: не удалось выделить %zd байт\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "удаляю '%s' из списка целей, поскольку он конфликтует с '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "комманда: %s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "не удалось получить md5 контрольную сумму для файла %s\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "архив %s поврежден (не сходятся контрольные MD5-суммы)\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "не удалось получить некоторые файлы с %s\n"
@@ -529,6 +511,10 @@ msgstr "Нету /bin/sh в родительском окружении, отм
msgid "could not create temp directory\n"
msgstr "не удалось создать временную директорию\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "не могу скопировать временный файл в %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "не удалось изменить директорию на %s (%s)\n"
@@ -561,10 +547,6 @@ msgstr "не удалось корректно выполнить скрипт\n
msgid "could not remove tmpdir %s\n"
msgstr "не могу удалить tmpdir %s\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "не удалось создать путь '%s' : %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "не удалось откруть %s: %s\n"
@@ -577,37 +559,3 @@ msgstr "кэш %s не существует, создаю...\n"
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "не могу создать кэш пакетов, будет использован /tmp\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5: %s не может быть открыт\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5: %s не может быть прочитан\n"
#, fuzzy
#~ msgid "loading package data for %s : level=%d\n"
#~ msgstr "загружаю данные пакета %s : уровень=%d\n"
#, fuzzy
#~ msgid "could not remove tempfile %s\n"
#~ msgstr "не могу удалить временный файл %s\n"
#, fuzzy
#~ msgid "missing package filelist in %s, generating one\n"
#~ msgstr "отсутствует список файлов пакета в %s, генерирую его\n"
#~ msgid "please remove '%s' first, using -Rd"
#~ msgstr "пожалуйста, уделите сначала '%s' используя -Rd\n"
#~ msgid "could not extract %s (%s)"
#~ msgstr "не могу извлечь %s (%s)"
#~ msgid "could not update provision '%s' from '%s'"
#~ msgstr "не могу обновить '%s' из '%s'"
#~ msgid "cannot remove file %s: %s"
#~ msgstr "не могу удалить файл %s: %s"
#~ msgid "archive %s is corrupted (bad MD5 or SHA1 checksum)\n"
#~ msgstr "архив %s поврежден (не сходится MD5 или SHA1 контрольная сумма)\n"

558
lib/libalpm/po/tr.po Normal file
View File

@@ -0,0 +1,558 @@
# Turkish translation for libalpm.
# Copyright (C) 2008 Judd Vinet <jvinet@zeroflux.org>
# This file is distributed under the same license as the libalpm package.
# Samed BEYRİBEY <ras0ir@eventualis.org>, 2008.
#
msgid ""
msgstr ""
"Project-Id-Version: 3.1.4-1\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-25 12:57+0200\n"
"Last-Translator: Samed Beyribey <beyribey@gmail.com>\n"
"Language-Team: Turkish Arch Linux Users <tr@archlinuxtr.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#, c-format
msgid "replacing older version %s-%s by %s in target list\n"
msgstr "eski sürüm %s-%s hedef listesindeki %s ile değiştiriliyor\n"
#, c-format
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "%s-%s yeni sürüm %s hedef listesinde olduğundan atlanıyor\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
msgstr "hedef listesinde çelişen paketler bulundu\n"
#, c-format
msgid "you cannot install two conflicting packages at the same time\n"
msgstr "çelişen iki paketi aynı anda kuramazsınız\n"
#, c-format
msgid "replacing packages with -U is not supported yet\n"
msgstr "-A ve -U kullanarak paket değiştirme henüz desteklenmemektedir\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
msgstr "paketleri -Rd ve -U kullanarak değiştirebilirsiniz\n"
#, c-format
msgid ""
"directory permissions differ on %s\n"
"filesystem: %o package: %o\n"
msgstr ""
"%s paketi üzerinde dizin izinleri farklı\n"
"dosya sistemi: %o paket: %o\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
msgstr "aç: %s sembolik bağı dizine yöneltilmemiş\n"
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "aç: dizin %s dosyası ile baştan yazılmıyor\n"
#, c-format
msgid "could not extract %s (%s)\n"
msgstr "%s açılamadı (%s)\n"
#, c-format
msgid "could not rename %s to %s (%s)\n"
msgstr "%s dosyasının ismi %s olarak değiştirilemiyor (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s, %s olarak kaydedildi\n"
#, c-format
msgid "could not install %s as %s (%s)\n"
msgstr "%s, %s olarak kurulamadı: %s\n"
#, c-format
msgid "%s installed as %s\n"
msgstr "%s, %s olarak kuruldu\n"
#, c-format
msgid "extracting %s as %s.pacnew\n"
msgstr "%s dosyası %s.pacnew olarak açılıyor\n"
#, c-format
msgid "could not get current working directory\n"
msgstr "üzerinde çalışılan dizin algılanamadı\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "%s güncellenirken bir sorun meydana geldi\n"
#, c-format
msgid "problem occurred while installing %s\n"
msgstr "%s yüklenirken bir sorun meydana geldi\n"
#, c-format
msgid "could not update database entry %s-%s\n"
msgstr "%s-%s veritabanı kaydı güncellenemedi\n"
#, c-format
msgid "could not add entry '%s' in cache\n"
msgstr "'%s' kaydı tampona eklenemedi\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "%s%s veritabanı kaydı kaldırılamıyor\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "veritabanı kaydı için geçersiz isim '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "bozuk veritabanı kaydı '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "%s dosyasıılamadı: %s\n"
#, c-format
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "%s veritabanı tutarsız: %s paketinde isim uyuşmazlığı\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "%s veritabanı tutarsız: %s paketinde sürüm uyuşmazlığı\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "%s içerisindeki paket açıklama dosyası ayrıştırılamadı\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "%s içerisinde paket adı bulunmuyor\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "%s içerisinde paket sürümü bulunmuyor\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "%s paketi okunurken hata meydana geldi: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "%s içerisinde eksik paket bilgisi\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
msgstr "'yerel' veritabanı tekrar kaydedilmeye çalışılıyor\n"
#, c-format
msgid "database path is undefined\n"
msgstr "veritabanı yolu belirtilmemiş\n"
#, c-format
msgid "dependency cycle detected:\n"
msgstr "dolaylı bağımlılıklar bulundu:\n"
#, c-format
msgid "%s will be removed after its %s dependency\n"
msgstr "%s paketi %s bağımlılığından sonra kaldırılacak\n"
#, c-format
msgid "%s will be installed before its %s dependency\n"
msgstr "%s paketi %s bağımlılığından önce kurulacak\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "sağlayan paket seçildi ( %s %s'i sağlıyor)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "\"%s\" paketi \"%s\" paketinin bağımlılığı olarak çözümlenemiyor\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "'%s' adresi geçersiz\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "adres şeması belirtilmemiş, http kullanılacak\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "'%s' dosyası %s : %s 'ten alınamadı\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "indirmeye devam edilemiyor, baştan başlanıyor\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "'%s' dosyasına yazılamıyor\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "'%s' indirilirken hata oluştu: %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "'%s' dosyasına yazılamıyor: %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "%s dizinine geçilemiyor\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "XferCommand çalıştırılıyor: çatallanma başarısız!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "%s dosyası indirilemedi\n"
#, c-format
msgid "out of memory!"
msgstr "bellek yetersiz!"
#, c-format
msgid "unexpected system error"
msgstr "beklenmedik sistem hatası"
#, c-format
msgid "insufficient privileges"
msgstr "yetersiz yetki"
#, c-format
msgid "could not find or read file"
msgstr "dosya bulunamadı veya okunamadı"
#, c-format
msgid "could not find or read directory"
msgstr "klasör bulunamadı veya okunamadı"
#, c-format
msgid "wrong or NULL argument passed"
msgstr "eksik ya da geçersiz parametre geçilmiş"
#, c-format
msgid "library not initialized"
msgstr "kütüphane başlatılamadı"
#, c-format
msgid "library already initialized"
msgstr "kütüphane zaten başlatıldı"
#, c-format
msgid "unable to lock database"
msgstr "veritabanı kilitlenemiyor"
#, c-format
msgid "could not open database"
msgstr "veritabanıılamadı"
#, c-format
msgid "could not create database"
msgstr "veritabanı oluşturulamadı"
#, c-format
msgid "database not initialized"
msgstr "veritabanı başlatılamadı"
#, c-format
msgid "database already registered"
msgstr "veritabanı zaten kayıtlı"
#, c-format
msgid "could not find database"
msgstr "veritabanı bulunamadı"
#, c-format
msgid "could not update database"
msgstr "veritabanı güncellenemedi"
#, c-format
msgid "could not remove database entry"
msgstr "veritabanı kaydı kaldırılamadı"
#, c-format
msgid "invalid url for server"
msgstr "hatalı sunucu adresi"
#, c-format
msgid "transaction already initialized"
msgstr "işlem zaten başlatılmış"
#, c-format
msgid "transaction not initialized"
msgstr "işlem başlatılmamış"
#, c-format
msgid "duplicate target"
msgstr "birden fazla hedef"
#, c-format
msgid "transaction not prepared"
msgstr "işlem hazırlanamadı"
#, c-format
msgid "transaction aborted"
msgstr "işlem iptal edildi"
#, c-format
msgid "operation not compatible with the transaction type"
msgstr "operasyon, işlem tipiyle uyumlu değil"
#, c-format
msgid "could not commit transaction"
msgstr "işlem teslim edilemiyor"
#, c-format
msgid "could not download all files"
msgstr "tüm dosyalar indirilemedi"
#, c-format
msgid "could not find or read package"
msgstr "paket bulunamadı veya okunamadı"
#, c-format
msgid "invalid or corrupted package"
msgstr "geçersiz veya bozuk paket"
#, c-format
msgid "cannot open package file"
msgstr "paket dosyasıılamıyor"
#, c-format
msgid "cannot load package data"
msgstr "paket verisi yüklenemiyor"
#, c-format
msgid "package not installed or lesser version"
msgstr "paket kurulamadı ya da önceki sürümü kurulu"
#, c-format
msgid "cannot remove all files for package"
msgstr "paketle alakalı tüm dosyalar kaldırılamadı"
#, c-format
msgid "package filename is not valid"
msgstr "paket dosya adı geçerli değil"
#, c-format
msgid "no such repository"
msgstr "depo bulunmuyor"
#, c-format
msgid "invalid or corrupted delta"
msgstr "geçersiz ya da bozuk veri"
#, c-format
msgid "delta patch failed"
msgstr "fark yaması başarısız oldu"
#, c-format
msgid "group not found"
msgstr "grup bulunamadı"
#, c-format
msgid "could not satisfy dependencies"
msgstr "bağımlılıklar sağlanamadı"
#, c-format
msgid "conflicting dependencies"
msgstr "çelişen bağımlılıklar"
#, c-format
msgid "conflicting files"
msgstr "çelişen dosyalar"
#, c-format
msgid "user aborted the operation"
msgstr "işlem kullanıcı tarafından durduruldu"
#, c-format
msgid "internal error"
msgstr "dahili hata"
#, c-format
msgid "not confirmed"
msgstr "onaylanmadı"
#, c-format
msgid "invalid regular expression"
msgstr "geçersiz düzenli ifade"
#, c-format
msgid "libarchive error"
msgstr "libarchive hatası"
#, c-format
msgid "download library error"
msgstr "kütüphane indirilirken hata oluştu"
#, c-format
msgid "error invoking external downloader"
msgstr "harici indiriciyi çağırırken hata oluştu"
#, c-format
msgid "unexpected error"
msgstr "beklenmedik hata"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "%s veritabanında bulunamadı -- atlanıyor\n"
#, c-format
msgid "cannot remove file '%s': %s\n"
msgstr "'%s' dosyası silinemiyor: %s\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
msgstr "veritabanı kaydı %s-%s silinemedi\n"
#, c-format
msgid "could not remove entry '%s' from cache\n"
msgstr "'%s' kaydı tampondan silinemedi\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr ""
"%s-%s: paket güncellemesi göz ardı ediliyor (%s-%s ile değiştirilecek)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: yereldeki paket (%s) %s (%s) paketinden daha güncel\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: paket güncellemesi göz ardı ediliyor (%s => %s)\n"
#, c-format
msgid "repository '%s' not found\n"
msgstr "'%s' deposu bulunamadı\n"
#, c-format
msgid "%s-%s is up to date -- skipping\n"
msgstr "%s-%s güncel -- atlanıyor\n"
#, c-format
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s güncel -- yeniden kuruluyor\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "%s paketi eski sürümüne çevriliyor (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "çözülemeyen paket çakışmaları bulundu\n"
#, c-format
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "'%s' hedef listesinden '%s' ile çeliştiği için kaldırıldı\n"
#, c-format
msgid "command: %s\n"
msgstr "komut: %s\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "%s deposundan bazı dosyalar alınamadı\n"
#, c-format
msgid "could not create removal transaction\n"
msgstr "kaldırma işlemi oluşturulamıyor\n"
#, c-format
msgid "could not initialize the removal transaction\n"
msgstr "kaldırma işlemi başlatılamadı\n"
#, c-format
msgid "could not prepare removal transaction\n"
msgstr "kaldırma işlemi hazırlanamadı\n"
#, c-format
msgid "could not commit removal transaction\n"
msgstr "kaldırma işlemi teslim edilemedi\n"
#, c-format
msgid "could not create transaction\n"
msgstr "işlem oluşturulamadı\n"
#, c-format
msgid "could not initialize transaction\n"
msgstr "işlem başlatılamadı\n"
#, c-format
msgid "could not prepare transaction\n"
msgstr "işlem hazırlanamadı\n"
#, c-format
msgid "could not commit transaction\n"
msgstr "işlem teslim edilemedi\n"
#, c-format
msgid "could not remove lock file %s\n"
msgstr "kilit dosyası %s silinemedi\n"
#, c-format
msgid "No /bin/sh in parent environment, aborting scriptlet\n"
msgstr "Bir üst ortamda /bin/sh bulunamadı, betik iptal ediliyor\n"
#, c-format
msgid "could not create temp directory\n"
msgstr "geçici dizin oluşturulamadı\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "geçici dosya %s üzerine kopyalanamadı (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "%s dizinine geçilemedi (%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
msgstr "yeni bir süreç çatallanamadı (%s)\n"
#, c-format
msgid "could not change the root directory (%s)\n"
msgstr "kök dizini değiştirilemedi (%s)\n"
#, c-format
msgid "could not change directory to / (%s)\n"
msgstr "/ dizinine gidilemedi (%s)\n"
#, c-format
msgid "call to popen failed (%s)"
msgstr "popen çağrısı başarısız (%s)"
#, c-format
msgid "call to waitpid failed (%s)\n"
msgstr "waitpid çağrısı başarısız (%s)\n"
#, c-format
msgid "scriptlet failed to execute correctly\n"
msgstr "betik düzgün çalıştırılamadı\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "geçici dizin %s kaldırılamadı\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "%s açılamadı: %s\n"
#, c-format
msgid "no %s cache exists, creating...\n"
msgstr "%s tamponu bulunmuyor, oluşturuluyor...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "paket tamponu oluşturulamadı, /tmp kullanılacak\n"

554
lib/libalpm/po/uk.po Normal file
View File

@@ -0,0 +1,554 @@
msgid ""
msgstr ""
"Project-Id-Version: libalpm 3.2.1\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: \n"
"Last-Translator: Roman Kyrylych <roman@archlinux.org>\n"
"Language-Team: http://archlinux.org.ua\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Ukrainian\n"
"X-Poedit-Country: UKRAINE\n"
#, c-format
msgid "replacing older version %s-%s by %s in target list\n"
msgstr "старіша версія %s-%s замінюється на %s в цільовому списку пакетів\n"
#, c-format
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "%s-%s пропускається, бо в списку цільових пакетів є новіша версія %s\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
msgstr "в списку цільових пакетів були знайдені конфліктуючі пакунки\n"
#, c-format
msgid "you cannot install two conflicting packages at the same time\n"
msgstr "ви не можете одночасно встановити два пакунки, що конфліктують\n"
#, c-format
msgid "replacing packages with -U is not supported yet\n"
msgstr "заміна пакунків за допомогою -U поки не підтримується\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
msgstr "ви можете власноруч замінити пакунки використавши -Rd та -U\n"
#, c-format
msgid ""
"directory permissions differ on %s\n"
"filesystem: %o package: %o\n"
msgstr ""
"права каталога відрізняються на\n"
"файловій системі %s: %o пакунок: %o\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
msgstr "розпакування: символьне посилання %s не вказує на каталог\n"
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "розпакування: каталог не було перезаписано файлом %s\n"
#, c-format
msgid "could not extract %s (%s)\n"
msgstr "неможливо розпакувати %s (%s)\n"
#, c-format
msgid "could not rename %s to %s (%s)\n"
msgstr "неможливо перейменувати %s на %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s збережено як %s\n"
#, c-format
msgid "could not install %s as %s (%s)\n"
msgstr "неможливо встановити %s як %s (%s)\n"
#, c-format
msgid "%s installed as %s\n"
msgstr "%s встановлено як %s\n"
#, c-format
msgid "extracting %s as %s.pacnew\n"
msgstr "розпакування %s як %s.pacnew\n"
#, c-format
msgid "could not get current working directory\n"
msgstr "неможливо отримати поточний робочий каталог\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "з'явилась проблема при поновленні %s\n"
#, c-format
msgid "problem occurred while installing %s\n"
msgstr "з'явилась проблема при встановленні %s\n"
#, c-format
msgid "could not update database entry %s-%s\n"
msgstr "неможливо поновити запис бази даних %s-%s\n"
#, c-format
msgid "could not add entry '%s' in cache\n"
msgstr "неможливо додати запис '%s' у кеш\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "неможливо видалити запис бази даних %s%s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "невірне ім'я для запису бази даних '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "пошкоджений запис у базі даних '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "неможливо відкрити файл %s: %s\n"
#, c-format
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "база даних %s неоднорідна: неспівпадіння назви для пакунка %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "база даних %s неоднорідна: неспівпадіння версій для пакунка %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "неможливо розібрати файл опису пакунка %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "бракує імені пакунку в %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "бракує версії пакунку в %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "помилка при читанні пакунку %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "бракує метаданих пакунку в %s\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
msgstr "спроба перереєструвати базу даних 'local'\n"
#, c-format
msgid "database path is undefined\n"
msgstr "шлях до бази даних не вказано\n"
#, c-format
msgid "dependency cycle detected:\n"
msgstr "виявлено цикл залежностей:\n"
#, c-format
msgid "%s will be removed after its %s dependency\n"
msgstr "%s буде видалено після його залежності %s\n"
#, c-format
msgid "%s will be installed before its %s dependency\n"
msgstr "%s буде встановлено перед його %s залежністю\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "був вибраний пакунок %s, що забезпечує %s\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "неможливо розв'язати \"%s\", залежність \"%s\"\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "посилання '%s' невірне\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "протокол посилання не вказано, вважається HTTP\n"
#, c-format
msgid "disk"
msgstr "диск"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "не вдалося отримати файл '%s' з %s : %s\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "неможливо продовжити завантаження, починається з початку\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "неможливо писати у файл '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "помилка при завантаженні '%s': %s\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "помилка при запису до файлу '%s': %s\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "неможливо змінити каталог на %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "виконання XferCommand: старт процесу невдалий!\n"
#, c-format
msgid "failed to download %s\n"
msgstr "не вдалося завантажити %s\n"
#, c-format
msgid "out of memory!"
msgstr "не вистачає пам'яті!"
#, c-format
msgid "unexpected system error"
msgstr "неочікувана системна помилка"
#, c-format
msgid "insufficient privileges"
msgstr "недостатньо прав"
#, c-format
msgid "could not find or read file"
msgstr "неможливо знайти чи прочитати файл"
#, c-format
msgid "could not find or read directory"
msgstr "неможливо знайти чи прочитати каталог"
#, c-format
msgid "wrong or NULL argument passed"
msgstr "передано невірний аргумент чи NULL"
#, c-format
msgid "library not initialized"
msgstr "бібліотека не ініціалізована"
#, c-format
msgid "library already initialized"
msgstr "бібліотека вже ініціалізована"
#, c-format
msgid "unable to lock database"
msgstr "неможливо заблокувати базу даних"
#, c-format
msgid "could not open database"
msgstr "неможливо відкрити базу даних"
#, c-format
msgid "could not create database"
msgstr "неможливо створити базу даних"
#, c-format
msgid "database not initialized"
msgstr "база даних не ініціалізована"
#, c-format
msgid "database already registered"
msgstr "база даних вже зареєстрована"
#, c-format
msgid "could not find database"
msgstr "неможливо знайти базу даних"
#, c-format
msgid "could not update database"
msgstr "неможливо поновити базу даних"
#, c-format
msgid "could not remove database entry"
msgstr "неможливо видалити запис з бази даних"
#, c-format
msgid "invalid url for server"
msgstr "невірне посилання чи сервер"
#, c-format
msgid "transaction already initialized"
msgstr "транзакція вже ініціалізована"
#, c-format
msgid "transaction not initialized"
msgstr "транзакція не ініціалізована"
#, c-format
msgid "duplicate target"
msgstr "продубльований цільовий пакунок"
#, c-format
msgid "transaction not prepared"
msgstr "транзакція не підготовлена"
#, c-format
msgid "transaction aborted"
msgstr "транзакцію перервано"
#, c-format
msgid "operation not compatible with the transaction type"
msgstr "операція несумісна з типом транзакції"
#, c-format
msgid "could not commit transaction"
msgstr "неможливо здійснити транзакцію"
#, c-format
msgid "could not download all files"
msgstr "неможиво завантажити усі файли"
#, c-format
msgid "could not find or read package"
msgstr "неможливо знайти чи прочитати пакунок"
#, c-format
msgid "invalid or corrupted package"
msgstr "невірний чи пошкоджений пакунок"
#, c-format
msgid "cannot open package file"
msgstr "неможливо відкрити файл пакунку"
#, c-format
msgid "cannot load package data"
msgstr "неможливо завантажити дані пакунку"
#, c-format
msgid "package not installed or lesser version"
msgstr "пакунок не встановлено, або існує старіша версія"
#, c-format
msgid "cannot remove all files for package"
msgstr "неможливо видалити всі файли для пакунку"
#, c-format
msgid "package filename is not valid"
msgstr "ім'я файлу пакунку невірне"
#, c-format
msgid "no such repository"
msgstr "немає такого репозиторію"
#, c-format
msgid "invalid or corrupted delta"
msgstr "невірний чи пошкоджений дельта-патч"
#, c-format
msgid "delta patch failed"
msgstr "накладення дельта-патчу невдале"
#, c-format
msgid "group not found"
msgstr "група не знадена"
#, c-format
msgid "could not satisfy dependencies"
msgstr "неможливо забезпечити залежності"
#, c-format
msgid "conflicting dependencies"
msgstr "конфліктуючі залежності"
#, c-format
msgid "conflicting files"
msgstr "конфліктуючі файли"
#, c-format
msgid "user aborted the operation"
msgstr "користувач перервав операцію"
#, c-format
msgid "internal error"
msgstr "внутрішня помилка"
#, c-format
msgid "not confirmed"
msgstr "не підтверджено"
#, c-format
msgid "invalid regular expression"
msgstr "невірний регулярний вираз"
#, c-format
msgid "libarchive error"
msgstr "помилка libarchive"
#, c-format
msgid "download library error"
msgstr "помилка бібліотеки завантаження"
#, c-format
msgid "error invoking external downloader"
msgstr "помилка виклику зовнішнього завантажувача"
#, c-format
msgid "unexpected error"
msgstr "неочікувана помилка"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "неможливо знайти %s в базі даних -- пропускається\n"
#, c-format
msgid "cannot remove file '%s': %s\n"
msgstr "неможливо видалити файл '%s': %s\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
msgstr "неможливо видалити запис бази даних %s-%s\n"
#, c-format
msgid "could not remove entry '%s' from cache\n"
msgstr "неможливо видалити запис '%s' з кешу\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s: ігнорування поновлення пакунку (буде замінено на %s-%s)\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: локальна версія (%s) новіша за %s (%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ігнорування поновлення пакунку (%s => %s)\n"
#, c-format
msgid "repository '%s' not found\n"
msgstr "репозиторій '%s' не знайдено\n"
#, c-format
msgid "%s-%s is up to date -- skipping\n"
msgstr "%s-%s не потребує поновлення -- пропускається\n"
#, c-format
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s не потребує поновлення -- перевстановлюється\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "пониження версії пакунку %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "виявлені нерозв'язні конфлікти пакетів\n"
#, c-format
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "видалення '%s' з списку пакунків, бо він конфліктує з '%s'\n"
#, c-format
msgid "command: %s\n"
msgstr "команда: %s\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "не вдалося отримати деякі файли з %s\n"
#, c-format
msgid "could not create removal transaction\n"
msgstr "неможливо створити транзакцію видалення\n"
#, c-format
msgid "could not initialize the removal transaction\n"
msgstr "неможливо почати транзакцію видалення\n"
#, c-format
msgid "could not prepare removal transaction\n"
msgstr "неможливо підготувати транзакцію видалення\n"
#, c-format
msgid "could not commit removal transaction\n"
msgstr "неможливо здійснити транзакцію видалення\n"
#, c-format
msgid "could not create transaction\n"
msgstr "неможливо створити транзакцію\n"
#, c-format
msgid "could not initialize transaction\n"
msgstr "неможливо почати транзакцію\n"
#, c-format
msgid "could not prepare transaction\n"
msgstr "неможливо підготувати транзакцію\n"
#, c-format
msgid "could not commit transaction\n"
msgstr "неможливо здійснити транзакцію\n"
#, c-format
msgid "could not remove lock file %s\n"
msgstr "неможливо видалити файл блокування %s\n"
#, c-format
msgid "No /bin/sh in parent environment, aborting scriptlet\n"
msgstr ""
"В батьківському середовищі немає /bin/sh, переривання скрипту виконання\n"
#, c-format
msgid "could not create temp directory\n"
msgstr "неиожливо створити тимчасовий каталог\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "неможливо скопіювати тимчасовий файл до %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "неможливо змінити каталог на %s (%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
msgstr "неможливо почати новий процес (%s)\n"
#, c-format
msgid "could not change the root directory (%s)\n"
msgstr "неможливо змінити кореневий каталог (%s)\n"
#, c-format
msgid "could not change directory to / (%s)\n"
msgstr "неможливо змінити каталог на / (%s)\n"
#, c-format
msgid "call to popen failed (%s)"
msgstr "виклик popen невдалий (%s)"
#, c-format
msgid "call to waitpid failed (%s)\n"
msgstr "виклик waitpid невдалий (%s)\n"
#, c-format
msgid "scriptlet failed to execute correctly\n"
msgstr "скрипт встановлення не зміг виконатися коректно\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "неможливо видалити тимчасовий каталог %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "неможливо відкрити %s: %s\n"
#, c-format
msgid "no %s cache exists, creating...\n"
msgstr "кеш %s не існує, створюється...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "неможливо створити кеш пакунку, використовуватиметься /tmp\n"

View File

@@ -7,11 +7,11 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Pacman package manager 3.1.2\n"
"Project-Id-Version: Pacman package manager 3.2.1\n"
"Report-Msgid-Bugs-To: pacman-dev@archlinux.org\n"
"POT-Creation-Date: 2008-03-03 20:03-0600\n"
"PO-Revision-Date: 2008-02-25 20:25+0100\n"
"Last-Translator: 甘露(Lu.Gan) <rhythm.gan@gmail.com>\n"
"POT-Creation-Date: 2008-08-23 10:54-0500\n"
"PO-Revision-Date: 2008-08-25 08:33+0200\n"
"Last-Translator: 甘露(Lu Gan) <rhythm.gan@gmail.com>\n"
"Language-Team: Chinese/Simplified <i18n-translation@lists.linux.net.cn>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -22,8 +22,8 @@ msgid "replacing older version %s-%s by %s in target list\n"
msgstr "正在替换老版本 %s-%s 通过在目标清单中的%s\n"
#, c-format
msgid "newer version %s-%s is in the target list -- skipping\n"
msgstr "较新版本 %s-%s 在目标清单中 -- 跳过\n"
msgid "skipping %s-%s because newer version %s is in the target list\n"
msgstr "跳过 %s-%s因为较新版本的 %s 在目标清单中\n"
#, c-format
msgid "conflicting packages were found in the target list\n"
@@ -34,8 +34,8 @@ msgid "you cannot install two conflicting packages at the same time\n"
msgstr "你不能同时安装有冲突的两个软件包\n"
#, c-format
msgid "replacing packages with -A and -U is not supported yet\n"
msgstr "正在使用 -A 替代软件包, -U 目前尚不支持\n"
msgid "replacing packages with -U is not supported yet\n"
msgstr "正在覆盖软件包, -U 目前尚不支持\n"
#, c-format
msgid "you can replace packages manually using -Rd and -U\n"
@@ -46,7 +46,7 @@ msgid ""
"directory permissions differ on %s\n"
"filesystem: %o package: %o\n"
msgstr ""
"目录权限不一致%s\n"
"目录权限不一致 %s\n"
"文件系统:%o 软件包:%o\n"
#, c-format
@@ -62,20 +62,16 @@ msgid "could not extract %s (%s)\n"
msgstr "无法解压缩 %s (%s)\n"
#, c-format
msgid "could not rename %s (%s)\n"
msgstr "无法重命名 %s (%s)\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "无法复制临时文件到 %s (%s)\n"
msgid "could not rename %s to %s (%s)\n"
msgstr "无法重命名 %s 为 %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s 已另存为 %s\n"
#, c-format
msgid "could not install %s as %s: %s\n"
msgstr "无法安装 %s 作为 %s: %s\n"
msgid "could not install %s as %s (%s)\n"
msgstr "无法安装 %s 作为 %s (%s)\n"
#, c-format
msgid "%s installed as %s\n"
@@ -91,11 +87,11 @@ msgstr "无法得到当前的工作目录\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "更新 %s时出现错误\n"
msgstr "更新 %s 时出现错误\n"
#, c-format
msgid "problem occurred while installing %s\n"
msgstr "安装 %s时出现错误\n"
msgstr "安装 %s 时出现错误\n"
#, c-format
msgid "could not update database entry %s-%s\n"
@@ -105,17 +101,49 @@ msgstr "无法更新数据库记录 %s-%s\n"
msgid "could not add entry '%s' in cache\n"
msgstr "无法在缓存中添加记录 '%s' \n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "无法删除数据库记录 %s%s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "数据库记录'%s'名字无效\n"
msgstr "数据库记录 '%s' 名字无效\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "损坏的数据库记录 '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "无法打开文件 %s: %s\n"
#, c-format
msgid "could not remove database entry %s%s\n"
msgstr "无法删除数据库记录 %s%s\n"
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "%s 数据库不一致:名字和软件包中的 %s 不一致\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "%s 数据库不一致:版本和软件包中的 %s 不一致\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "无法分析 %s 中的软件包描述文件\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "%s 中缺少软件包名字\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "%s 中缺少软件包版本号\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "读取软件包%s: %s发生错误\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "%s 中缺少软件包元数据\n"
#, c-format
msgid "attempt to re-register the 'local' DB\n"
@@ -131,15 +159,63 @@ msgstr "探测到依赖关系循环:\n"
#, c-format
msgid "%s will be removed after its %s dependency\n"
msgstr "%s将在它%s的依赖关系之后被删除\n"
msgstr "%s 将在它 %s 的依赖关系之后被删除\n"
#, c-format
msgid "%s will be installed before its %s dependency\n"
msgstr "%s将在它%s的依赖关系之前被安装\n"
msgstr "%s 将在它 %s 的依赖关系之前被安装\n"
#, c-format
msgid "provider package was selected (%s provides %s)\n"
msgstr "已选定提供软件包 (%s 提供 %s)\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "无法解决\"%s\"\"%s\"的依赖关系\n"
msgstr "无法解决 \"%s\"\"%s\" 的依赖关系\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url %s' 无效\n"
#, c-format
msgid "url scheme not specified, assuming HTTP\n"
msgstr "url 结构没有指定,假定为 HTTP\n"
#, c-format
msgid "disk"
msgstr "硬盘"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "无法从 %s : %s 获取文件 '%s' \n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "无法恢复下载,重新开始\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "无法写入文件 '%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "下载 '%s': %s 时出错\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "写入文件 '%s': %s 时出错\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "无法改变目录到 %s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "运行 XferCommand分支失败\n"
#, c-format
msgid "failed to download %s\n"
msgstr "下载%s失败\n"
#, c-format
msgid "out of memory!"
@@ -209,10 +285,6 @@ msgstr "无法删除数据库记录"
msgid "invalid url for server"
msgstr "无效的服务器url"
#, c-format
msgid "could not set parameter"
msgstr "无法设置参数"
#, c-format
msgid "transaction already initialized"
msgstr "处理已初始化"
@@ -261,10 +333,6 @@ msgstr "无法打开软件包文件"
msgid "cannot load package data"
msgstr "无法加载软件包数据"
#, c-format
msgid "package already installed"
msgstr "软件包已经安装"
#, c-format
msgid "package not installed or lesser version"
msgstr "软件包没有安装或版本较低"
@@ -274,24 +342,20 @@ msgid "cannot remove all files for package"
msgstr "无法删除软件包全部文件"
#, c-format
msgid "package name is not valid"
msgstr "软件包名无效"
#, c-format
msgid "corrupted package"
msgstr "已损坏的软件包"
msgid "package filename is not valid"
msgstr "软件包文件名无效"
#, c-format
msgid "no such repository"
msgstr "没有该软件库"
#, c-format
msgid "corrupted delta"
msgstr "已损怀的delta"
msgid "invalid or corrupted delta"
msgstr "无效的或已损坏的 delta"
#, c-format
msgid "delta patch failed"
msgstr "delta补丁失败"
msgstr "delta 补丁失败"
#, c-format
msgid "group not found"
@@ -317,10 +381,6 @@ msgstr "用户中断操作"
msgid "internal error"
msgstr "内部错误"
#, c-format
msgid "libarchive error"
msgstr "libarchive错误"
#, c-format
msgid "not confirmed"
msgstr "不能确认"
@@ -330,157 +390,77 @@ msgid "invalid regular expression"
msgstr "无效的常规表达式"
#, c-format
msgid "connection to remote host failed"
msgstr "连接远端主机失败"
msgid "libarchive error"
msgstr "libarchive 错误"
#, c-format
msgid "download library error"
msgstr "下载函数库出错"
#, c-format
msgid "error invoking external downloader"
msgstr "激活外部下载程序时出现错误"
#, c-format
msgid "unexpected error"
msgstr "未预期的错误"
#, c-format
msgid "could not get md5sum for package %s-%s\n"
msgstr "无法得到软件包%s-%s的md5值\n"
#, c-format
msgid "md5sums do not match for package %s-%s\n"
msgstr "软件包%s-%s的md5值不一致\n"
#, c-format
msgid "%s: forcing upgrade to version %s\n"
msgstr "%s强制更新至版本%s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s本地%s比%s版本更新(%s)\n"
#, c-format
msgid "error extracting package description file to %s\n"
msgstr "解压缩软件包描述文件到%s时发生错误\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "无法分析%s中的软件包描述文件\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "%s中缺少软件包名字\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "%s中缺少软件包版本号\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "读取软件包%s: %s发生错误\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "%s中缺少软件包元数据\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "无法在数据库中找到%s -- 跳过\n"
msgstr "无法在数据库中找到 %s -- 跳过\n"
#, c-format
msgid "cannot remove file '%s': %s\n"
msgstr "无法删除文件'%s': %s\n"
msgstr "无法删除文件 '%s': %s\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
msgstr "无法删除数据库记录%s-%s\n"
msgstr "无法删除数据库记录 %s-%s\n"
#, c-format
msgid "could not remove entry '%s' from cache\n"
msgstr "无法从缓存中删除记录'%s'\n"
#, c-format
msgid "url '%s' is invalid, ignoring\n"
msgstr "url %s' 无效,忽略\n"
#, c-format
msgid "url scheme not specified, assuming http\n"
msgstr "url scheme没有指定假定为http\n"
#, c-format
msgid "disk"
msgstr "硬盘"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "获取文件'%s'从%s : %s失败\n"
#, c-format
msgid "cannot resume download, starting over\n"
msgstr "无法恢复下载,重新开始\n"
#, c-format
msgid "cannot write to file '%s'\n"
msgstr "无法写入文件'%s'\n"
#, c-format
msgid "error downloading '%s': %s\n"
msgstr "下载'%s': %s时出错\n"
#, c-format
msgid "error writing to file '%s': %s\n"
msgstr "写入文件'%s': %s时出错\n"
#, c-format
msgid "could not chdir to %s\n"
msgstr "无法改变目录到%s\n"
#, c-format
msgid "running XferCommand: fork failed!\n"
msgstr "运行XferCommand:分支失败!\n"
#, c-format
msgid "URL does not contain a file for download\n"
msgstr "URL没有包含可下载的文件\n"
#, c-format
msgid "failed to download %s\n"
msgstr "下载%s失败\n"
msgstr "无法从缓存中删除记录 '%s'\n"
#, c-format
msgid "%s-%s: ignoring package upgrade (to be replaced by %s-%s)\n"
msgstr "%s-%s忽略软件包更新由%s-%s替代\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s本地%s比 %s 的版本更新(%s)\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s忽略软件包更新%s => %s\n"
#, c-format
msgid "repository '%s' not found\n"
msgstr "没有找到软件库'%s'\n"
msgstr "没有找到软件库 '%s'\n"
#, c-format
msgid "%s-%s is up to date -- skipping\n"
msgstr "%s-%s已经为最新 -- 跳过\n"
msgstr "%s-%s 已经为最新 -- 跳过\n"
#, c-format
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s已经为最新 -- 重新安装\n"
msgstr "%s-%s 已经为最新 -- 重新安装\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "正在降级软件包 %s (%s => %s)\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "探测到无法解决的软件包冲突\n"
#, c-format
msgid "malloc failure: could not allocate %zd bytes\n"
msgstr "内存分配错误:无法分配 %zd bytes\n"
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "正在从目标清单中删除 '%s' ,因为它和 '%s' 有冲突\n"
#, c-format
msgid "command: %s\n"
msgstr "命令:%s\n"
#, c-format
msgid "can't get md5 checksum for file %s\n"
msgstr "无法得到文件%s的md5检查值\n"
#, c-format
msgid "file %s was corrupted (bad MD5 checksum)\n"
msgstr "文件%s已损坏坏的MD5检查值\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "某些文件无法从%s取回\n"
@@ -519,19 +499,23 @@ msgstr "无法交付处理\n"
#, c-format
msgid "could not remove lock file %s\n"
msgstr "无法删除锁定文件%s\n"
msgstr "无法删除锁定文件 %s\n"
#, c-format
msgid "No /bin/sh in parent environment, aborting scriptlet\n"
msgstr "父环境中没有/bin/sh正在中断脚本\n"
msgstr "父环境中没有 /bin/sh正在中断脚本\n"
#, c-format
msgid "could not create temp directory\n"
msgstr "无法创建临时目录\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "无法复制临时文件到 %s (%s)\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "无法更改目录到%s (%s)\n"
msgstr "无法更改目录到 %s (%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
@@ -547,11 +531,11 @@ msgstr "无法更改目录到/ (%s)\n"
#, c-format
msgid "call to popen failed (%s)"
msgstr "调用popen失败(%s)"
msgstr "调用 popen 失败(%s)"
#, c-format
msgid "call to waitpid failed (%s)\n"
msgstr "调用waitpid失败(%s)\n"
msgstr "调用 waitpid 失败(%s)\n"
#, c-format
msgid "scriptlet failed to execute correctly\n"
@@ -561,26 +545,15 @@ msgstr "脚本没有被正确执行\n"
msgid "could not remove tmpdir %s\n"
msgstr "无法删除临时目录%s\n"
#, c-format
msgid "failed to make path '%s' : %s\n"
msgstr "无法创建路径'%s' : %s\n"
#, c-format
msgid "could not open %s: %s\n"
msgstr "无法打开%s: %s\n"
msgstr "无法打开 %s: %s\n"
#, c-format
msgid "no %s cache exists, creating...\n"
msgstr "没有%s缓存存在正在创建……\n"
msgstr "没有 %s 缓存存在,正在创建...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "无法创建软件包缓存,正在使用/tmp代替\n"
msgstr "无法创建软件包缓存,正在使用 /tmp 代替\n"
#, c-format
msgid "md5: %s can't be opened\n"
msgstr "md5%s无法打开\n"
#, c-format
msgid "md5: %s can't be read\n"
msgstr "md5%s无法读取\n"

View File

@@ -37,7 +37,6 @@
#include "alpm_list.h"
#include "trans.h"
#include "util.h"
#include "error.h"
#include "log.h"
#include "backup.h"
#include "package.h"
@@ -57,12 +56,11 @@ int _alpm_remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(name != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
if(_alpm_pkg_find(name, trans->packages)) {
if(_alpm_pkg_find(trans->packages, name)) {
RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
}
if((info = _alpm_db_scan(db, name)) == NULL) {
/* Unimportant - just ignore it if we can't find it */
if((info = _alpm_db_get_pkgfromcache(db, name)) == NULL) {
_alpm_log(PM_LOG_DEBUG, "could not find %s in database\n", name);
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
}
@@ -78,11 +76,68 @@ int _alpm_remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
}
_alpm_log(PM_LOG_DEBUG, "adding %s in the targets list\n", info->name);
trans->packages = alpm_list_add(trans->packages, info);
trans->packages = alpm_list_add(trans->packages, _alpm_pkg_dup(info));
return(0);
}
static void remove_prepare_cascade(pmtrans_t *trans, pmdb_t *db,
alpm_list_t *lp)
{
ALPM_LOG_FUNC;
while(lp) {
alpm_list_t *i;
for(i = lp; i; i = i->next) {
pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
pmpkg_t *info = _alpm_db_get_pkgfromcache(db, miss->target);
if(info) {
if(!_alpm_pkg_find(trans->packages, alpm_pkg_get_name(info))) {
_alpm_log(PM_LOG_DEBUG, "pulling %s in the targets list\n",
alpm_pkg_get_name(info));
trans->packages = alpm_list_add(trans->packages, _alpm_pkg_dup(info));
}
} else {
_alpm_log(PM_LOG_ERROR, _("could not find %s in database -- skipping\n"),
miss->target);
}
}
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_depmiss_free);
alpm_list_free(lp);
lp = alpm_checkdeps(db, 1, trans->packages, NULL);
}
}
static void remove_prepare_keep_needed(pmtrans_t *trans, pmdb_t *db,
alpm_list_t *lp)
{
ALPM_LOG_FUNC;
/* Remove needed packages (which break dependencies) from the target list */
while(lp != NULL) {
alpm_list_t *i;
for(i = lp; i; i = i->next) {
pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
void *vpkg;
pmpkg_t *pkg = _alpm_pkg_find(trans->packages, miss->causingpkg);
if(pkg == NULL) {
continue;
}
trans->packages = alpm_list_remove(trans->packages, pkg, _alpm_pkg_cmp,
&vpkg);
pkg = vpkg;
if(pkg) {
_alpm_log(PM_LOG_WARNING, "removing %s from the target-list\n",
alpm_pkg_get_name(pkg));
_alpm_pkg_free(pkg);
}
}
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_depmiss_free);
alpm_list_free(lp);
lp = alpm_checkdeps(db, 1, trans->packages, NULL);
}
}
int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
{
alpm_list_t *lp;
@@ -97,37 +152,30 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
return(0);
}
if((trans->flags & PM_TRANS_FLAG_RECURSE) && !(trans->flags & PM_TRANS_FLAG_CASCADE)) {
_alpm_log(PM_LOG_DEBUG, "finding removable dependencies\n");
_alpm_recursedeps(db, trans->packages, trans->flags & PM_TRANS_FLAG_RECURSEALL);
}
if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
_alpm_log(PM_LOG_DEBUG, "looking for unsatisfied dependencies\n");
lp = alpm_checkdeps(db, 1, trans->packages, NULL);
if(lp != NULL) {
if(trans->flags & PM_TRANS_FLAG_CASCADE) {
while(lp) {
alpm_list_t *i;
for(i = lp; i; i = i->next) {
pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
pmpkg_t *info = _alpm_db_scan(db, miss->target);
if(info) {
if(!_alpm_pkg_find(alpm_pkg_get_name(info), trans->packages)) {
_alpm_log(PM_LOG_DEBUG, "pulling %s in the targets list\n",
alpm_pkg_get_name(info));
trans->packages = alpm_list_add(trans->packages, info);
}
} else {
_alpm_log(PM_LOG_ERROR, _("could not find %s in database -- skipping\n"),
miss->target);
}
}
FREELIST(lp);
lp = alpm_checkdeps(db, 1, trans->packages, NULL);
}
remove_prepare_cascade(trans, db, lp);
} else if (trans->flags & PM_TRANS_FLAG_UNNEEDED) {
/* Remove needed packages (which would break dependencies)
* from the target list */
remove_prepare_keep_needed(trans, db, lp);
} else {
if(data) {
*data = lp;
} else {
FREELIST(lp);
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_depmiss_free);
alpm_list_free(lp);
}
RET_ERR(PM_ERR_UNSATISFIED_DEPS, -1);
}
@@ -136,14 +184,15 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
/* re-order w.r.t. dependencies */
_alpm_log(PM_LOG_DEBUG, "sorting by dependencies\n");
lp = _alpm_sortbydeps(trans->packages, PM_TRANS_TYPE_REMOVE);
lp = _alpm_sortbydeps(trans->packages, 1);
/* free the old alltargs */
alpm_list_free(trans->packages);
trans->packages = lp;
if(trans->flags & PM_TRANS_FLAG_RECURSE) {
/* -Rcs == -Rc then -Rs */
if((trans->flags & PM_TRANS_FLAG_CASCADE) && (trans->flags & PM_TRANS_FLAG_RECURSE)) {
_alpm_log(PM_LOG_DEBUG, "finding removable dependencies\n");
_alpm_recursedeps(db, trans->packages, 0);
_alpm_recursedeps(db, trans->packages, trans->flags & PM_TRANS_FLAG_RECURSEALL);
}
if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {

View File

@@ -1,469 +0,0 @@
/*
* server.c
*
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdlib.h>
#include <errno.h>
#include <time.h>
#include <string.h>
#include <limits.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <download.h>
/* libalpm */
#include "server.h"
#include "alpm_list.h"
#include "error.h"
#include "log.h"
#include "alpm.h"
#include "util.h"
#include "handle.h"
#include "package.h"
pmserver_t *_alpm_server_new(const char *url)
{
struct url *u;
pmserver_t *server;
ALPM_LOG_FUNC;
CALLOC(server, 1, sizeof(pmserver_t), RET_ERR(PM_ERR_MEMORY, NULL));
u = downloadParseURL(url);
if(!u) {
_alpm_log(PM_LOG_ERROR, _("url '%s' is invalid, ignoring\n"), url);
RET_ERR(PM_ERR_SERVER_BAD_URL, NULL);
}
if(strlen(u->scheme) == 0) {
_alpm_log(PM_LOG_WARNING, _("url scheme not specified, assuming http\n"));
strcpy(u->scheme, "http");
}
if(strcmp(u->scheme,"ftp") == 0 && strlen(u->user) == 0) {
strcpy(u->user, "anonymous");
strcpy(u->pwd, "libalpm@guest");
}
/* remove trailing slashes, just to clean up the rest of the code */
for(int i = strlen(u->doc) - 1; u->doc[i] == '/'; --i)
u->doc[i] = '\0';
server->s_url = u;
return server;
}
void _alpm_server_free(pmserver_t *server)
{
ALPM_LOG_FUNC;
if(server == NULL) {
return;
}
/* free memory */
downloadFreeURL(server->s_url);
FREE(server);
}
/* remove filename info from "s_url->doc" and return it */
static char *strip_filename(pmserver_t *server)
{
char *p = NULL, *fname = NULL;
if(!server) {
return(NULL);
}
p = strrchr(server->s_url->doc, '/');
if(p && *(++p)) {
fname = strdup(p);
_alpm_log(PM_LOG_DEBUG, "stripping '%s' from '%s'\n",
fname, server->s_url->doc);
*p = 0;
}
/* s_url->doc now contains ONLY path information. return value
* if the file information from the original URL */
return(fname);
}
/* Return a 'struct url' for this server, for downloading 'filename'. */
static struct url *url_for_file(pmserver_t *server, const char *filename)
{
struct url *ret = NULL;
char *doc = NULL;
int doclen = 0;
doclen = strlen(server->s_url->doc) + strlen(filename) + 2;
CALLOC(doc, doclen, sizeof(char), RET_ERR(PM_ERR_MEMORY, NULL));
snprintf(doc, doclen, "%s/%s", server->s_url->doc, filename);
ret = downloadMakeURL(server->s_url->scheme,
server->s_url->host,
server->s_url->port,
doc,
server->s_url->user,
server->s_url->pwd);
FREE(doc);
return(ret);
}
/*
* Download a list of files from a list of servers
* - if one server fails, we try the next one in the list
* - if *dl_total is non-NULL, then it will be used as the starting
* download amount when TotalDownload is set. It will also be
* set to the final download amount for the calling function to use.
* - totalsize is the total download size for use when TotalDownload
* is set. Use 0 if the total download size is not known.
*
* RETURN: 0 for successful download, 1 on error
*/
int _alpm_downloadfiles(alpm_list_t *servers, const char *localpath,
alpm_list_t *files, int *dl_total, unsigned long totalsize)
{
return(_alpm_downloadfiles_forreal(servers, localpath, files, 0, NULL,
dl_total, totalsize));
}
/*
* This is the real downloadfiles, used directly by sync_synctree() to check
* modtimes on remote files.
* - if mtime1 is non-NULL, then only download files if they are different
* than mtime1.
* - if *mtime2 is non-NULL, it will be filled with the mtime of the remote
* file.
* - if *dl_total is non-NULL, then it will be used as the starting
* download amount when TotalDownload is set. It will also be
* set to the final download amount for the calling function to use.
* - totalsize is the total download size for use when TotalDownload
* is set. Use 0 if the total download size is not known.
*
* RETURN: 0 for successful download
* 1 if the mtimes are identical
* -1 on error
*/
int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath,
alpm_list_t *files, time_t mtime1, time_t *mtime2, int *dl_total,
unsigned long totalsize)
{
int dl_thisfile = 0;
alpm_list_t *lp;
int done = 0;
alpm_list_t *complete = NULL;
alpm_list_t *i;
ALPM_LOG_FUNC;
if(files == NULL) {
return(0);
}
for(i = servers; i && !done; i = i->next) {
pmserver_t *server = i->data;
/* get each file in the list */
for(lp = files; lp; lp = lp->next) {
struct url *fileurl = NULL;
char realfile[PATH_MAX];
char output[PATH_MAX];
char *fn = (char *)lp->data;
char pkgname[PKG_NAME_LEN];
fileurl = url_for_file(server, fn);
if(!fileurl) {
return(-1);
}
/* pass the raw filename for passing to the callback function */
strncpy(pkgname, fn, PKG_NAME_LEN);
_alpm_log(PM_LOG_DEBUG, "using '%s' for download progress\n", pkgname);
snprintf(realfile, PATH_MAX, "%s%s", localpath, fn);
snprintf(output, PATH_MAX, "%s%s.part", localpath, fn);
if(alpm_list_find_str(complete, fn)) {
continue;
}
if(!handle->xfercommand || !strcmp(fileurl->scheme, "file")) {
FILE *dlf, *localf = NULL;
struct url_stat ust;
struct stat st;
int chk_resume = 0;
if(stat(output, &st) == 0 && st.st_size > 0) {
_alpm_log(PM_LOG_DEBUG, "existing file found, using it\n");
fileurl->offset = (off_t)st.st_size;
dl_thisfile = st.st_size;
if (dl_total != NULL) {
*dl_total += st.st_size;
}
localf = fopen(output, "a");
chk_resume = 1;
} else {
fileurl->offset = (off_t)0;
dl_thisfile = 0;
}
/* libdownload does not reset the error code, reset it in
* the case of previous errors */
downloadLastErrCode = 0;
/* 10s timeout - TODO make a config option */
downloadTimeout = 10000;
dlf = downloadXGet(fileurl, &ust, (handle->nopassiveftp ? "" : "p"));
if(downloadLastErrCode != 0 || dlf == NULL) {
const char *host = _("disk");
if(strcmp(SCHEME_FILE, fileurl->scheme) != 0) {
host = fileurl->host;
}
_alpm_log(PM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"),
fn, host, downloadLastErrString);
if(localf != NULL) {
fclose(localf);
}
/* try the next server */
downloadFreeURL(fileurl);
continue;
} else {
_alpm_log(PM_LOG_DEBUG, "connected to %s successfully\n", fileurl->host);
}
if(ust.mtime && mtime1 && ust.mtime == mtime1) {
_alpm_log(PM_LOG_DEBUG, "mtimes are identical, skipping %s\n", fn);
complete = alpm_list_add(complete, fn);
if(localf != NULL) {
fclose(localf);
}
if(dlf != NULL) {
fclose(dlf);
}
downloadFreeURL(fileurl);
return(1);
}
if(ust.mtime && mtime2) {
*mtime2 = ust.mtime;
}
if(chk_resume && fileurl->offset == 0) {
_alpm_log(PM_LOG_WARNING, _("cannot resume download, starting over\n"));
if(localf != NULL) {
fclose(localf);
localf = NULL;
}
}
if(localf == NULL) {
_alpm_rmrf(output);
fileurl->offset = (off_t)0;
dl_thisfile = 0;
localf = fopen(output, "w");
if(localf == NULL) { /* still null? */
_alpm_log(PM_LOG_ERROR, _("cannot write to file '%s'\n"), output);
if(dlf != NULL) {
fclose(dlf);
}
downloadFreeURL(fileurl);
return(-1);
}
}
/* Progress 0 - initialize */
if(handle->dlcb) {
handle->dlcb(pkgname, 0, ust.size, dl_total ? *dl_total : 0,
totalsize);
}
int nread = 0;
char buffer[PM_DLBUF_LEN];
while((nread = fread(buffer, 1, PM_DLBUF_LEN, dlf)) > 0) {
if(ferror(dlf)) {
_alpm_log(PM_LOG_ERROR, _("error downloading '%s': %s\n"),
fn, downloadLastErrString);
fclose(localf);
fclose(dlf);
downloadFreeURL(fileurl);
return(-1);
}
int nwritten = 0;
while(nwritten < nread) {
nwritten += fwrite(buffer, 1, (nread - nwritten), localf);
if(ferror(localf)) {
_alpm_log(PM_LOG_ERROR, _("error writing to file '%s': %s\n"),
realfile, strerror(errno));
fclose(localf);
fclose(dlf);
downloadFreeURL(fileurl);
return(-1);
}
}
if(nwritten != nread) {
}
dl_thisfile += nread;
if (dl_total != NULL) {
*dl_total += nread;
}
if(handle->dlcb) {
handle->dlcb(pkgname, dl_thisfile, ust.size,
dl_total ? *dl_total : 0, totalsize);
}
}
downloadFreeURL(fileurl);
fclose(localf);
fclose(dlf);
rename(output, realfile);
complete = alpm_list_add(complete, fn);
} else {
int ret;
int usepart = 0;
char *ptr1, *ptr2;
char origCmd[PATH_MAX];
char parsedCmd[PATH_MAX] = "";
char url[PATH_MAX];
char cwd[PATH_MAX];
/* build the full download url */
snprintf(url, PATH_MAX, "%s://%s%s", fileurl->scheme,
fileurl->host, fileurl->doc);
/* we don't need this anymore */
downloadFreeURL(fileurl);
/* replace all occurrences of %o with fn.part */
strncpy(origCmd, handle->xfercommand, sizeof(origCmd));
ptr1 = origCmd;
while((ptr2 = strstr(ptr1, "%o"))) {
usepart = 1;
ptr2[0] = '\0';
strcat(parsedCmd, ptr1);
strcat(parsedCmd, output);
ptr1 = ptr2 + 2;
}
strcat(parsedCmd, ptr1);
/* replace all occurrences of %u with the download URL */
strncpy(origCmd, parsedCmd, sizeof(origCmd));
parsedCmd[0] = '\0';
ptr1 = origCmd;
while((ptr2 = strstr(ptr1, "%u"))) {
ptr2[0] = '\0';
strcat(parsedCmd, ptr1);
strcat(parsedCmd, url);
ptr1 = ptr2 + 2;
}
strcat(parsedCmd, ptr1);
/* cwd to the download directory */
getcwd(cwd, PATH_MAX);
if(chdir(localpath)) {
_alpm_log(PM_LOG_WARNING, _("could not chdir to %s\n"), localpath);
return(PM_ERR_CONNECT_FAILED);
}
/* execute the parsed command via /bin/sh -c */
_alpm_log(PM_LOG_DEBUG, "running command: %s\n", parsedCmd);
ret = system(parsedCmd);
if(ret == -1) {
_alpm_log(PM_LOG_WARNING, _("running XferCommand: fork failed!\n"));
return(PM_ERR_FORK_FAILED);
} else if(ret != 0) {
/* download failed */
_alpm_log(PM_LOG_DEBUG, "XferCommand command returned non-zero status code (%d)\n", ret);
} else {
/* download was successful */
complete = alpm_list_add(complete, fn);
if(usepart) {
rename(output, realfile);
}
}
chdir(cwd);
}
}
if(alpm_list_count(complete) == alpm_list_count(files)) {
done = 1;
}
}
alpm_list_free(complete);
return(done ? 0 : -1);
}
/** Fetch a remote pkg.
* @param url URL of the package to download
* @return the downloaded filepath on success, NULL on error
* @addtogroup alpm_misc
*/
char SYMEXPORT *alpm_fetch_pkgurl(const char *url)
{
pmserver_t *server;
char *filename, *filepath;
const char *cachedir;
ALPM_LOG_FUNC;
if(strstr(url, "://") == NULL) {
_alpm_log(PM_LOG_DEBUG, "Invalid URL passed to alpm_fetch_pkgurl\n");
return(NULL);
}
server = _alpm_server_new(url);
if(!server) {
return(NULL);
}
/* strip path information from the filename */
filename = strip_filename(server);
if(!filename) {
_alpm_log(PM_LOG_ERROR, _("URL does not contain a file for download\n"));
return(NULL);
}
/* find a valid cache dir to download to */
cachedir = _alpm_filecache_setup();
/* TODO this seems like needless complexity just to download one file */
alpm_list_t *servers = alpm_list_add(NULL, server);
alpm_list_t *files = alpm_list_add(NULL, filename);
/* download the file */
if(_alpm_downloadfiles(servers, cachedir, files, NULL, 0)) {
_alpm_log(PM_LOG_WARNING, _("failed to download %s\n"), url);
return(NULL);
}
_alpm_log(PM_LOG_DEBUG, "successfully downloaded %s\n", filename);
alpm_list_free(files);
alpm_list_free(servers);
_alpm_server_free(server);
/* we should be able to find the file the second time around */
filepath = _alpm_filecache_find(filename);
return(filepath);
}
/* vim: set ts=2 sw=2 noet: */

View File

@@ -1,46 +0,0 @@
/*
* server.h
*
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ALPM_SERVER_H
#define _ALPM_SERVER_H
#include "alpm_list.h"
#include "alpm.h"
#include <time.h>
#include <download.h>
/* Servers */
struct __pmserver_t {
/* useless abstraction now? */
struct url *s_url;
};
#define PM_DLBUF_LEN (1024 * 10)
pmserver_t *_alpm_server_new(const char *url);
void _alpm_server_free(pmserver_t *server);
int _alpm_downloadfiles(alpm_list_t *servers, const char *localpath,
alpm_list_t *files, int *dl_total, unsigned long totalsize);
int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath,
alpm_list_t *files, time_t mtime1, time_t *mtime2, int *dl_total,
unsigned long totalsize);
#endif /* _ALPM_SERVER_H */
/* vim: set ts=2 sw=2 noet: */

File diff suppressed because it is too large Load Diff

View File

@@ -25,12 +25,12 @@
/* Sync package */
struct __pmsyncpkg_t {
pmsynctype_t type;
pmpkgreason_t newreason;
pmpkg_t *pkg;
void *data;
alpm_list_t *removes;
};
pmsyncpkg_t *_alpm_sync_new(int type, pmpkg_t *spkg, void *data);
pmsyncpkg_t *_alpm_sync_new(pmpkgreason_t newreason, pmpkg_t *spkg, alpm_list_t *removes);
void _alpm_sync_free(pmsyncpkg_t *data);
int _alpm_sync_sysupgrade(pmtrans_t *trans,

View File

@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -35,7 +36,6 @@
/* libalpm */
#include "trans.h"
#include "alpm_list.h"
#include "error.h"
#include "package.h"
#include "util.h"
#include "log.h"
@@ -228,7 +228,6 @@ pmtrans_t *_alpm_trans_new()
CALLOC(trans, 1, sizeof(pmtrans_t), RET_ERR(PM_ERR_MEMORY, NULL));
trans->targets = NULL;
trans->packages = NULL;
trans->skip_add = NULL;
trans->skip_remove = NULL;
@@ -250,7 +249,6 @@ void _alpm_trans_free(pmtrans_t *trans)
return;
}
FREELIST(trans->targets);
if(trans->type == PM_TRANS_TYPE_SYNC) {
alpm_list_free_inner(trans->packages, (alpm_list_fn_free)_alpm_sync_free);
} else {
@@ -307,13 +305,7 @@ int _alpm_trans_addtarget(pmtrans_t *trans, char *target)
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(target != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
if(alpm_list_find_str(trans->targets, target)) {
return(0);
//RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
}
switch(trans->type) {
case PM_TRANS_TYPE_ADD:
case PM_TRANS_TYPE_UPGRADE:
if(_alpm_add_loadtarget(trans, handle->db_local, target) == -1) {
/* pm_errno is set by _alpm_add_loadtarget() */
@@ -335,8 +327,6 @@ int _alpm_trans_addtarget(pmtrans_t *trans, char *target)
break;
}
trans->targets = alpm_list_add(trans->targets, strdup(target));
return(0);
}
@@ -357,7 +347,6 @@ int _alpm_trans_prepare(pmtrans_t *trans, alpm_list_t **data)
}
switch(trans->type) {
case PM_TRANS_TYPE_ADD:
case PM_TRANS_TYPE_UPGRADE:
if(_alpm_add_prepare(trans, handle->db_local, data) == -1) {
/* pm_errno is set by _alpm_add_prepare() */
@@ -402,7 +391,6 @@ int _alpm_trans_commit(pmtrans_t *trans, alpm_list_t **data)
trans->state = STATE_COMMITING;
switch(trans->type) {
case PM_TRANS_TYPE_ADD:
case PM_TRANS_TYPE_UPGRADE:
if(_alpm_add_commit(trans, handle->db_local) == -1) {
/* pm_errno is set by _alpm_add_commit() */
@@ -463,7 +451,6 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
char tmpdir[PATH_MAX];
char cwd[PATH_MAX];
char *scriptpath;
struct stat buf;
pid_t pid;
int clean_tmpdir = 0;
int restore_cwd = 0;
@@ -471,14 +458,14 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
ALPM_LOG_FUNC;
if(stat(installfn, &buf)) {
if(access(installfn, R_OK)) {
/* not found */
_alpm_log(PM_LOG_DEBUG, "scriptlet '%s' not found\n", installfn);
return(0);
}
/* NOTE: popen will use the PARENT's /bin/sh, not the chroot's */
if(stat("/bin/sh", &buf)) {
if(access("/bin/sh", X_OK)) {
/* not found */
_alpm_log(PM_LOG_ERROR, _("No /bin/sh in parent environment, aborting scriptlet\n"));
return(0);
@@ -486,7 +473,7 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
/* creates a directory in $root/tmp/ for copying/extracting the scriptlet */
snprintf(tmpdir, PATH_MAX, "%stmp/", root);
if(stat(tmpdir, &buf)) {
if(access(tmpdir, F_OK) != 0) {
_alpm_makepath_mode(tmpdir, 01777);
}
snprintf(tmpdir, PATH_MAX, "%stmp/alpm_XXXXXX", root);
@@ -636,15 +623,6 @@ unsigned int SYMEXPORT alpm_trans_get_flags()
return handle->trans->flags;
}
alpm_list_t SYMEXPORT * alpm_trans_get_targets()
{
/* Sanity checks */
ASSERT(handle != NULL, return(NULL));
ASSERT(handle->trans != NULL, return(NULL));
return handle->trans->targets;
}
alpm_list_t SYMEXPORT * alpm_trans_get_pkgs()
{
/* Sanity checks */

View File

@@ -39,7 +39,6 @@ struct __pmtrans_t {
pmtranstype_t type;
pmtransflag_t flags;
pmtransstate_t state;
alpm_list_t *targets; /* list of (char *) */
alpm_list_t *packages; /* list of (pmpkg_t *) or (pmsyncpkg_t *) */
alpm_list_t *skip_add; /* list of (char *) */
alpm_list_t *skip_remove; /* list of (char *) */

View File

@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
@@ -43,114 +44,11 @@
/* libalpm */
#include "util.h"
#include "log.h"
#include "error.h"
#include "package.h"
#include "alpm.h"
#include "alpm_list.h"
#include "md5.h"
#ifndef HAVE_STRVERSCMP
/* GNU's strverscmp() function, taken from glibc 2.3.2 sources
*/
/* Compare strings while treating digits characters numerically.
Copyright (C) 1997, 2002 Free Software Foundation, Inc.
Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
/* states: S_N: normal, S_I: comparing integral part, S_F: comparing
fractionnal parts, S_Z: idem but with leading Zeroes only */
#define S_N 0x0
#define S_I 0x4
#define S_F 0x8
#define S_Z 0xC
/* result_type: CMP: return diff; LEN: compare using len_diff/diff */
#define CMP 2
#define LEN 3
/* Compare S1 and S2 as strings holding indices/version numbers,
returning less than, equal to or greater than zero if S1 is less than,
equal to or greater than S2 (for more info, see the texinfo doc).
*/
int strverscmp (s1, s2)
const char *s1;
const char *s2;
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
unsigned char c1, c2;
int state;
int diff;
/* Symbol(s) 0 [1-9] others (padding)
Transition (10) 0 (01) d (00) x (11) - */
static const unsigned int next_state[] =
{
/* state x d 0 - */
/* S_N */ S_N, S_I, S_Z, S_N,
/* S_I */ S_N, S_I, S_I, S_I,
/* S_F */ S_N, S_F, S_F, S_F,
/* S_Z */ S_N, S_F, S_Z, S_Z
};
static const int result_type[] =
{
/* state x/x x/d x/0 x/- d/x d/d d/0 d/-
0/x 0/d 0/0 0/- -/x -/d -/0 -/- */
/* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
/* S_I */ CMP, -1, -1, CMP, +1, LEN, LEN, CMP,
+1, LEN, LEN, CMP, CMP, CMP, CMP, CMP,
/* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
/* S_Z */ CMP, +1, +1, CMP, -1, CMP, CMP, CMP,
-1, CMP, CMP, CMP
};
if (p1 == p2)
return 0;
c1 = *p1++;
c2 = *p2++;
/* Hint: '0' is a digit too. */
state = S_N | ((c1 == '0') + (isdigit (c1) != 0));
while ((diff = c1 - c2) == 0 && c1 != '\0')
{
state = next_state[state];
c1 = *p1++;
c2 = *p2++;
state |= (c1 == '0') + (isdigit (c1) != 0);
}
state = result_type[state << 2 | (((c2 == '0') + (isdigit (c2) != 0)))];
switch (state)
{
case CMP:
return diff;
case LEN:
while (isdigit (*p1++))
if (!isdigit (*p2++))
return 1;
return isdigit (*p2) ? -1 : diff;
default:
return state;
}
}
#endif
#ifndef HAVE_STRSEP
/* This is a replacement for strsep which is not portable (missing on Solaris).
* Copyright (c) 2001 by François Gouget <fgouget_at_codeweavers.com> */
@@ -186,57 +84,64 @@ int _alpm_makepath(const char *path)
/* does the same thing as 'mkdir -p' */
int _alpm_makepath_mode(const char *path, mode_t mode)
{
char *orig, *str, *ptr;
char full[PATH_MAX] = "";
mode_t oldmask;
oldmask = umask(0000);
/* A bit of pointer hell here. Descriptions:
* orig - a copy of path so we can safely butcher it with strsep
* str - the current position in the path string (after the delimiter)
* ptr - the original position of str after calling strsep
* incr - incrementally generated path for use in stat/mkdir call
*/
char *orig, *str, *ptr, *incr;
mode_t oldmask = umask(0000);
int ret = 0;
orig = strdup(path);
incr = calloc(strlen(orig) + 1, sizeof(char));
str = orig;
while((ptr = strsep(&str, "/"))) {
if(strlen(ptr)) {
struct stat buf;
strcat(full, "/");
strcat(full, ptr);
if(stat(full, &buf)) {
if(mkdir(full, mode)) {
FREE(orig);
umask(oldmask);
_alpm_log(PM_LOG_ERROR, _("failed to make path '%s' : %s\n"),
path, strerror(errno));
return(1);
/* we have another path component- append the newest component to
* existing string and create one more level of dir structure */
strcat(incr, "/");
strcat(incr, ptr);
if(access(incr, F_OK)) {
if(mkdir(incr, mode)) {
ret = 1;
break;
}
}
}
}
FREE(orig);
free(orig);
free(incr);
umask(oldmask);
return(0);
return(ret);
}
#define CPBUFSIZE 8 * 1024
int _alpm_copyfile(const char *src, const char *dest)
{
FILE *in, *out;
size_t len;
char buf[4097];
char *buf;
int ret = 0;
in = fopen(src, "r");
in = fopen(src, "rb");
if(in == NULL) {
return(1);
}
out = fopen(dest, "w");
out = fopen(dest, "wb");
if(out == NULL) {
fclose(in);
return(1);
}
CALLOC(buf, (size_t)CPBUFSIZE, (size_t)1, ret = 1; goto cleanup;);
/* do the actual file copy */
while((len = fread(buf, 1, 4096, in))) {
while((len = fread(buf, 1, CPBUFSIZE, in))) {
fwrite(buf, 1, len, out);
}
fclose(in);
/* chmod dest to permissions of src, as long as it is not a symlink */
struct stat statbuf;
@@ -246,12 +151,14 @@ int _alpm_copyfile(const char *src, const char *dest)
}
} else {
/* stat was unsuccessful */
fclose(out);
return(1);
ret = 1;
}
cleanup:
fclose(in);
fclose(out);
return(0);
FREE(buf);
return(ret);
}
/* Trim whitespace and newlines from a string
@@ -334,7 +241,7 @@ char *_alpm_strreplace(const char *str, const char *needle, const char *replace)
/* Create a lock file */
int _alpm_lckmk()
{
int fd, count = 0;
int fd;
char *dir, *ptr;
const char *file = alpm_option_get_lockfile();
@@ -345,17 +252,9 @@ int _alpm_lckmk()
*ptr = '\0';
}
_alpm_makepath(dir);
while((fd = open(file, O_WRONLY | O_CREAT | O_EXCL, 0000)) == -1 && errno == EACCES) {
if(++count < 1) {
sleep(1);
} else {
return(-1);
}
}
FREE(dir);
fd = open(file, O_WRONLY | O_CREAT | O_EXCL, 0000);
return(fd > 0 ? fd : -1);
}
@@ -371,6 +270,13 @@ int _alpm_lckrm()
/* Compression functions */
/**
* @brief Unpack a specific file or all files in an archive.
*
* @param archive the archive to unpack
* @param prefix where to extract the files
* @param fn a file within the archive to unpack or NULL for all
*/
int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
{
int ret = 1;
@@ -382,7 +288,7 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
ALPM_LOG_FUNC;
if((_archive = archive_read_new()) == NULL)
RET_ERR(PM_ERR_LIBARCHIVE_ERROR, -1);
RET_ERR(PM_ERR_LIBARCHIVE, -1);
archive_read_support_compression_all(_archive);
archive_read_support_format_all(_archive);
@@ -408,13 +314,17 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
archive_entry_set_mode(entry, 0755);
}
/* If a specific file was requested skip entries that don't match. */
if (fn && strcmp(fn, entryname)) {
_alpm_log(PM_LOG_DEBUG, "skipping: %s\n", entryname);
if (archive_read_data_skip(_archive) != ARCHIVE_OK) {
ret = 1;
goto cleanup;
}
continue;
}
/* Extract the archive entry. */
ret = 0;
snprintf(expath, PATH_MAX, "%s/%s", prefix, entryname);
archive_entry_set_pathname(entry, expath);
@@ -484,12 +394,18 @@ int _alpm_rmrf(const char *path)
return(0);
}
int _alpm_logaction(unsigned short usesyslog, FILE *f, const char *fmt, va_list args)
int _alpm_logaction(unsigned short usesyslog, FILE *f,
const char *fmt, va_list args)
{
int ret = 0;
if(usesyslog) {
vsyslog(LOG_WARNING, fmt, args);
/* we can't use a va_list more than once, so we need to copy it
* so we can use the original when calling vfprintf below. */
va_list args_syslog;
va_copy(args_syslog, args);
vsyslog(LOG_WARNING, fmt, args_syslog);
va_end(args_syslog);
}
if(f) {
@@ -513,12 +429,11 @@ int _alpm_logaction(unsigned short usesyslog, FILE *f, const char *fmt, va_list
int _alpm_ldconfig(const char *root)
{
char line[PATH_MAX];
struct stat buf;
snprintf(line, PATH_MAX, "%setc/ld.so.conf", root);
if(stat(line, &buf) == 0) {
if(access(line, F_OK) == 0) {
snprintf(line, PATH_MAX, "%ssbin/ldconfig", root);
if(stat(line, &buf) == 0) {
if(access(line, X_OK) == 0) {
char cmd[PATH_MAX];
snprintf(cmd, PATH_MAX, "%s -r %s", line, root);
system(cmd);
@@ -535,13 +450,12 @@ int _alpm_str_cmp(const void *s1, const void *s2)
return(strcmp(s1, s2));
}
/** Find a package file in an alpm cachedir.
* @param filename name of package file to find
/** Find a filename in a registered alpm cachedir.
* @param filename name of file to find
* @return malloced path of file, NULL if not found
*/
char *_alpm_filecache_find(const char* filename)
{
struct stat buf;
char path[PATH_MAX];
char *retpath;
alpm_list_t *i;
@@ -550,8 +464,7 @@ char *_alpm_filecache_find(const char* filename)
for(i = alpm_option_get_cachedirs(); i; i = alpm_list_next(i)) {
snprintf(path, PATH_MAX, "%s%s", (char*)alpm_list_getdata(i),
filename);
if(stat(path, &buf) == 0) {
/* TODO maybe check to make sure it is readable? */
if(access(path, R_OK) == 0) {
retpath = strdup(path);
_alpm_log(PM_LOG_DEBUG, "found cached pkg: %s\n", retpath);
return(retpath);
@@ -640,13 +553,7 @@ char SYMEXPORT *alpm_get_md5sum(const char *filename)
ret = md5_file(filename, output);
if (ret > 0) {
if (ret == 1) {
_alpm_log(PM_LOG_ERROR, _("md5: %s can't be opened\n"), filename);
} else if (ret == 2) {
_alpm_log(PM_LOG_ERROR, _("md5: %s can't be read\n"), filename);
}
return(NULL);
RET_ERR(PM_ERR_NOT_A_FILE, NULL);
}
/* Convert the result to something readable */
@@ -660,4 +567,52 @@ char SYMEXPORT *alpm_get_md5sum(const char *filename)
return(md5sum);
}
int _alpm_test_md5sum(const char *filepath, const char *md5sum)
{
char *md5sum2;
int ret;
md5sum2 = alpm_get_md5sum(filepath);
if(md5sum == NULL || md5sum2 == NULL) {
ret = -1;
} else if(strcmp(md5sum, md5sum2) != 0) {
ret = 1;
} else {
ret = 0;
}
FREE(md5sum2);
return(ret);
}
char *_alpm_archive_fgets(char *line, size_t size, struct archive *a)
{
/* for now, just read one char at a time until we get to a
* '\n' char. we can optimize this later with an internal
* buffer. */
/* leave room for zero terminator */
char *last = line + size - 1;
char *i;
for(i = line; i < last; i++) {
int ret = archive_read_data(a, i, 1);
/* special check for first read- if null, return null,
* this indicates EOF */
if(i == line && (ret <= 0 || *i == '\0')) {
return(NULL);
}
/* check if read value was null or newline */
if(ret <= 0 || *i == '\0' || *i == '\n') {
last = i + 1;
break;
}
}
/* always null terminate the buffer */
*last = '\0';
return(line);
}
/* vim: set ts=2 sw=2 noet: */

View File

@@ -30,6 +30,7 @@
#include <stdarg.h>
#include <time.h>
#include <sys/stat.h> /* struct stat */
#include <archive.h> /* struct archive */
#ifdef ENABLE_NLS
#include <libintl.h> /* here so it doesn't need to be included elsewhere */
@@ -43,12 +44,17 @@
#define MALLOC(p, s, action) do { p = calloc(1, s); if(p == NULL) { ALLOC_FAIL(s); action; } } while(0)
#define CALLOC(p, l, s, action) do { p = calloc(l, s); if(p == NULL) { ALLOC_FAIL(s); action; } } while(0)
#define STRDUP(r, s, action) do { r = strdup(s); if(r == NULL) { ALLOC_FAIL(strlen(s)); action; } } while(0)
/* This strdup macro is NULL safe- copying NULL will yield NULL */
#define STRDUP(r, s, action) do { if(s != NULL) { r = strdup(s); if(r == NULL) { ALLOC_FAIL(strlen(s)); action; } } else { r = NULL; } } while(0)
#define FREE(p) do { if(p) { free(p); p = NULL; } } while(0)
#define FREE(p) do { free(p); p = NULL; } while(0)
#define ASSERT(cond, action) do { if(!(cond)) { action; } } while(0)
#define RET_ERR(err, ret) do { pm_errno = (err); \
_alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerrorlast()); \
return(ret); } while(0)
int _alpm_makepath(const char *path);
int _alpm_makepath_mode(const char *path, mode_t mode);
int _alpm_copyfile(const char *src, const char *dest);
@@ -64,10 +70,9 @@ int _alpm_str_cmp(const void *s1, const void *s2);
char *_alpm_filecache_find(const char *filename);
const char *_alpm_filecache_setup(void);
int _alpm_lstat(const char *path, struct stat *buf);
int _alpm_test_md5sum(const char *filepath, const char *md5sum);
char *_alpm_archive_fgets(char *line, size_t size, struct archive *a);
#ifndef HAVE_STRVERSCMP
int strverscmp(const char *, const char *);
#endif
#ifndef HAVE_STRSEP
char *strsep(char **, const char *);
#endif

View File

@@ -2,7 +2,7 @@
# NOTE: Changing this file will not affect anything until you rerun configure.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
# 2007 Free Software Foundation, Inc.
# 2007, 2008 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
@@ -43,8 +43,8 @@ EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.5.24
TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)"
VERSION=1.5.26
TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)"
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -113,15 +113,21 @@ esac
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
lt_env=
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${$lt_var+set}\" = set; then
save_$lt_var=\$$lt_var
lt_env=\"$lt_var=\$$lt_var \$lt_env\"
$lt_var=C
export $lt_var
fi"
done
if test -n "$lt_env"; then
lt_env="env $lt_env"
fi
# Make sure IFS has a sensible default
lt_nl='
'
@@ -485,7 +491,7 @@ do
echo "\
$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit $?
@@ -788,6 +794,7 @@ if test -z "$show_help"; then
*.for) xform=for ;;
*.java) xform=java ;;
*.obj) xform=obj ;;
*.sx) xform=sx ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@@ -956,7 +963,7 @@ EOF
$run $rm "$lobj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
if $run eval $lt_env "$command"; then :
else
test -n "$output_obj" && $run $rm $removelist
exit $EXIT_FAILURE
@@ -1028,7 +1035,7 @@ EOF
command="$command$suppress_output"
$run $rm "$obj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
if $run eval $lt_env "$command"; then :
else
$run $rm $removelist
exit $EXIT_FAILURE
@@ -1161,6 +1168,7 @@ EOF
thread_safe=no
vinfo=
vinfo_number=no
single_module="${wl}-single_module"
func_infer_tag $base_compile
@@ -1646,6 +1654,11 @@ EOF
continue
;;
-multi_module)
single_module="${wl}-multi_module"
continue
;;
-module)
module=yes
continue
@@ -2149,7 +2162,12 @@ EOF
continue
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
if test "$linkmode" = lib; then
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
else
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
fi
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
lib="$searchdir/lib${name}${search_ext}"
@@ -2945,12 +2963,18 @@ EOF
# we do not want to link against static libs,
# but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
if test -f "$path/$depdepl" ; then
if test -f "$deplibdir/$depdepl" ; then
depdepl="$deplibdir/$depdepl"
elif test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
else
# Can't find it, oh well...
depdepl=
fi
# do not add paths which are already there
case " $newlib_search_path " in
@@ -3098,9 +3122,10 @@ EOF
case $linkmode in
oldlib)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
fi
case " $deplibs" in
*\ -l* | *\ -L*)
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
@@ -4237,9 +4262,10 @@ EOF
;;
obj)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
fi
case " $deplibs" in
*\ -l* | *\ -L*)
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
@@ -6478,7 +6504,7 @@ relink_command=\"$relink_command\""
fi
# Restore saved environment variables
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
eval "if test \"\${save_$lt_var+set}\" = set; then
$lt_var=\$save_$lt_var; export $lt_var

View File

@@ -8,7 +8,7 @@ check_SCRIPTS = \
pmtest.py \
util.py \
$(wildcard tests/*.py) \
tests/TESTS
vercmptest.sh
noinst_SCRIPTS = $(check_SCRIPTS)

View File

@@ -288,7 +288,7 @@ Possible rules are:
PKG_GROUPS=name|group
PKG_PROVIDES=name|providename
PKG_DEPENDS=name|depname
PKG_REQUIREDBY=name|reqbyname
PKG_OPTDEPENDS=name|depname
PKG_REASON=name|intvalue
PKG_FILES=name|filename
PKG_BACKUP=name|backupname
@@ -303,6 +303,8 @@ its DEPENDS field.
FILE_EXIST=path/to/file
FILE_MODIFIED=path/to/file
FILE_MODE=path/to/file|octal
FILE_TYPE=path/to/file|type (possible types: dir, file, link)
FILE_PACNEW=path/to/file
FILE_PACSAVE=path/to/file
FILE_PACORIG=path/to/file

View File

@@ -93,13 +93,18 @@ if __name__ == "__main__":
env.pacman["valgrind"] = opts.valgrind
env.pacman["manual-confirm"] = opts.manualconfirm
if len(opts.testcases) == 0:
if opts.testcases is None or len(opts.testcases) == 0:
print "no tests defined, nothing to do"
sys.exit(2)
else:
for i in opts.testcases: env.addtest(i)
for i in opts.testcases:
env.addtest(i)
# run tests and print overall results
env.run()
env.results()
if env.failed > 0:
sys.exit(1)
# vim: set ts=4 sw=4 et:

View File

@@ -19,6 +19,7 @@
import os
import tempfile
import shutil
import tarfile
import pmpkg
from util import *
@@ -343,7 +344,13 @@ class pmdb:
# Generate database archive
mkdir(path)
archive = os.path.join(path, "%s%s" % (self.treename, PM_EXT_DB))
os.system("tar zcf %s *" % archive)
tar = tarfile.open(archive, "w:gz")
for root, dirs, files in os.walk('.'):
for d in dirs:
tar.add(os.path.join(root, d), recursive=False)
for f in files:
tar.add(os.path.join(root, f))
tar.close()
os.chdir(curdir)
shutil.rmtree(tmpdir)

Some files were not shown because too many files have changed in this diff Show More