1
0
forked from mirrors/pacman

Compare commits

..

369 Commits

Author SHA1 Message Date
Dan McGee
507a2d15e6 Final changes before 4.0.1 release
* Add last-minute changes to NEWS
* Don't treat '_' or '_n' special in scripts when finding translatable
  strings; this breaks with one use of `read` and a dummy _ variable

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-20 21:29:46 -06:00
Dave Reisner
b8ef22312b makepkg: trim trailing space from whitespace sensitive vars
This applies to pkgver, pkgrel, and epoch and ensures that any trailing
whitespace outside of the context of the variable declaration itself is
properly trimmed. The Bash parser will ignore this, and so should we.

We don't need to worry about leading space because it would force a
syntax error, or fail validation.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-20 21:17:43 -06:00
Dan McGee
c79c068fe9 Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-16 14:45:25 -06:00
Dave Reisner
ad09db3c55 makepkg.conf: disable motd printing for rsync DLAGENT
Fixes FS#26806.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-15 09:37:42 -06:00
Dan McGee
9363e7dc22 Allow sync_prepare to work in certain cases without sync databases
When doing a bare -U operation on a local package that doesn't pull in
any dependencies from the sync databases, we can get away with missing
database files. This makes the check conditional on no sync targets
found in the target list. This is not the prettiest code here so we have
a bit of hackish behavior required to straighten both the behavior and
the nonsensical error message out.

Addresses FS#26899.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-15 09:12:18 -06:00
Allan McRae
37ff0f5658 Update documentation regarding signature extensions
Commit e7b56f48 allowed makepkg to handle pgp signatures with the
.sign extension.  Update the man page to reflect this.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-15 08:17:08 -06:00
Dan McGee
c0ce10397a Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-13 22:21:02 -06:00
Dan McGee
fcf0a8b203 Updates in preparation for 4.0.1 release
Bump the version, update the translation template files, and fill in
NEWS with relevant commits and changes since 4.0.0.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-13 21:55:52 -06:00
Dave Reisner
42e2f8bfbf makepkg: check for value before using eval'd var
This prevent bsdtar from exploding when install= or changelog= are
present without a value.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-10 09:22:17 -06:00
Allan McRae
e7b56f48d7 makepkg: handle pgp signatures with .sign extension
Detached sgnature files with extension .sign are accepted by gnupg.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-07 09:14:09 -06:00
Dan McGee
601c808b8d Fix download progress rounding edge case
Allan's original message: Occasionally when the download rate showed
100.0 the output got messed up. This was caused by the rounding of a
number between 99.95 and 100.  Adjust the threshold to avoid this
rounding issue.

Dan: make this fix, but also show values between 0 and 9.995 with two
decimal places since we have the room.

Original-fix-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-03 09:54:33 -05:00
Dan McGee
1953fe4368 Fix thinko in _alpm_strip_newline
The point of this early compare to NULL byte check was so we could bail
early and skip the strcmp() call. Given we weren't doing the check
right, this never exited early. Fix it to work as intended.

Noticed-by: Pepe Juárez <trulustapa@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-01 19:17:26 -05:00
Dave Reisner
d98ff04cc9 src/util: link vercmp against .lo, not the .o
This seems to fix FS#26652.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-01 10:25:15 -05:00
Dave Reisner
4c259d51f7 dload: remove redundant conditional
Replacing the strdup when after the first NULL check assures that we get
continue with payload->remote_name defined.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-27 17:49:09 -05:00
Dave Reisner
f4875fab9b dload: chmod tempfiles to respect umask
Dan: fix mask calculation, add it to the success/fail block instead.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-27 17:46:48 -05:00
Dan McGee
3343185473 Introduce ALPM_BUFFER_SIZE constant
This takes the place of three previously used constants:
ARCHIVE_DEFAULT_BYTES_PER_BLOCK, BUFFER_SIZE, and CPBUFSIZE.

In libarchive 3.0, the first constant will be no more, so we can ensure
we are forward-compatible by removing our usage of it now. The rest are
unified for consistency.

By default, we will use the value of BUFSIZ provided by <stdio.h>, which
is 8192 on Linux. If that is undefined, a default value is provided.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-27 14:59:24 -05:00
Dave Reisner
1052709921 paccache: add vim modeline
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-26 17:46:59 -05:00
Dave Reisner
24881034f6 paccache: ensure seen/seenarch vars are set
Doesn't do a whole lot of good to compare against values that are never
set. Fixes bug where -vvv output wasn't grouping packages together
properly.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-26 17:46:53 -05:00
Dan McGee
8a9ce12a27 Fix issues with replacing unowned symlinks
There aretwo seperate issues in the same block of file conflict
checking code here:
1) If realpath errored, such as when a symlink was broken, we would call
   'continue' rather than simply exit this particular method of
   resolution. This was likely just a copy-paste mistake as the previous
   resolving steps all use loops where continue makes sense. Refactor
   the check so we only proceed if realpath is successful, and continue
   with the rest of the checks either way.
2) The real problem this code was trying to solve was canonicalizing
   path component (e.g., directory) symlinks. The final component, if
   not a directory, should not be handled at all in this loop. Add a
   !S_ISLNK() condition to the loop so we only call this for real files.

There are few other small cleanups to the debug messages that I made
while debugging this problem- we don't need to keep printing the file
name, and ensure every block that sets resolved_conflict to true prints
a debug message so we know how it was resolved.

This fixes the expected failures from symlink010.py and symlink011.py,
while still ensuring the fix for fileconflict007.py works.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-26 17:32:46 -05:00
Dan McGee
5c1885b55e Add some unowned symlink replacement tests
These should all prevent installation, and yet two of the three tests
currently fail. Not good.

The best way to see what is going on here is to diff the three new tests
side by side- there is only a small difference between the three tests,
and that is in the destination of the symlink in question that should
never be overwritten.

  symlink010.py: myprogsuffix -> myprog
  symlink011.py: myprogsuffix -> broken
  symlink012.py: myprogsuffix -> otherprog

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-26 17:31:43 -05:00
Dan McGee
7a6b01d46c Don't realloc a 0-length files array when loading packages
There is some pecular behavior going on here when a package is loaded
that has no files, as is very common in our test suite. When we enter
the realloc/sort code, a package without files will call the following:

    files = realloc(NULL, 0);

One would assume this is a no-op, returning a NULL pointer, but that is
not the case and valgrind later reports we are leaking memory. Fix the
whole thing by skipping the reallocation and sort steps if the pointer
is NULL, as we have nothing to do.

Note that the package still gets marked as 'files loaded', becuase
although there were none, we tried and were successful.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-26 15:44:55 -05:00
Dave Reisner
2da59e1aa9 lib/sync: inform callers of compute_download_size of a partial
Extend the return values of compute_download_size to allow callers to
know that a .part file exists for the package.

This extra value isn't currently used, but it'll be needed later on.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-25 10:38:12 -05:00
Allan McRae
571f2f7814 Fix libtool detection of --as-needed flag
The fix for -Wl,--as-needed in commit b0f9477f assumes that
--as-needed/--no-as-needed is the only option given in a -Wl line.
However, it is perfectly valid to specify multiple flags comma
separated after a single -Wl (e.g. the default LDFLAGS in Arch
Linux makepkg.conf).

Adjust the fix so it detect --as-needed in a more general context

> readelf -d lib/libalpm/.libs/libalpm.so.?.?.? | grep NEEDED | wc -l
Before: 13
After: 5

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-25 10:37:30 -05:00
Allan McRae
0d9e7da309 Update libtool files
Update for libtool-2.4.2 while keeping the fix for --as-needed from
commit b0f9477f.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-25 10:37:21 -05:00
Dan McGee
5853025137 Add more logging to download code
This adds a logger to the CURLE_OK case so we can always know the return
code if it was >= 400, and debug log it regardless. Also adjust another
logger to use the cURL error message directly, as well as use fstat()
when we have an open file handle rather than stat().

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-24 13:49:14 -05:00
lolilolicon
d6e3446e70 bacman: pkgrel does not have to be an integer
pkgrel, as with pkgver, simply mustn't contain hyphens.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21 12:31:24 -05:00
Dan McGee
20a47aba8e Remove remaining usages of fprintf() from frontend
These can either be replaced with pm_printf() if they are error related,
or in the fprintf(stdout, ...) case a bare printf() will do.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21 10:51:49 -05:00
Dan McGee
9e9ecf2183 Remove pm_fprintf() in favor of pm_printf()
Now that pm_printf() always prints to stderr, we don't need this second
function that was always used with stderr as the first argument. Thus,
this patch removes the function and makes the following sed replacement:

    sed -i -e 's#pm_fprintf(stderr, #pm_printf(#g' src/pacman/*.c

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21 10:45:18 -05:00
Dan McGee
45f86ca1ca Use stderr as output stream for pm_printf()
This matches what we now do in our backend callback function- all
debug/info/warning/error/etc. messages should be on stderr. These are
all the messages with a "warning:" or other type prefix, so does not
affect general pacman output.

This should fix the output confusion noted in FS#26555.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-21 10:38:02 -05:00
Dan McGee
4bada45464 pacman-key: add a default keyserver timeout value on --init
The default is supposidely 30 seconds from the gpg manpage, but that
sure wasn't what I was seeing- it was somewhere closer to two minutes of
silence. Add a more reasonable 10 second timeout value which should be
good enough for any keyserver that doesn't totally stink at it's job.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-17 09:42:46 -05:00
Dan McGee
bac670ddc9 Show an error message on failed remote key lookup
The absolutely terrible part about this is the failure on GPGME's part
to distinguish between "key not found" and "keyserver timeout". Instead,
it returns the same silly GPG_ERR_EOF in both cases (why isn't
GPG_ERR_TIMEOUT being used?), leaving us helpless to tell them apart.

Spit out a generic enough error message that covers both cases;
unfortunately we can't provide much guidance to the user because we
aren't sure what actually happened.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-17 09:38:35 -05:00
Dan McGee
842c4422ed Table display: print message with warning: prefix
Use the normal error functions here rather than a bare fprintf().

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-17 08:28:57 -05:00
Dan McGee
020bdb4298 makepkg: don't attach traps until after argument parsing
Nothing we do in our traps is necessary this early in the script. This
fixes FS#26196.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-14 08:16:06 -05:00
Dan McGee
185cbb8a44 Add missing #ifdef around cURL error code in download struct
Thanks to Eduardo Tongson on the mailing list.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-14 07:38:58 -05:00
Dan McGee
5b5b250443 Coding style cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 15:16:59 -05:00
Dan McGee
86bc36412e curl_gethost() potential bug fixups
This is in the realm of "probably not going to happen", but if someone
were to translate "disk" to a string longer than 256 characters, we
would have a smashed/corrupted stack due to our unchecked strcpy() call.
Rework the function to always length-check the value we copy into the
hostname buffer, and do it with memcpy rather than the more cumbersome
and unnecessary snprintf.

Finally, move the magic 256 value into a constant and pass it into the
function which is going to get inlined anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 15:16:10 -05:00
Dan McGee
1ebe5dc197 doc/index.txt: Reformat past releases chart
This makes it a three-column deal with releases all the way back to 1.0.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 14:54:49 -05:00
Dan McGee
43cad9c871 doc: update .gitignore, add CSS override for new tables usage
* Make all docs depend on Makefile; if we change flags here we want them
  rebuilt.
* Add explicit filenames to .gitignore so we can add our own CSS
  override file, and add an asciidoc-override.css resource.
* Adjust a few asciidoc options when generating HTML.
* Remove asciidoc-manpage.css; apparantly this doesn't exist anymore.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 14:53:52 -05:00
Dan McGee
04fd320e97 Update NEWS for missing 4.0 stuff and 4.0.1 changes so far
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 11:22:50 -05:00
Lukas Fleischer
241946ccea scripts/*.sh.in: Fix signal handler error messages
This includes some fixes to the messages that are displayed when a
signal is caught in makepkg or repo-add:

* Instead of always showing "==> ERROR: TERM signal caught. Exiting...",
  replace "TERM" by whatever signal is actually caught.

* Fix a typo in the SIGERR error message in repo-add ("occurred" instead
  of "occured"). Francois already fixed this for makepkg in 1e51b81c.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 11:20:12 -05:00
Lukas Fleischer
d4c97ea2f6 repo-add: Avoid race condition in signal handlers
There is a small chance that a user sends SIGINT (or any other signal
that is trapped) when we're already in clean_up() which used to lead to
trap_exit() being executed and the remaining code in clean_up() being
skipped due to the bash signal/trap handler blocking EXIT (since its
handler is already being executed, even if it's interrupted).

In practice, this behaviour caused unexpected results (primarily because
pressing ^C at the wrong time left a lock file behind):

    $ ./repo-add extra.db.tar.gz foobar
    ==> Extracting database to a temporary location...
    ^C
    ==> ERROR: Aborted by user! Exiting...
    $ ./repo-add extra.db.tar.gz foobar
    ==> Extracting database to a temporary location...
    ==> ERROR: File 'foobar' not found.
    ==> No packages modified, nothing to do.
    ^C
    ==> ERROR: Aborted by user! Exiting...
    $ ./repo-add extra.db.tar.gz foobar
    ==> ERROR: Failed to acquire lockfile: extra.db.tar.gz.lck.
    ==> ERROR: Held by process 18522

Fix this and reduce the chance of race conditions in signal handlers by:

* Unhooking all traps in both clean_up() and trap_exit().

* Call clean_up() explicitly in trap_exit() to make sure we remove the
  lock file and the temporary directory even if we send SIGINT when
  clean_up() is already being executed but didn't reach the unhook code
  yet.

Also, add an optional parameter to clean_up() to allow for setting an
explicit exit code when we call clean_up() from trap_exit().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-13 11:20:03 -05:00
Dan McGee
12642a299b Add user-visible warning message if public keyring not found
This should help point users in the right direction if they have not
initialized via pacman-key just yet.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12 17:54:08 -05:00
Dan McGee
2a18171afa signing: delay gpgme_init() until latest possible moment
In the default configuration, we can enter the signing code but still
have nothing to do with GPGME- for example, if database signatures are
optional but none are present. Delay initialization of GPGME until we
know there is a signature file present or we were passed base64-encoded
data.

This also makes debugging with valgrind a lot easier as you don't have
to deal with all the GPGME error noise because their code leaks like a
sieve.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12 14:20:47 -05:00
Dan McGee
61c6ae01b3 VerbosePkgLists: format table lines in i18n-compatible way
This had the unfortunate implementation detail that depended on the
strings having 1 byte == 1 column hold true. As we know, this is not at
all the case once you move past the base ASCII character set.

Reimplement this whole thing so it doesn't depend on format strings at
all. Instead, simply calculate the max column widths, and then when
displaying each row add the correct amount of padding using UTF-8 safe
string length functions.

Before:

名字        旧版本新版本  净变化 下载大小

libgee                0.6.2.1-1  0.60 MiB    0.10 MiB
libsocialweb          0.25.19-2  1.92 MiB    0.23 MiB
folks                 0.6.3.2-1  1.38 MiB    0.25 MiB

After:

名字          旧版本  新版本     净变化    下载大小

libgee                0.6.2.1-1  0.60 MiB  0.10 MiB
libsocialweb          0.25.19-2  1.92 MiB  0.23 MiB
folks                 0.6.3.2-1  1.38 MiB  0.25 MiB

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12 14:18:38 -05:00
Dan McGee
d3d3b861ac Bump version to 4.0.0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12 13:52:21 -05:00
Dan McGee
a0d0f3f47f Final Transifex update before 4.0
We have a few incomplete translations, but these should be addressable
before the 4.0.1 maint release that is surely not that far in the
future.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-12 13:42:12 -05:00
Dan McGee
e1ae3a6038 pactest: add a better description
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 12:33:14 -05:00
Dan McGee
0c1a0a6d87 Add note to TRANSLATORS regarding Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 10:07:27 -05:00
Dan McGee
5a39172835 pacman-key: don't escape single quote in usage message
This screws up gettext and causes the message to display always
untranslated.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 09:07:20 -05:00
Allan McRae
d9c0a08e6d Document verifying source file signatures in makepkg
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 09:07:20 -05:00
Allan McRae
8ac7cf6b1b Fix typo in PKGBUILD man page
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 09:07:20 -05:00
lolilolicon
4de3d9092e PKGBUILD.vim: fix epoch syntax highlighting
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 09:07:20 -05:00
Dan McGee
8cc4ed0d63 Update translations from Transifex
In prep for the 4.0.0 release.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 09:07:19 -05:00
Dave Reisner
abfa8370c0 dload: unhook error buffer after transfer finishes
Similar to what we did in edd9ed6a, disconnect the relationship with our
stack allocated error buffer from the curl handle. Just as an FTP
connection might have some network chatter on teardown causing the
progress callback to be triggered, we might also hit an error condition
that causes curl to write to our (now out of scope) error buffer.

I'm unable to reproduce FS#26327, but I have a suspicion that this
should fix it.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-10 19:09:59 -05:00
Lukas Fleischer
8f414cd040 pactree: Make error message smarter in register_syncs()
Our error message used to be very unclear when the configuration file
could not be found:

    $ ./pactree -lsr gtk
    error: failed to register sync DBs

Instead, display an accurate message and include the file name:

    $ ./pactree -lsr gtk
    error: config file /usr/local/etc/pacman.conf could not be read

Also, move the error message inside register_syncs() to allow for
differentiating between different errors that might require a handler in
the future.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-10 19:09:18 -05:00
Lukas Fleischer
fb401f569e pactree: Add "--config" option
This allows for specifying an alternate configuration file path, similar
to pacman's "--config" option.

Given that there is currently no other way to tell pactree to read from
another configuration file (except for patching or symlinking), this
seems totally sensible - even if there are plans to refactor and/or
replace the standalone configuration file parser.

We do not define a short option for the sake of consistency with
pacman's set of command line options.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-10 19:09:12 -05:00
Allan McRae
36f31dd133 makepkg: strip comments after pkgver/pkgrel when checking value
Inline comments after pkgver or pkgrel would cause the sanity
checks to fail so remove them before checking the value.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-10 19:05:22 -05:00
Allan McRae
cc13f47532 Format pacsort and vercmp testsuite output
Make the output into a single block and add separators at the end
so that they do not merge into each other.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-07 09:21:58 -05:00
Dan McGee
9168977b3b Update NEWS for 4.0.0 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-06 02:13:41 -05:00
lolilolicon
22abe27bfa bacman: use globbing to get local package db path
The original code- pkg_dir="$(echo $pac_db/$pkg_name-[0-9]*)" is
problematic in several ways:

 - $pac_db and $pkg_name should be quoted, obviously.
 - It assumes pkgver always starts with an integer, while in fact
   it just can't contain ':' and '-'.
   Counterexample: the code breaks on lshw B.02.15-1.
 - It assumes there are no more than one directory matching the
   pattern.  While this should be the case if everything works
   perfectly, it certainly relies on external conditions.
   Counterexample: if the local db contains two packages named
   foo and foo-3g, even if everything else is perfect, the code
   will match two directories.

Don't make assumptions, use what is known.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:25 -05:00
lolilolicon
4928f9edc3 bacman: add tar.Z package creation support
bacman should support whatever makepkg does as PKGEXT.
Also remove obsolete $EXT variable.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:25 -05:00
lolilolicon
273cc66a8a bacman: small code cleanup
This includes:
 - Quoting fixes.
 - Drop deprecated mktemp option -p.
 - Set extglob nullglob shell options at the top.
 - Use extended globbing instead of regex to match %HEADER% in pacman db.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:25 -05:00
lolilolicon
7e5bbf0387 bacman: bashify using [[ ]] and (( ))
Another style change.  The [[ expression ]] form is particularly
cleaner, safer and more powerful than the [ expression ] form.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:24 -05:00
lolilolicon
3f937c8404 bacman: indent code using TAB
As every piece of code in the whole project uses TAB as indentation
character, bacman shouldn't be an exception.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-10-06 02:10:24 -05:00
Dan McGee
524847145d Enable CheckSpace by default in default config file
This will have to be picked up downstream of course, but addresses
FS#25684 now that this is a lot faster in 4.0 than it was in the
original 3.5 implementation.

Also make curl the first XferCommand listed, as we are moving away from
any other download program at this point.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 23:44:11 -05:00
Dan McGee
a8ca9b93f8 Update translation message catalogs in prep for 4.0 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 22:39:05 -05:00
Dan McGee
2df519f807 Add a top-level 'update-po' make target
This makes the maintainer's life (read: my life) a lot easier when
updating translation files to push to Transifex.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 22:36:34 -05:00
Dan McGee
dc7d691b20 Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 22:30:14 -05:00
Dan McGee
484d5ec624 pacman-key: treat foo-trusted as an ownertrust export file
This allows it to serve double-duty. In order to allow users to base
verification decisions off of both a valid signature and a trusted
signature, we need to assign some level of owner trust to the keys we
designate as trusted on import.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 22:00:52 -05:00
Dan McGee
ab7d2890a4 pacman-key: refine and clarify import/import-trustdb behavior
* --import now only imports keys from pubkey.gpg and does not import
  owner trust; if you want to have both simply run the operations in
  sequence.
* --import-trustdb has been simplified; it will overwrite existing
  values in the trust database as before, but there is no need to export
  it first as those values are safe if left untouched.
* Fix the manpage referring to a non-existent option.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-05 21:55:53 -05:00
Dan McGee
cf0edb92ba Parse '0' as a valid package installed size
This was a bad oversight on my part, pointed out by Jakob. Whoops.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-04 15:31:17 -05:00
lolilolicon
94bc64ae1b makepkg: create tar file for bogus PKGEXT
If PKGEXT is not one of the recognized tar*'s, create_package() would
create an empty package file and fail, since bsdtar on the left side of
the pipe returns 141 on SIGPIPE (broken pipe).

This patch changes the behavior for an invalid PKGEXT. A warning is
printed on stderr, and a tar file is created. Also retire the obsolete
$EXT variable.

Add the obligatory comment why we don't use bsdtar's compression.
Finally, fix mixed-tab-space indentation.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-10-03 10:59:10 -05:00
Dan McGee
c4d6688694 Use _alpm_local_db_pkgpath in _cache_changelog_open
Another place where we were doing the dirty work by hand.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-30 11:08:49 -05:00
lolilolicon
b0543440ca makepkg: support .tar.Z source packages creation
SRCEXT should allow whatever PKGEXT does.
Also address an uninitialized use of $ret.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-09-30 10:57:44 -05:00
Dan McGee
39b0ac43fc Revamp scriptlet path formation for scriptlets in local database
Expose the current static get_pkgpath() function internally to the rest
of the library as _alpm_local_db_pkgpath(). This allows use of this
convenience function in add.c and remove.c when forming the path to the
scriptlet location.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-30 10:55:58 -05:00
Dan McGee
73139ccb3c Refactor _alpm_runscriptlet()
Add an is_archive parameter to reduce the amount of black magic going
on. Rework to use fewer PATH_MAX sized local variables, and simplify
some of the logic where appropriate in both this function and in the
callers where duplicate calls can be replaced by some conditional
parameter code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-30 10:55:58 -05:00
lolilolicon
6bb5948025 paccache: proper quoting in [[ expression ]]
Always quote the right-hand side of expression when the == or != operator
is used, unless intended as a pattern.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-30 10:48:49 -05:00
lolilolicon
e0400fff96 paccache: declare variables explicitly
Declare and initialize integer variables 'needsroot' and 'verbose'.
Don't use the fact that (( undefined_variable )) evaluates to 0.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-30 10:48:43 -05:00
Dave Reisner
938fb2c878 pacman-key: remove errexit flag from shebang
We're ill equipped to be using this flag as we don't trap and respond to
the ERR signal. The result is that if is ever tripped, pacman-key will
instantly exit with no indication of why. At the same time, we're
already fairly good about doing our own error checking and verbalizing
it before dying.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-30 10:48:28 -05:00
Allan McRae
07ecd40a1a pacman-key: return 0 from get_from if default value used
This prevents the error trap being set off when GPGDir is commented
in pacman.conf.  Bug introduced in 507b01b9.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-30 10:48:19 -05:00
Allan McRae
6dfb9d35f8 Remove redundant transaction size output
Printing all of "Installed", "Removed" and "Net Upgrade" sizes is
redundant as the difference of the first two is the last. Instead,
only print "Installed Size" and "Net Upgrade Size" when both the
installed and removed are non-zero.

This results in the following output in the following cases:
 - package installation only: Installed Size
 - package removal only: Removed Size
 - package installation involving replacement: Installed + Net Upgrade Size
 - package upgrade: Installed + Net Upgrade Size
 - combination upgrade and installation: Installed + Net Upgrade Size

Download Size remains outputted whenever something is downloaded.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-30 10:48:01 -05:00
lolilolicon
83c05e71bc paccache: allow strictly integer for -k option
Verify the argument to -k is a non-negative integer.  Leading zeros
are simply stripped.

'declare -i keep' allowed the argument to -k to be any arithmetic
evaluation expression.  The simple assignment 'keep=$OPTARG' triggers
arithmetic evaluation implicitly, which can either consume a huge amount
of resources with input such as '2**2**32' or immediately produce an error
on invalid input.  Instead, we simply 'declare -- keep' and avoid all that.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-29 13:02:41 -05:00
Allan McRae
1463a9aa36 Remove redundant "removal" output in pure remove operation
Printing "[removal]" beside all package names is redundant when all
packages are being removed (i.e. when using -R).

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-09-29 13:02:02 -05:00
Dave Reisner
ad8d3ceb89 move prevprogress onto payload handle
This is a poor place for it, and it will likely move again in the
future, but it's better to have it here than as a static variable.

Initialization of this variable is now no longer necessary as its
zeroed on creation of the payload struct.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-29 12:58:37 -05:00
lolilolicon
775b94e649 pkgdelta: proper quoting in [[ expression ]]
Always quote the right-hand side of expression when the == or != operator
is used, unless intended as a pattern.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-09-28 14:09:01 -05:00
lolilolicon
497501d1c7 makepkg: proper quoting in [[ expression ]]
Always quote the righthand side of expression when the == or != operator
is used, unless intended as a pattern.  Quoting bash(1):

When the == and != operators are used, the string to the right of the
operator is considered a pattern.  Any part of the pattern may be quoted
to force it to be matched as a string.

Signed-off-by: lolilolicon <lolilolicon@gmail.com>
2011-09-28 13:06:03 -05:00
Dan McGee
d1af9b70c8 Refactor display_targets to not be recursive
This also fixes a memory leak and makes the dual-purpose "rows" variable
go away in favor of storing the rows and non-verbose names separately.

This also fixes some potential memory leaks and/or wrong behavior due to
the config->verbosepkglists flag being flipped, which we should never be
doing.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 13:01:03 -05:00
Dan McGee
e0acf2f144 Refactor download payload reset and free
This was done to squash a memory leak in the sync database download
code. When we downloaded a database and then reused the payload struct,
we could find ourselves calling get_fullpath() for the signatures and
overwriting non-freed values we had left over from the database
download.

Refactor the payload_free function into a payload_reset function that we
can call that does NOT free the payload itself, so we can reuse payload
structs. This also allows us to move the payload to the stack in some
call paths, relieving us of the need to alloc space.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 13:01:03 -05:00
Dan McGee
9a58d5c6c5 Initialize cURL library on first use
Rather than always initializing it on any handle creation. There are
several frontend operations (search, info, etc.) that never need the
download code, so spending time initializing this every single time is a
bit silly. This makes it a bit more like the GPGME code init path.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 13:01:03 -05:00
Dan McGee
83f99bfb39 Add more valgrind suppressions
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 13:01:03 -05:00
Dan McGee
a8ed39ce05 verbose package lists: remove errant debugger
Left this in as part of the last set of commits, whoops.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 10:26:53 -05:00
Dan McGee
6f3a657f66 Always show download size if -w/--downloadonly was provided
The prompt can be rather confusing otherwise when all files have already
been downloaded, but there is not a single total size listed.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 10:18:42 -05:00
Dan McGee
bcc6a5d72d Table format creation code cleanup
Better scoping of variables for the most part, and ensure we are using
string_length() and not strlen() as appropriate. Also refactor the
longest cell code to call string_length() a lot less; by simply using an
array of max sizes we don't have to recompute values nearly as much.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 10:17:15 -05:00
Dan McGee
1b8bb7c1cd Use unsigned types for indent width and column count
For getcols(), the functions we call return a value of type 'unsigned
short', so it makes sense for us to do the same.

string_length() is meant to behave like strlen(), so it should return
type size_t. This exposes other functions such as indentprint() which
should also be using signed return types.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 09:48:08 -05:00
Dan McGee
f682cbd433 Show download sizes when using -S/--sync
We now label the old 'Size' column as 'Net Change' to reflect the
reality of what we are looking at. Sync operations now get an additional
'Download Size' column.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 04:52:37 -05:00
Dan McGee
7edeb276b6 Keep track of explicitly added and removed packages
This allows us to sort the output list by showing all pulled
dependencies first, followed by the explicitly specified targets.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 04:52:37 -05:00
Dan McGee
bd83c8e756 Combine add and removal package list display
There was no real reason for these to be done separately.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 04:52:37 -05:00
Dan McGee
40a264478e Track unresolvable transaction packages
Rather than free them right away, keep the list on the transaction as
we already do with add and remove lists. This is necessary because we
may be manipulating pointers the frontend needs to refer to packages,
and we are breaking our contract as stated in the alpm_add_pkg()
documentation of only freeing packages at the end of a transaction.

This fixes an issue found when refactoring the package list display
code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 04:52:37 -05:00
Dan McGee
6e081a0c57 Move pacsave path construction code off the stack
This is definitely not in the normal hot path, so we can afford to do
some temporary heap allocation here.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 04:48:53 -05:00
Dan McGee
98e0371ae3 Use the full buffer when computing md5/sha256 sums
No wonder these were slower than expected. We were only reading 4
(32-bit) or 8 (64-bit) bytes at a time and feeding it to the hash
functions. Define a buffer size constant and use it correctly so we feed
8K at a time into the hashing algorithm.

This cut one larger `-Sw --noconfirm` operation, with nothing to
actually download so only timing integrity, from 3.3s to 1.7s.

This has been broken since the original commit eba521913d introducing
OpenSSL usage for crypto hash functions. Boy do I feel stupid.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 04:48:42 -05:00
Dan McGee
f66f9f11cd Fix memory leak in download payload->remote_name
In the sync code, we explicitly allocated a string for this field, while
in the dload code itself it was filled in with a pointer to another
string. This led to a memory leak in the sync download case.

Make remote_name non-const and always explicitly allocate it. This patch
ensures this as well as uses malloc + snprintf (rather than calloc) in
several codepaths, and eliminates the only use of PATH_MAX in the
download code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-28 04:48:33 -05:00
Dan McGee
ea3c47825e Revert "libalpm: compare pkgname with strcoll"
This commit was made with the intent of displaying "correctly" sorted
package lists to users. Here are some reasons I think this is incorrect:

* It is done in the wrong place. If a frontend application wants to show
  a different order of packages dependent on locale, it should do that
  on its own.
* Even if one wants a locale-specific order, almost all package names
  are all ASCII and language agnostic, so this different comparison
  makes little sense and may serve only to confuse people.
* _alpm_pkg_cmp was unlike any other comparator function. None of the
  rest had any dependency on anything but the content of the structs
  being compared (e.g., they only used strcmp() or other basic
  comparison operators).

This reverts commit 3e4d2c3aa6.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 20:24:04 -05:00
Dan McGee
69962184bb _alpm_splitdep: use malloc instead of calloc
There was only one simple to handle case where we left a field
uninitialized; set it to NULL and use malloc() instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 17:52:38 -05:00
Dan McGee
d8fab9b441 be_sync: fetch only entry mode, not full stat struct
This saves a lot of unnecessary work since we don't need any of the
other fields in the stat struct.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 17:49:34 -05:00
Dan McGee
bf56fb6eb8 alpm_list: use malloc instead of calloc
In every case we were calling calloc, the struct we allocated (or the
memory to be used) is fully specified later in the method.

For alpm_list_t allocations, we always set all of data, next, and prev.

For list copying and transforming to an array, we always copy the entire
data element, so no need to zero it first.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 17:49:27 -05:00
Dave Reisner
619c3629ca makepkg: ensure '-' is last in a character glob
If '-' isn't the last item, it's interpreted as a range and not
literally, causing problematic behavior in parsing optdepends.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-27 11:35:17 -04:00
Dan McGee
e70d540501 pacman-key: use consistent punctuation in error messages
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 09:17:11 -05:00
Dan McGee
fa929e8258 Fix compilation using --without-gpgme
I'm really good at breaking this on a regular basis. If only we had some
sort of automated testing for this...

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 09:15:36 -05:00
Dan McGee
b242b2d050 Remove unnecessary logger
This is just a wrapper function; the real function we call logs an
almost identical line.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 09:08:01 -05:00
Dan McGee
47657107af Delay check for repository servers until we need them
In the sync download code, we added an early check in 6731d0a940 for
sync download server existence so we wouldn't show the same error over
and over for each file to be downloaded. Move this check into the
download block so we only run it if there are actually files that need
to be downloaded for this repository.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-27 07:53:38 -05:00
Allan McRae
5e13b2b6af Avoid comparison between signed and unsigned types
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 23:04:09 -05:00
Dan McGee
80b0f27125 Ensure fileconflict value is actually a string
When we switched to a file object and not just a simple string, we missed an
update along the way here in target-target conflicts. This patch looks
large, but it really comes down to one errant (char *) cast before that has
been reworked to explicitly point to the alpm_file_t object. The rest is
simply code cleanup.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 17:36:29 -05:00
Dave Reisner
d1fc3aec4c bash_completion: add completion for pacman-key
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Dave Reisner
507b01b912 pacman-key: allow get_from to return a default value
Keep the non-zero return val to let the caller know that the key wasn't
found.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Dave Reisner
b6ccae2d18 pacman-key: simplify writing to config file
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Allan McRae
dd82b8d09f makepkg: normalize whitespace for optdepends in .PKGINFO
Many PKGBUILDs use formatting whitespace when specifying optdepends.
This is removed when adding a package to a repo-database so the
output of "pacman -Si <package>" and "pacman -Qip <package file>"
becomes inconsistent.  Instead, do the adjustment when creating
the .PKGINFO file.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Allan McRae
6adf502f0d makepkg: allow versioned optdepends with epoch
Allow the specification of versioned optdepends with an epoch.
This also (partially) enforces a whitespace between ":" and the
description which is required for the future optdepends parsing
code.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:19 -05:00
Dan McGee
d26d50e664 Revamp pacman signal handler
* All errors now go to stderr, so do the same here and simplify the
  writing of the error message.
* Add SIGHUP to the handled signal list, and don't repeat code.
* Attempt to release the transaction (e.g. remove the lock file)
  for all of HUP, INT, and TERM. Signals HUP and INT respects
  transaction state, TERM will immediately terminate the process.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-26 16:02:12 -05:00
Dan McGee
2517ba3303 Update Doxyfile and fix some documentation errors caught by Doxygen
A few parameters were outdated or wrongly named, and a few things were
explicitly linked that Doxygen wasn't able to resolve.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 16:37:36 -05:00
Dan McGee
c406949226 Ensure database validity flags are set in invalid signature case
We returned the right error code but never set the flags accordingly.
Also, now that we can bail early, ensure we set the error code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 16:01:11 -05:00
Dan McGee
1e0ed133f4 Handle key import errors correctly and with good error messages
This adds calls to gpgme_op_import_result() which we were not looking at
before to ensure the key was actually imported. Additionally, we do some
preemptive checks to ensure the keyring is even writable if we are going
to prompt the user to add things to it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 16:01:10 -05:00
Dan McGee
907e8af5be signing: be consistent with returning -1 for error cases
This also fixes a segfault found by dave when key_search is
unsuccessful; the key_search return code documentation has also been
updated to reflect reality.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 16:01:05 -05:00
Dan McGee
f1beb050a3 Update configure.ac version to rc2
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 12:08:35 -05:00
Dan McGee
43787d0067 Regenerate message catalogs and translations
We've had a bit of churn since the last time this was done.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:36:09 -05:00
Dan McGee
a78e3e3a23 Translation file updates from Transifex
Pick up any updates before I push new source messages out to the
service.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:35:31 -05:00
Dan McGee
1df9b2aa79 pacman-key: add an additional plain text 'foo-trusted' file
This is similar to the 'foo-revoked' file we had. This will be used to
inform the user what keys in the shipped keyring need to be explicitly
trusted by the user.

A distro such as Arch will likely have 3-4 master keys listed in this
trusted file, but an additional 25 developer keys present in the keyring
that the user shouldn't have to directly sign.

We use this list to prompt the user to sign the keys locally. If the key
is already signed locally gpg will print a bit of junk but will continue
without pestering the user.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:45 -05:00
Dan McGee
067721cbff pacman-key: factor out validate_with_gpg() method
This was copy-pasted code for the most part once the filename was
factored out.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:45 -05:00
Dan McGee
33685b960d pacman-key: remove holdkeys functionality
We're putting the cart ahead of the horse a bit here. Given that our
keyring is not one where everything is implicitly trusted (ala gpgv),
keeping or deleting a key has no bearing on its trusted status, only
whether we can actually verify things signed by said key.

If we need to address this down the road, we can find a solution that
works for the problem at hand rather than trying to solve it now before
signing is even widespread.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:45 -05:00
Dan McGee
595e1a437f pacman-key: implement promptless lsigning
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:45 -05:00
Dan McGee
7d961c849b pacman-key: disable, don't remove, revoked keys
Unlike our protégé apt-key, removing a key from our keyring is not
sufficient to prevent it from being trusted or used for verification. We
are better off flagging it as disabled and leaving it in the keyring so
it cannot be reimported or fetched at a later date from a keyserver and
continue to be used.

Implement the logic to disable the key instead of delete it, figuring
out --command-fd in the process.

Note that the surefire way to disable a key involves including said key
in the keyring package, such that it is both in foobar.gpg and
foobar-revoked.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:15:39 -05:00
Dan McGee
6767de5380 Add status and check for key being disabled
Because we aren't using gpgv and a dedicated keyring that is known to be
all safe, we should honor this flag being set on a given key in the
keyring to know to not honor it. This prevents a key from being
reimported that a user does not want to be used- instead of deleting,
one should mark it as disabled.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00
Dan McGee
213950afa3 pacman-key: simplify import in populate
This finishes the cleanup started in 710e83999b. We can do a straight
import from another keyring rather than all the funky parsing and piping
business we were doing.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00
Dan McGee
491b656c54 pacman-key: don't hide --verify details in populate
Otherwise we're hiding extremely relevant bits like this one:
    gpg: WARNING: This key is not certified with a trusted signature!
    gpg:          There is no indication that the signature belongs to the owner.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00
Dan McGee
03e1b4caa9 pacman-key: print message in populate if signature is missing
Rather than saying it was invalid, tell the user no signature exists.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00
Dan McGee
a7691ba6fd pacman-key: clean up populate output
* Ensure usage message is indented correctly
* Show short filenames for both the gpg keyring and revocation file

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:35 -05:00
Dan McGee
4b6a5ae159 pacman-key: ensure array iterations are quoted
When doing something like `pacman-key --edit-key 'Dan McGee'`, one would
expect it to work, and not fail.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:34 -05:00
Dan McGee
765178c5ba Implement PGP key search and import
Add two new static methods, key_search() and key_import(), to our
growing list of signing code.

If we come across a key we do not have, attempt to look it up remotely
and ask the user if they wish to import said key. If they do, flag the
validation process as a potential 'retry', meaning it might succeed the
next time it is ran.

These depend on you having a 'keyserver hkp://foo.example.com' line in
your gpg.conf file in your gnupg home directory to function.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:14:31 -05:00
Dan McGee
0ef7129a4a signing: document most undocumented functions
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 11:06:03 -05:00
Dan McGee
4849a4596d Add _alpm_process_siglist() logic to failed package validation
This moves the result processing out of the validation check loop itself
and into a new loop. Errors will be presented to the user one-by-one
after we fully complete the validation loop, so they no longer overlap
the progress bar.

Unlike the database validation, we may have several errors to process in
sequence here, so we use a function-scoped struct to track all the
necessary information between seeing an error and asking the user about
it.

The older prompt_to_delete() callback logic is still kept, but only for
checksum failures. It is debatable whether we should do this at all or
just delegate said actions to the user.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:35:52 -05:00
Dan McGee
0a4a5cea97 Add new import key question enum value and stub frontend function
This is for eventual use by the PGP key import code. Breaking this into
a separate commit now makes the following patches a bit easier to
understand.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:35:52 -05:00
Dan McGee
3e4749fe3e Fix signature printing in package info
pm_asprintf() does not return a length as asprintf() does. Fail. Make
sure it is not -1 as that is the only failure condition.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:34:07 -05:00
Dan McGee
361ed6a600 config parsing: add note if libcurl disabled and no XferCommand
Just a helpful warning for those users in this unenviable position.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:33:48 -05:00
Dan McGee
e4690232d6 config parsing: include file and line number in more errors
Before:
    $ pacman -Si pacman
    error: invalid value for 'SigLevel' : 'FooValue'

After:
    $ ./src/pacman/pacman -Si pacman
    error: config file /etc/pacman.conf, line 88: invalid value for 'SigLevel' : 'FooValue'

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:33:43 -05:00
Dan McGee
ca58e326dc Pull option names out of messages in config parsing
This allows some message reuse, as well as making it clear to
translators what *not* to translate.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:33:39 -05:00
Dan McGee
69694edd2c Check capabilities in SigLevel option parsing
Only allow turning it on if the backend library has support for it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:32:39 -05:00
Dan McGee
d36d70d294 Add alpm_capabilities() method and enumeration
This allows a frontend program to query, at runtime, what the library
supports. This can be useful for sanity checking during config-
requiring a downloader or disallowing signature settings, for example.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:32:35 -05:00
Dan McGee
33f2518531 Move default siglevel value from backend to frontend
This takes the libraries hidden default out of the equation: hidden in
the sense that we can't even find out what it is until we create a
handle. This is a chicken-and-egg problem where we have probably already
parsed the config, so it is hard to get the bitmask value right.

Move it to the frontend so the caller can do whatever the heck they
want. This also exposes a shortcoming where the frontend doesn't know if
the library even supports signatures, so we should probably add a
alpm_capabilities() method which exposes things like HAS_DOWNLOADER,
HAS_SIGNATURES, etc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:32:30 -05:00
Dan McGee
01f5c9e79a validate_deltas: split verify/check errors loops
This allows us to do all delta verification up front, followed by
whatever needs to be done with any found errors. In this case, we call
prompt_to_delete() for each error.

Add back the missing EVENT(ALPM_EVENT_DELTA_INTEGRITY_DONE) that
accidentally got removed in commit 062c391919.

Remove use of *data; we never even look at the stuff in this array for
the error code we were returning and this would be much better handled
by one callback per error anyway, or at least some strongly typed return
values.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:32:24 -05:00
Dan McGee
5e7875ae6a Fix possible segfault if siglist was empty
If siglist->results wasn't a NULL pointer, we would try to free it
anyway, even if siglist->count was zero. Only attempt to free this
pointer if we had results and the pointer is valid.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-22 10:31:28 -05:00
Dan McGee
3a460a8be6 Remove noisy debug logger
This one can be overwhelming when reading debug output from a very large
package. We already have the output of each extracted file so we
probably can do without this in 99.9% of cases.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-21 13:02:35 -05:00
Dan McGee
47dd315609 Fix int/size_t type in alpm_list_count() call
alpm_list_count() returns size_t, which we should use to store the
result since it is easy enough to format for printing.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 17:15:09 -05:00
Dan McGee
8375ad214a _alpm_sync_commit: extract two static methods
This adds two new static methods, check_validity() and load_packages(),
to sync.c which are simply code fragments pulled out of our
do-everything sync commit code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dan McGee
b7ebacc576 Pass package signature data up one more level
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dan McGee
ec790ced7c signing: add a process and retry loop for database signatures
In reality, there is no retrying that happens as of now because we don't
have any import or changing of the keyring going on, but the code is set
up so we can drop this in our new _alpm_process_siglist() function. Wire
up the basics to the sync database validation code, so we see something
like the following:

    $ pacman -Ss unknowntrust
    error: core: signature from "Dan McGee <dpmcgee@gmail.com>" is unknown trust
    error: core: signature from "Dan McGee <dpmcgee@gmail.com>" is unknown trust
    error: database 'core' is not valid (invalid or corrupted database (PGP signature))

    $ pacman -Ss missingsig
    error: core: missing required signature
    error: core: missing required signature
    error: database 'core' is not valid (invalid or corrupted database (PGP signature))

Yes, there is some double output, but this should be fixable in the
future.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dan McGee
994cb4da4f Allow our PGP helper method to pass back the signature results
This will make its way up the call chain eventually to allow trusting
and importing of keys as necessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dan McGee
a27f993600 Split package validation and load loops
This adds a some new callback event and progress codes for package
loading, which was formerly bundled in with package validation before.
The main sync.c loop where loading occurred is now two loops running
sequentially. The behavior should not change with this patch outside of
progress and event display; more changes will come in following patches.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dan McGee
afdbfc05f7 Extract an _alpm_pkg_validate_internal() method
_alpm_pkg_load_internal() was becoming a monster. Extract the top bit of
the method that dealt with checksum and signature validation into a
separate method that should be called before one loads a package to
ensure it is valid.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dave Reisner
7eb2f0cd15 pacman/upgrade: print 'loading packages...' only once
Do this outside the loop to prevent the message from being displayed
(and pluralized!) for each individual package.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dan McGee
8e3b39a9e0 pacman: use dynamic string allocation where it makes sense
None of these are hot-code paths, and at least the target reading has
little need for an arbitrary length limitation (however crazy it might
be to have longer arguments).

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dan McGee
0f92fc5963 utils/cleanupdelta: remove unneeded syncdbpath
This variable was totally unused.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:11 -05:00
Dan McGee
79cbce60ac Remove all usages of alpm_list_getdata() from the library
No need for the indirection; just access ->data instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:10 -05:00
Dan McGee
70e2c34f0f _alpm_runscriptlet(): remove clean_tmpdir variable
This is always true at the end since we return early if we couldn't
create the tmpdir, so it is totally unnecessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:10 -05:00
Dan McGee
3796164848 Access db->pkgcache directly in db_free_pkgcache()
We shouldn't be going through the accessor that does a bunch of
unnecessary legwork, including potentially loading the pkgcache right
before we free it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:10 -05:00
Dan McGee
95119d46d4 Flip getcwd()/chdir() for open()/fchdir() in the frontend
Just like we did in libalpm in commit 288a81d847.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-20 10:23:10 -05:00
Dan McGee
288a81d847 Use more efficient way of restoring working directory
Rather than using a string-based path, we can restore the working
directory via a file descriptor and use of fchdir().

From the getcwd manpage:
    Opening the current directory (".") and calling fchdir(2) to
    return is usually a faster and more reliable alternative when
    sufficiently many file descriptors are available.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-19 14:11:08 -05:00
Dan McGee
bfe36c2ddf Reduce path allocation on the stack in local database
We did a lot of both malloc-ing and stack printing to form some paths in
this code. Attempt to unify it all into the one get_pkgpath() method by
adding an optional third "filename" parameter, and form the necessary
path string all in one go.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-19 13:43:13 -05:00
Dan McGee
e1899cbc64 Be smarter about running ldconfig during removal transactions
1. Don't run it if something failed in package removal- this mirrors
what we already do in sync transactions.
2. Don't run it if we are invoking it for the replaces removal bit of a
sync transaction- it doesn't make sense to run ldconfig halfway through
a sync install; we should only run it once at the end.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-19 13:18:42 -05:00
Dan McGee
a94ad29740 Search for non-prefixed paths in skip_remove list
We add them to this list with the root path not appended; we should be
searching for them this way as well.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-19 13:17:16 -05:00
Dan McGee
41d8deff88 be_local: cope with a desc file without trailing newline
We checked the (fgets == NULL and !feof) case, but never actually bailed
out of the loop if we were at the end of the file, causing infinite
looping.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-18 17:32:15 -05:00
Dan McGee
86d9fcbfff Remove const specifier from changelog_read() void parameter
This shouldn't really be declared with const, and causes a compile error
when -Wcast-qual is used. Remove the const specifier from the function
specification and all implementations.

Also fix one other trivial -Wcast-qual warning in _alpm_db_cmp().

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-18 17:11:39 -05:00
Dan McGee
69a3558b75 Remove dead changelog_feof() code
We never ended up using or really needing this; kill it for now knowing
it is in git history if ever needed again.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-18 17:03:56 -05:00
Dan McGee
49dff4c80b Add a random pactest
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-18 17:00:21 -05:00
Dave Reisner
83ee9708b1 src/util: provide strndup definitions where needed
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-18 16:58:21 -05:00
Dave Reisner
07e89c1e5d dload: avoid using memrchr
This function doesn't exist on OSX. Since there aren't any other
candidates in alpm for which this function would make sense to use,
simply replace the function call with a loop that does the equivalent.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-18 16:57:59 -05:00
Dan McGee
52c65fdfea Ensure entire struct is zeroed in _alpm_parsedate()
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-18 16:57:26 -05:00
Dave Reisner
c12fa4ab19 pactree: include missing ctype.h header
needed for isspace() -- avoids warnings on OSX.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-18 16:57:09 -05:00
Dave Reisner
b1a09b93ef configure: Fix quoting in SEDINPLACE on Darwin
single quotes expanded to nothing, leaving us with a command that
assumed the sed expression was the backup suffix. Use a pair of escaped
double quotes, which survives automake and ends up properly in makepkg.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-18 16:57:07 -05:00
Dave Reisner
223a92ca9d dload: remove user:pass@ definition from hostname
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-18 15:35:58 -05:00
Dave Reisner
7ad78c2c88 paccache: remove unnecessary if check
This is superfluous as the ensuing for loop will exit immediately on the
same condition avoided by the if.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-18 15:34:54 -05:00
Dan McGee
a7d7798032 Fix build without gpgme
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-18 15:34:28 -05:00
Dave Reisner
f883efe2cb pacman: add short opt '-p' for --print to -{S,R}h
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-14 17:24:55 -05:00
Dave Reisner
e01dbcc068 include ldconfig.stub in EXTRA_DIST
Since c51b9ca, ldconfig.stub is required by pactest so we need to
include it as part of the dist tarball.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-14 17:18:44 -05:00
Dave Reisner
68856755c4 buildsys: remove existing symlinks before installing
This fixes build errors when performing a manual install straight to a
filesystem where the files already exist.

Reported-by: Sergej Pupykin <ml@sergej.pp.ru>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-14 17:18:07 -05:00
Dan McGee
a2356d5ae3 Don't duplicate header strings
There is no need to print them into buffers; we can use the values
returned by gettext() directly without issue.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-14 17:18:07 -05:00
Dave Reisner
4a02350ded makepkg: fix recreation of hardlinks to .gz manpages
4ed12ae tightened up the logic to use only find, but ignored the fact
that since the manpage hard link names were no longer captured. They
were created as separate compressed manpages, rather than as hardlinks.

This also introduces a minor efficiency of deleting all hardlinks at
once and using proper iteration over an array rather than a string.

Note to anyone else touching this code: e2fsprogs and libpcap are useful
for testing this. If that changes in the future, you can use the below
bash to locate others:

  IFS=$'\n' read -rd '' -a a < <(find /usr/share/man -type f \! -links 1)
  pacman -Qqo "${a[@]}" | sort -u

I broke it!

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-14 17:25:29 -04:00
Dave Reisner
d1e04c1b67 makepkg: add missing newline on passing gpg sourcecheck
When a sourceball passes this check without any warnings, a newline is
omitted. Similar to the if clause of this else block, print a single new
line at the end of the clause instead of accounting for each output.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-14 14:19:18 -04:00
Dave Reisner
0f69e2ec0b makepkg: check for var existance before file existance
This prevents makepkg from aborting with 'file not found' when
changelog= or install= are declared in a PKGBUILD, but empty.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-12 08:27:13 -04:00
Dave Reisner
3905ada993 account for partial delta files in download size
Similar to an earlier commit which accounts for .part files for full
packages, calculate the download_size for deltas keeping mind the
possibility of a partial transfer.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-11 19:10:48 -05:00
Dave Reisner
d8eacae7bc make compute_download_size consider .part files
Check for the existance of a partial download of a package file before
jumping to delta calculations. Currently, if there were 10MiB remaining
in a 100MiB the values passed to the front end do not reflect this.

Refactored from an old patch originally by Dan.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-11 19:09:04 -05:00
Dave Reisner
befddfc3e6 dload: provide optional netrc support
if ~/.netrc exists and has credentials for the hostname requested in a
download, they will be provided in an http auth request. This can still
be overridden by explcitly declaring user:pass in the URL.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-11 19:07:25 -05:00
Dave Reisner
c736a12e86 makepkg: unset errexit when sourcing /etc/profile
This is a fix for a bash3 specific bug, where a file sourced by
/etc/profile would exit non-zero and make its way back up to makepkg,
forcing it to exit after package installation. Along with unsetting the
ERR handler, temporarily unset errexit to avoid this.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-11 13:47:07 +10:00
Dave Reisner
7f1235ccbc paccache: escape . in trimming of diskspace string
Before:
==> finished dry run: 2 candidates (diskspace saved: 7. MiB)

After:
==> finished dry run: 2 candidates (diskspace saved: 7.8 MiB)

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-11 13:46:07 +10:00
Dan McGee
4737a87b84 download callback: show decimal places in rate if we have room
Display now looks like this, whereas before we would have just showed
'2M/s' for the extra repository download. The cutoff is placed at 100.0
to ensure we only use 4 character slots of width (e.g. '99.9', '100').

:: Synchronizing package databases...
 testing                   39.9 KiB   470K/s 00:00 [######################] 100%
 core                      51.4 KiB   469K/s 00:00 [######################] 100%
 extra                    768.8 KiB   2.1M/s 00:00 [######################] 100%
 community-testing       1941.0   B  54.4M/s 00:00 [######################] 100%
 multilib                  26.6 KiB   458K/s 00:00 [######################] 100%
 community                449.8 KiB  1649K/s 00:00 [######################] 100%

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-11 13:45:59 +10:00
Dan McGee
f7653e582b Move download callback static vars into function
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-11 13:45:54 +10:00
Dave Reisner
db70c9da15 diskspace: fix memory leak on root mount not found
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-08 14:18:19 -05:00
Dan McGee
a03313f3f6 Print 'loading packages' message on -U operations
This will be the first thing printed when doing an upgrade. Currently
there is no output at all until we start resolving dependencies, which
can be a while in if specifying very large targets on the command line,
in which case it is nice to let the user know we are doing something.

Addresses FS#25822 in the most KISS way possible.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-08 14:14:51 -05:00
Dave Reisner
905ae640cf makepkg: use more awk'ish syntax in sanity checks
This simplifies the flow a bit, making the pipeline a little easier to
grok.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-07 21:05:05 -05:00
Dave Reisner
4ed12aec30 makepkg: avoid for loop in deleting manpage hardlinks
find can do this all on its own and remain portable.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-07 21:05:04 -05:00
Dave Reisner
17c3de3e4f makepkg: act on function return value, not output
Correcting a typo, as this function will never output anything.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-07 21:05:04 -05:00
Dave Reisner
3d9f961d13 makepkg: refactor check_pgpsigs output
- display associated warnings on same line as pass/fail msg, to be more
  consistent with checksum verification output
- properly error on a revoked key (matching pacman's behavior)

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-07 21:05:04 -05:00
Dan McGee
8ffa2b24a5 Use more correct integer types in diskspace checks
This adjusts type usage to match POSIX provided types from
<sys/types.h> rather than assuming everything will fit in a long or
unsigned long. Use fsblkcnt_t (unsigned) and blkcnt_t (signed) as
appropriate. These are affected the same way off_t is on 32 bit
platforms, where the types are extende to 64 bits if large file support
is enabled.

Because most numbers here are block counts, this isn't
near as pressing as using a 32-bit variable for file sizes where
anything over 2GiB can burn you; we likely can support files at least
512 but mainly 4096 times larger.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-07 21:05:04 -05:00
Dan McGee
b961ebe16f query check: use provided filelist count instead of keeping track
We don't need to keep track of how many files are in a package now that
said value is provided to us. It also makes more sense to use size_t
here for types rather than the (hopefully never too short) int.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-07 20:51:35 -05:00
Dan McGee
6317db8429 Remove unnecessary cast
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-07 20:51:35 -05:00
Dan McGee
3e08614fda Ensure PackageRequired works as expected
Changes in commit dc3336c277 caused this to stop working as expected for
sync packages, due to the way the logic is structured. Ensure we always
enter the signature code if the bitflag is flipped on to check
signatures for packages. Rename 'use_sig' to 'has_sig' for clarity.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-07 20:51:35 -05:00
Dave Reisner
0e79802c0a makepkg: use globs in place of regex
We seem to enjoy using bash regex capabilities, but never referencing
the result with BASH_REMATCH. Replace almost all regexes with equivalent
globs which are faster and functionally equivalent in these cases.

This enables the extglob shopt.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-06 11:46:01 -05:00
Dan McGee
8d0ff3d7dc dload: use intmax_t when printing off_t
This works for both 32-bit and 64-bit platforms.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-06 11:44:29 -05:00
Dave Reisner
29ad9e0a0a makepkg: unset variables as per !{make,build}flags
Don't just set the flag variables to zero length strings, actually unset
them from the environment. This fixes issues with broken gnu Makefies
that use ?= for assigment, where the presence of a var is enough to make
this condition avoid assignment.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-06 08:45:44 -05:00
Dave Reisner
7ed54a9940 rankmirrors: properly sort resulting times
- Properly read each sorted line into a new array, instead of breaking
  on every word.
- LC_COLLATE should apply to the sort portion of the pipeline, not the
  printing.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-06 08:44:34 -05:00
Dave Reisner
a4e0d3e930 dload: abstract dload_interrupted reasons
This gives us some amount of room to grow in case we ever find another
reason that we might return with an error from the progress callback.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-06 08:44:14 -05:00
Dave Reisner
6c236277a3 dload: improve debug output
We lost some of this output in the fetch->curl conversion, but I also
noticed in FS#25852 that we just lack some of this useful information
along the way.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-06 08:44:09 -05:00
Dave Reisner
7054e37126 sync: add missing newline in warning message
Dan: fix the other missing one too.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-06 08:43:23 -05:00
Dave Reisner
400942fedf avoid blowing out the filecache list when using tmpdir
_alpm_filecache_setup() destroys the list of cachedirs when it finds no
writeable directories in the config. This put us in an awkward situation
where _alpm_filecache_find() would locate a downloaded file in a r/o
cachedir, but then fail to install it after _alpm_filecache_setup() is
called (with a NULL argument). Change this behavior to merely prepend
the temporary directory to the list of available cachedirs.

Dan exposed it in e07547ee4e, as now a package can be found in a
directory we may not be able to actually store packages in.

Reported-by: Rémy Oudompheng <remy@archlinux.org>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-06 08:42:02 -05:00
Dan McGee
7ea1ea88bb More package operations cleanup
Neither deltas nor filename attributes are ever present in the local
database, so we can remove all of the indirection for accessing these
attributes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 22:07:06 -05:00
Dan McGee
7c956d5d4b Add -p/--print tip for -Q operations on filepath
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:45:33 -05:00
Dan McGee
98fdfa1968 Former transaction callback rename refactor
Put all the callback stuff in alpm.h in one spot, and make the following
renames for clarity with the new structure:

ALPM_TRANS_EVT_* --> ALPM_EVENT_*
ALPM_TRANS_CONV_* --> ALPM_QUESTION_*
ALPM_TRANS_PROGRESS_* --> ALPM_PROGRESS_*
alpm_option_get_convcb() --> alpm_option_get_questioncb()
alpm_option_set_convcb() --> alpm_option_set_questioncb()

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:45:08 -05:00
Dan McGee
37da18aee8 Move all callbacks up to the handle level
This was just disgusting before, unnecessary to limit these to only
usage in a transaction. Still a lot of more room for cleanup but we'll
start by attaching them to the handle rather than the transaction we may
or may not even want to use these callbacks.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:45:03 -05:00
Dan McGee
d88e524e7c Be fully silent on any -Sp operation
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:44:45 -05:00
Dan McGee
062c391919 Make delta validation/application more logical
The call to apply was tucked inside validate, and the EVENT callbacks
were done outside the function rather than inside. Reorganize things a
bit to make more sense.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:44:39 -05:00
Dan McGee
16fd66f879 pacman-key: add --refresh-keys operation
This allows new signatures to be pulled, revocations to be found, etc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:44:04 -05:00
Dan McGee
d9545103b9 pacman-key: split keyserver to a separate option
This also renames '--receive' to '-recv-keys' to match the wrapped gpg
option name, rather than invent a new one, now that the calling
convention is the same.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:43:03 -05:00
Dan McGee
5a9b07b0e7 pacman-key help and documentation cleanup
We were using the mystical [<foobar>] options which is some sort of
cross between a <required> argument and an [optional] one. Remove this
madness and do some other general cleanup/consistency work in the
manpage.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:41:40 -05:00
Dan McGee
24f4f9822f doc: consistency when referencing other options
Use '\--option' rather than `--option` everywhere.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:41:40 -05:00
Dan McGee
3c3ee6796a pacman-key: document --lsign-key
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 21:41:40 -05:00
Dan McGee
83a1e4fee3 Clean up handling of size fields
We currently have csize, isize, and size concepts, and sometimes the
difference isn't clear. Ensure the following holds:

* size (aka csize): always the compressed size of the package; available
  for everything except local packages (where it will return 0)
* isize: always the installed size of the package; available for all
  three package types

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-02 19:26:07 -05:00
Dan McGee
c51b9ca0ad pactest: remove PACMAN_OUTPUT from ldconfig tests
This removes the last usages of this rule that aren't explicitly looking
at real output from pacman. Notably, these tests depended on one
particular debug logger not ever being changed, which is too fragile,
not to mention doesn't work at all with --nolog.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-01 14:36:44 -05:00
Dan McGee
ad051f7328 _alpm_parsedate(): return time_t and not long
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-01 12:36:11 -05:00
Dan McGee
13072ef86c Add pactest for overflowing date (year 2038 problem)
This will work fine on x86_64 (or any platform that has a 64 bit long),
but currently fails on i686. This test also stresses the recent changes
to accommodate package size values greater than a 32 bit UINT_MAX.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-01 12:18:48 -05:00
Dan McGee
11873b70ae makepkg: fix overzealous PGP signature file matching
The regex wasn't rooted at the end of the filename, nor was it matching
a period/dot before the file extension. The end result was this matched a
file named '07_all_sig.patch' which is totally broken.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-01 11:42:55 -05:00
Dave Reisner
11ab9aa9f5 pacman/callback: reuse strlen calculation
Call strlen earlier in the dl progress callback, and reuse this length
to replace some heavier str*() calls with more optimized mem*()
replacements. This also gets rid of a false assumption that the ending
string will ever be longer than the original string.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-01 11:33:28 -05:00
Dave Reisner
cf1f014393 makepkg: fix sanity checking in versioning
Read the entire variable, respecting escapes, which are necessary to
retain for the successive eval.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-01 11:32:26 -05:00
Dave Reisner
5bb2d2e0a0 makepkg: read filenames in a while loop
Further improvments on 2ca27ab which will allow the changelog and
install script files to contain whitespace.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-01 11:32:20 -05:00
Dave Reisner
35d8cc8bc8 makepkg: fix breakage in eval'ing quoted strings
Broken in 2ca27a by me, trying to fix another problem.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-09-01 11:32:14 -05:00
Dan McGee
50f53b293c pacman-key: add --lsign-key operation
This allows local signing of a given key to help establish the web of
trust rooted at the generated (or imported) master key.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-30 08:39:26 -05:00
Dan McGee
7479bf21e8 pacman-key master key generation
This enables pacman-key, during --init, to generate a single secret key
for the pacman keyring if one is not present. This will be used as the
root of the web of trust for those that do not wish to manage it with
their own key, as will be the default.

This does not preclude later adding other secret keys to the keyring, or
removing this one- we simply ensure you have at least one secret key
available.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-30 08:23:46 -05:00
Dan McGee
06b228b20f Scale package integrity progress bar/percentage by package size
This upgrades the simple 15/17 scaling by package number we used before
to package sized based scaling, which is much more accurate. Addresses
some of the issues raised in FS#25817.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-30 08:23:32 -05:00
Allan McRae
19c3880ec9 Remove outdated comment for _alpm_outerconflicts
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-30 08:11:57 -05:00
Pang Yan Han
2c5f000d5b Improve advice for sync ops when db.lck is present
When the database is locked, sync operations involving transactions, such as
pacman -Syy, show the following:

:: Synchronizing package databases...
error: failed to update core (unable to lock database)
error: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
error: failed to update multilib (unable to lock database)
error: failed to synchronize any databases

Whereas pacman -U <pkg> shows:

error: failed to init transaction (unable to lock database)
  if you're sure a package manager is not already
  running, you can remove /var/lib/pacman/db.lck

Which is much more meaningful, since the presence of db.lck may indicate an
erroneous lockfile instead of an ongoing transaction.

Improve the error messages for sync operations by advising the user to remove
db.lck if he is sure that no package manager is running.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 20:17:08 -05:00
Dan McGee
234b6ffc2c Parse > 2GiB file sizes correctly
We were using atol(), which on 32 bit, cannot handle values greater than
2GiB, which is fail.

Switch to a strtoull() wrapper function tailored toward parsing off_t
values. This allows parsing of very large positive integer values. off_t
is a signed type, but in our usages, we never parse or have a need for
negative values, so the function will return -1 on error.

Before:
    $ pacman -Si flightgear-data | grep Size
    Download Size  : 2097152.00 K
    Installed Size : 2097152.00 K

After:
    $ ./src/pacman/pacman -Si flightgear-data | grep Size
    Download Size  : 2312592.52 KiB
    Installed Size : 5402896.00 KiB

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:57:05 -05:00
Helder Martins
d74dad79b7 lib/libalpm/handle.c: Removed redundant if condition
Signed-off-by: Helder Martins <heldermartins89@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:56:24 -05:00
Dan McGee
515720a6fc Ensure progress callback updates if XX/YY numerator changes
We only updated if the percentage incremented and enough time had
elapsed, even though the numerator of the current/howmany fraction may
have changed. Ensure we proceed with the progress bar update in these
cases so as to not mislead the user.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:56:14 -05:00
Dan McGee
8129b93afe pacman-key: fix broken logic around updating trust database
Any option that flips UPDATEDB=1 doesn't work right now due to what we
thought was a good idea in commit cab1379a1a. Fix this by not
including the update operation in the option count and special casing
it where necessary.

Also, bring back the helpful "Updating trust database" message.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:55:28 -05:00
Allan McRae
e3676ae7b5 Run pacman test-suite with LC_ALL=C
Running the pacman test-suite in a non-English locale results in a few
failures.  Force the test-suite to run with LC_ALL=C.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:54:33 -05:00
Dan McGee
499e09734b Streamline alpm_splitdep() comparisons
This reduces from 5 to 3 the number of searches needed on the string
looking for a comparison operator, since we can so a second quick
comparison looking for '=' if we find '<' or '>'. It also makes every
search doable with strchr() or memchr() rather than the slower strstr()
method.

In testing, only 10% of splitdep calls (~1600 / 16000) during an -Ss
database load found a version comparison operator, so optimizing the not
found path to be require less work makes sense.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:54:18 -05:00
Dave Reisner
b3c0ae5205 pacsort: use boolean, not binary OR operation
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 19:53:58 -05:00
Dan McGee
7480df68ce Rework scriptlet tests to not depend on pacman output
This actually does something in a scriptlet we can check with our normal
set of rules, rather than relying on pacman debug output.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 07:48:59 -05:00
Dan McGee
f46db04f98 Merge branch 'allan/pacman-key' 2011-08-28 23:51:05 -05:00
Dan McGee
8973875a1f _alpm_splitdep(): don't pass bogus length value to strndup
If we fell through to the ALPM_DEP_MOD_ANY case, ptr would be NULL, and
we would pass (0 - <str>), which is a rather large negative number or
bogus positive number, depending on signed/unsigned. Just use strdup in
the case where we don't have a ptr available.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 23:50:28 -05:00
Dan McGee
b221af660d Database read optimizations
Hard to believe there was still more room to improve on this, but I
found an easily correctable oversight tonight. Our databases (both sync
and local) contain many blank lines, and we were not moving onto the
next line right away in these cases; instead we would proceed through
our strcmp() conditional checks as normal.

Some local numbers follow to show the effects of this patch:

Sync `-Ss foobarbaz`:
71,709 blank lines skipped early
~1,505,889 strcmp() calls avoided (21 per line)
~15% speed improvement (.210 --> .179 sec)

Local `-Qs foobarbaz`:
6,823 blank lines skipped early
115,991 strcmp() calls avoided (17 per line)
~6% speed improvement (.080 -> .071 sec)

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 23:49:27 -05:00
Dan McGee
040083b97f Allow access to package origin data
Add new alpm_pkg_get_origin() method, use it in the front end now that
the enum constants are publicly available.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 23:41:17 -05:00
Diogo Sousa
3a458783a2 Removed multiple definitions of pkgfrom_t
libalpm now exports type alpm_pkgfrom_t in alpm.h, which may be used
by frontends.

Pacman now uses alpm_pkgfrom_t instead of replicating that type (pkg_from
as was in src/pacman/package.h)

Updated API change in README.

Signed-off-by: Diogo Sousa <diogogsousa@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 23:30:10 -05:00
Dan McGee
12a6c77fdd pacman-key: have --init add more options to default gpg.conf
This adds a add_gpg_conf_option() helper function which tries to be
intelligent and only add not found options, and those which have not
been explicitly commented out.

The new options added are 'no-greeting', 'no-permission-warning', and a
default 'keyserver'.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 11:55:23 +10:00
Dan McGee
7ceeebf150 pacman-key: refine permission and locking checks
* secring.gpg can be 600, readable by root user only
* ensure grep for lock-never option in check_keyring doesn't catch comments

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-29 11:55:23 +10:00
Allan McRae
e1b9f7b300 pacman-key: rework and document holding keys in keyring
The HoldKey option was undocumented and was not suited for pacman.conf.
Instead use the file "/etc/pacman.d/gnupg/heldkeys" to contain a list
of keys not to be removed from the pacman keyring with the --populate
option.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:23 +10:00
Allan McRae
29dede2eb7 pacman-key: Improve documentation for --populate
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:23 +10:00
Allan McRae
cab1379a1a pacman-key: update trust database for relevant operations
After most operations that touch the keyring, it is a good idea to
always run a check on the trustdb as this prevents gpg complaining
on later operations.

Inspiration-from: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:22 +10:00
Allan McRae
710e83999b pacman-key: import everything then revoke on --populate
The optimization of only importing keys that were not to be later
revoked was a not smart enough.  For example, if a key was
in both a repos keyring and its revoke list, alternate runs of
pacman-key --populate would add then remove the key from the pacman
keyring.  This problem is made worse when considering the possibility
of multiple keyrings being imported.

Instead, import all keys followed by the revoking of all keys.  This
may result in a key being added then revoked, but that is not much of
an issue given that is a very fast operation.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:22 +10:00
Allan McRae
d1240f67ea pacman-key: rework importing distro/repo provided keyrings
The current --reload option, apart from being non-clear in its naming,
is very limited in that only one keyring can be provided.  A distribution
may want to provide multiple keyrings for various subsets of its
organisation or custom repo providers may also want to provide a keyring.

This patch adds a --populate option that reads keyrings from (by default)
/usr/share/pacman/keyrings.  A keyring is named foo.gpg, with optional
foo-revoked file providing a list of revoked key ids.  These files are
required to be signed (detached) by a key trusted by pacman-key, in
practice probably by the key that signed the package providing these
files. The --populate flag either updates the pacman keyring using all
keyrings in the directory or individual keyrings can be specified.

Signed-off-by: Allan McRae <allan@archlinux.org>
2011-08-29 11:55:22 +10:00
Dan McGee
2cfcc874b9 Better error handling out of package load method
There are many other ways to fail a package load other than "file not
found". We should also use the correct error code in this case. Clean it
up a bit in the various callers.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:52:41 -05:00
Dan McGee
dc3336c277 Refactor some args out of pkg_load_internal
Just pass the entire sync package in if we have it; that way we can do
any necessary operations involving it rather than have a parameter list
growing endlessly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:52:19 -05:00
Dan McGee
c7e4005e5c Add more info to debug key display
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:52:10 -05:00
Dan McGee
de43d00db0 Refactor signature result return format
I was trying to take a shortcut and not introduce a wrapper struct for
the signature results, so packed it all into alpm_sigresult_t in the
first iteration. However, this is painful when one wants to add new
fields or only return information regarding a single signature.

Refactor the type into a few components which are exposed to the end
user, and will allow a lot more future flexibility. This also exposes
more information regarding the key to the frontend than was previously
available.

The "private" void *data pointer is used by the library to store the
actual key object returned by gpgme; it is typed this way so the
frontend has no expectations of what is there, and so we don't have any
hard gpgme requirement in our public API.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:51:54 -05:00
Diogo Sousa
12387ca4e5 lib/libalpm/signing.c: Fix memory leak in decode_signature() in case of error.
Signed-off-by: Diogo Sousa <diogogsousa@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:50:22 -05:00
Lukas Fleischer
0dad2f6e62 lib/libalpm/util.c: Fix two memory leaks
Free "md5sum" if md5_file() fails in alpm_compute_md5sum(). Free
"sha256sum" if sha2_file() fails in alpm_compute_sha256sum().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:49:02 -05:00
Dan McGee
a12a4ea396 Check local database status flag in db_write sanity check block
Do all the checks at once; this also avoids the 'return' call after we
have allocated memory for "pkgpath" as well as tweaked the umask.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:46:09 -05:00
Lukas Fleischer
455ca55f4e be_sync.c: Fix memory leak in alpm_db_update()
Free "syncpath" and restore umask if we fail to grab a lock.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:40:22 -05:00
Lukas Fleischer
a2002b8f69 pacman.c: Remove redundant strdup() in parsearg_global()
config_set_arch() already calls strdup(). Remove strdup() from the
config_set_arch() invocation to avoid a memory leak.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:37:16 -05:00
Dan McGee
87fb8f5d57 Make sync error message smarter on unfound targets
We had two issues here. One is a file with an absolute path passed to -S
results in a cryptic error message due to the database name being '\0'.
The second is not realizing you should be doing -U instead of -S. Fix
both of these to transform this:

    $ sudo pacman -S /tmp/binutils-2.21.1-2-i686.pkg.tar.xz
    error: database not found:

to this:

    $ sudo pacman -S /tmp/binutils-2.21.1-2-i686.pkg.tar.xz
    error: target not found: /tmp/binutils-2.21.1-2-i686.pkg.tar.xz
    warning: '/tmp/binutils-2.21.1-2-i686.pkg.tar.xz' is a file, did you mean -U/--upgrade instead of -S/--sync?

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:37:04 -05:00
Dan McGee
84d6de806b Fix possible mismatched type with several curl arguments
After commit 2e7d002315, we use off_t rather than long variables.
Use the _LARGE variants of the methods to indicate we are passing off_t
sized variables, and cast using (curl_off_t) accordingly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-28 19:36:50 -05:00
Dan McGee
5a07b75b22 Always process validity value returned by gpgme
Don't force 'never'; you should be checking both the status and validity
anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 17:41:47 -05:00
Dan McGee
be72e10015 Fix small memory leak in sig check code
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 17:41:27 -05:00
Dan McGee
c5982a3eb5 strtrim: don't move empty string
There were many cases where the string coming in was a blank line, e.g.
"\n\0", length 1. The trim routine starts by trimming leading spaces,
thus trimming everything. We would then proceed to do a memmove of the
NULL byte, which is completely worthless as we can just assign it
instead.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 17:14:19 -05:00
Dan McGee
e1dce078b2 Remove argument from check_pgp_helper
This one wasn't all that necessary as we only used it in one place in
the function, which can be checked easily enough at the call site.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:12:49 -05:00
Dan McGee
6aa9fdce5a Remove trans is NULL check in QUESTION/EVENT/PROGRESS macros
trans cannot (and better not) be NULL at any point when these are being
called.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:12:33 -05:00
Dan McGee
0ee3ce70a8 Remove short/long label distinction
We only used short labels in one place, and the short label is always
the first character of the long label anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:09:52 -05:00
Dan McGee
73fcf17041 Slight refresh of the download progress callback
This cleans up some of the mess we have here.

* switch to long units for the download size
* omit the .0 decimal part from the download rate
* omit the almost always zero HH: from estimated time if eta_h == 0
* Display --:-- if eta_h > 99; formatting was screwed up before

The net result of this is we usually have 1 more character to use for
filename display.

Before:
 extra                   500.9K 1242.4K/s 00:00:00 [######################] 100%
 community-testing       947.0B   28.2M/s 00:00:00 [######################] 100%
 multilib                 26.5K  405.1K/s 00:00:00 [######################] 100%
 community               450.6K 1238.3K/s 00:00:00 [######################] 100%

After:
 extra                    500.9 KiB  1118K/s 00:00 [######################] 100%
 community-testing        947.0   B    23M/s 00:00 [######################] 100%
 multilib                  26.5 KiB   255K/s 00:00 [######################] 100%
 community                450.6 KiB  1211K/s 00:00 [######################] 100%

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:09:52 -05:00
Dan McGee
30cad47fb9 Add a few more sizes to humanize_sizes()
Because why the hell not? Exbibyte, zebibyte, and yobibyte are going in,
even though nothing bigger than the 2^60 exbibyte can be represented
using an off_t variable anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:09:52 -05:00
Dan McGee
f7a3c4c8df Finish large file download attack prevention
This handles the no Content-Length header problem as stated in the
comments of FS#23413. We add a quick check to the callback that will
force an abort if the downloaded data exceeds the payload size, and then
check for this error in the post-download cleanup code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:09:52 -05:00
Dan McGee
2e7d002315 Use off_t rather than double where possible
Beautiful of libcurl to use floating point types for what are never
fractional values. We can do better, and we usually want these values in
their integer form anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:09:52 -05:00
Dan McGee
f0357e415c Add new 'lt' and 'zh_TW' translations from transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:04:41 -05:00
Dan McGee
5c48ca3239 Update existing translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-25 16:04:41 -05:00
Diogo Sousa
268d0bbcbe Improved alpm_list_mmerge() performance (fixed coding style)
Improved alpm_list_mmerge() performance by removing an extra
pass to obtain the tail node.

This was actually suggested by a TODO comment.

Signed-off-by: Diogo Sousa <diogogsousa@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-24 11:27:11 -05:00
Dan McGee
30d978a966 vercmp: ensure 2.0a and 2.0.a do not compare equal
We had this interesting set of facts conundrum, according to vercmp
return values:
    2.0a <  2.0
    2.0  <  2.0.a
    2.0a == 2.0.a

This introduces a code change that ensures '2.0a < 2.0.a' as would be
expected by the first two comparisons. Unfortunately this stays us a bit
further from upstream RPM code, but those are the breaks (in RPM, the
versions involving 'a' do in fact compare the same, but they are both
greater than the bare '2.0').

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-23 01:49:29 -05:00
Dan McGee
cc03d6366a Style-match rpmvercmp code with upstream
Not sure how or why some of this differed, but it is easy enough to set
it back to how it was so it is easier to diff.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-23 01:47:45 -05:00
Dan McGee
a8a4395098 Retrieve default SigLevel value from backend after initial setting
This ensures we grab and use the library default once we have processed
the global SigLevel setting, but before processing the repo-specific
settings. This means the following two configs will now evaluate the
same, as the backend currently defaults to 'Optional':

Config 1:
    [options]
    # nothing here
    [repo]
    SigLevel = TrustAll

Config 2:
    [options]
    SigLevel = Optional
    [repo]
    SigLevel = TrustAll

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-23 01:06:56 -05:00
Dave Reisner
6731d0a940 sync: halt file discovery if repo has no servers
This avoids error spam when no servers are configured for a repo and a
sync operation is performed:

Proceed with installation? [Y/n] y
:: Retrieving packages from testing...
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing
warning: failed to retrieve some files from testing

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-23 00:49:14 -05:00
Jakob Gruber
dddd6a46a0 Fix formatting in pacman-key manpage
Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 13:15:15 -05:00
Dan McGee
762cbf574b dload: prevent need to copy struct in mask_signal()
Since we store this directly in the download function, just rework
mask_signal() to take a pointer to a location to store the original.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 09:27:13 -05:00
Dave Reisner
f3e2858621 dload: extract tempfile creation to its own function
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 09:23:18 -05:00
Dave Reisner
c65cea0dcb dload: move (un)masking of signals to separate functions
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 09:23:14 -05:00
Dave Reisner
10cbfc956c dload: move curl option setting to static function
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 09:19:38 -05:00
Dave Reisner
d64c409913 dload: add open_mode to payload struct
This is a precursor to a following patch which will move the setting of
options to a separate function. With the open mode as part of the
struct, we can avoid modifying stack allocated variables.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 09:18:00 -05:00
Dave Reisner
592ed13bce dload: rename cd_filename to content_disp_name
This is more in line with the menagerie of file name members that we now
have on the payload struct.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 09:15:11 -05:00
Dave Reisner
329a7b7e24 dload: move tempfile and destfile to payload struct
These are private to the download operation already, so glob them onto
the struct. This is an ugly rename patch, with the only logical change
being that destfile and tempfile are now freed by the payload_free
function.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 09:14:45 -05:00
Dave Reisner
c4350d90f1 pacman/util: use string_length to calculate line length
This is measuring strings that are potentially localized, so we need a
multibyte aware function to count characters instead of bytes.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 08:53:25 -05:00
Allan McRae
b6914d16cc Print callback messages to stderr
Fixes FS#25099.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 08:53:01 -05:00
Dan McGee
a98babbfef Print debug timestamps to same stream as rest of output
We used fprintf() elsewhere in this function, but we didn't use it on
the debug timestamp printing. Use fprintf() instead of printf() to fix
this.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 08:53:01 -05:00
Pang Yan Han
343ea81718 pacsort: correct list freeing
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 08:53:01 -05:00
Dan McGee
ffdfc82523 pacsort: ensure list is freed if size is 0
Found using: `valgrind ./src/util/.libs/lt-pacsort /dev/null`

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 08:53:01 -05:00
Pang Yan Han
e9b8a7693d pacsort: correct pointer type in list_new
Pointer sizes are the same but this makes intention clearer.

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-22 08:53:01 -05:00
Dan McGee
d9e5dab6ac Remove alpm_option_get_* usage from backend
These are all available directly on the handle without indirection.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 19:12:21 -05:00
Dave Reisner
d307ed5eb9 dload: remove unused macro
This was a vestige leftover from the libfetch days of yore.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 19:01:57 -05:00
Dave Reisner
82fc816d79 dload: delete zero length downloads on curl error
In the case of a non-operation (e.g. DNS resolver error), delete the
leftover 0 byte .part file.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 19:00:58 -05:00
Dave Reisner
43940f591e dload: rename payload->filename to payload->remote_name
This is a far more accurate description of what this is, since it's more
than likely not really a filename at all, but the name after a final
slash on a URL.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 19:00:40 -05:00
Dave Reisner
eae363c96f dload: remove code duplication
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 19:00:13 -05:00
Dave Reisner
d3f135af8f bash_completion: add dbonly to sync options
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 18:56:00 -05:00
Dan McGee
e07547ee4e Rework finding a writable cache directory
This is a refactor and refresh of the code used to find where we should
download packages.

* Incorporate suggestions from FS#25435 to use TMPDIR from the
  environment if set, otherwise fall back to /tmp as before.
* Make the writability tests a bit more in depth. We now do a three part
  check consisting of:
  - S_ISDIR(): is this even a directory
  - access(W_OK): is this directory writable by the current user.
    Unfortunately for root, this almost always returns that it is, but
    in the case of a RO mount or NFS share inaccessible to root, this
    check will exclude the directory.
  - mode & (any write bit): is there a writable bit set on this
    directory. This makes it possible to enforce a read-only cache
    directory by setting permissions to 0555, for example.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 13:10:17 -05:00
Dan McGee
6d544984f2 Be more robust when copying package data
This changes the signature of _alpm_pkg_dup() to return an integer error
code and provide the new package in a passed pointer argument. All
callers are now more robust with checking the return value of this
function to ensure a fatal error did not occur.

We allow load failures to proceed as otherwise we have a chicken and egg
problem- if a 'desc' local database entry is missing, the best way of
restoring said file is `pacman -Sf --dbonly packagename`. This patch
fixes a segfault that was occurring in this case.

Fixes the segfault reported in FS#25667.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 11:09:57 -05:00
Dave Reisner
9934b3bd34 lib/dload: unlink on response code >=400
ftp and http both define >=400 as being "something bad happened"

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 09:54:58 -05:00
Dave Reisner
24824b54ce dload: add 'unlink_on_fail' to payload struct
Let callers of _alpm_download state whether we should delete on fail,
rather than inferring it from context. We still override this decision
and always unlink when a temp file is used.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 09:43:19 -05:00
Dave Reisner
2ca27ab3a1 makepkg: quote re-evaluation of simple vars
This is a safety measure to prevent simple code injection.

$ i="foo bar"
$ eval i="$i"
bash: bar: command not found
$ eval i=\"$i\"
$ echo "|$i|"
|foo bar|

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 09:42:41 -05:00
Dave Reisner
1723e6dc4f lib/dload: prevent possible NULL dereference
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 09:41:55 -05:00
Dave Reisner
16334f778b sync: fix garbled output in conflict prompt
$ pacman -S cronie
resolving dependencies...
looking for inter-conflicts...
:: cronie and fcron are in conflict (@.). Remove fcron? [y/N] n

$ sudo pacman -S pacman
resolving dependencies...
looking for inter-conflicts...
:: pacman and pacman-git are in conflict (pKÈ). Remove pacman-git? [y/N]

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 09:40:07 -05:00
Allan McRae
c28052e45b makepkg: deal with variable substitution when checking sanity
If any of pkgver, pkgrel or epoch contained a variable substitution,
then it needed to be evaluated before checking its value conformed
to the rules.

[Dan: add quotes around RHS]

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:50:17 -05:00
Dan McGee
2a466c2abc doc/PKGBUILD: update regarding versioned package fields
Add the info that versioned replaces are now supported, as well as
beefing up some of the other places touching on versioned fields.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee
6cfc4757b9 Convert resolvedep() to use _alpm_depcmp_literal()
The whole first loop is trying to check literals only, so teach it to do
so. Also, reorder operations to make more sense by putting the strcmp()
first in the literal loop, and using a very cheap name_hash check first
in the second loop.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee
3752edbff4 Fix replacement of provider issue
When we switched to using alpm_depcmp() in resolving replacments, we had
some interesting behavior with regard to providers and packages not
found in repositories. Teach the replacement resolving code to not look
at provisions at all to be slightly more sane.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee
d008a816f1 Add an _alpm_depcmp_literal() function
This omits the finding of matching provisions and only checks the
package itself against the provided dep.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee
78b63ce7c3 Replacements refactor: extract check_replacers()
This moves code that was inline in alpm_sync_sysupgrade() to its own
method.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee
231d6cc1e4 Replacements refactor: extract check_literal()
This moves code that was inline in alpm_sync_sysupgrade() to its own
method.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee
5d291d050e Remove usages of alpm_list_next() in backend
Another function call that can be replaced by a single pointer
dereference.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee
c4bd476ad1 Remove use of no-op accessor functions in library
The functions alpm_db_get_name(), alpm_pkg_get_name(), and
alpm_pkg_get_version() are not necessary at all, so remove the calling
and indirection when used in the backend, which makes things slightly
more efficient and reduces code size.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Dan McGee
c885a953eb Enhance and utilize database status flags
* Move is_local standalone field to status enum
* Create VALID/INVALID flag pair
* Create EXISTS/MISSING flag pair

With these additional fields, we can be more intelligent with database
loading and messages to the user. We now only warn once if a sync
database does not exist and do not continue to try to load it once we
have marked it as missing.

The reason for the flags existing in pairs is so the unknown case can be
represented. There should never be a time when both flags in the same
group are true, but if they are both false, it represents the unknown
case. Care is taken to always manipulate both flags at the same time.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Sebastien Luttringer
4a7f3bbc46 Add makepkg -S which is an alias to makepkg --source
makepkg --source is a often used go make source package like for AUR.
Have a -S shortcut will save the world.

Signed-off-by: Sebastien Luttringer <seblu@seblu.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Lukas Fleischer
d18e600952 lib/libalpm/dload.c: Use STRDUP() instead of strdup()
Use the STRDUP macro instead of strdup() for the sake of better error
handling on memory allocation failures.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 10:47:41 -05:00
Lukas Fleischer
0745288c14 lib/libalpm/dload.c: Add ASSERT() to alpm_fetch_pkgurl()
Return with ALPM_ERR_WRONG_ARGS instead of causing a potential segfault
if alpm_fetch_pkgurl() is invoked with a NULL URL.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-18 07:38:31 -05:00
Dave Reisner
9f139550f8 lib/dload: refactor deletion on failure
This moves all the delete-on-fail logic to under cleanup label. This
also implies should_unlink when a payload is received that doesn't allow
resuming.

Fixes .db.sig.part files leftover in the sync dir.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17 21:03:43 -05:00
Dave Reisner
2dbdfe0788 lib/dload: avoid renaming download to 0 length destfile
This leverages earlier work that avoids a rename when destfile is unset.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17 17:31:04 -05:00
Lukas Fleischer
b9833838c6 Avoid stat() on NULL path in curl_download_internal()
stat()'s behaviour is undefined if the first argument is NULL and might
be prone to segfault. Add an additional check to skip the stat()
invocation if no destfile is used.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17 17:30:52 -05:00
Lukas Fleischer
9cddc4ad80 Skip rename() on NULL destfile in curl_download_internal()
Avoid a potential segfault that may occur if we use a temporary file and
fail to build the destination file name from the effective URL.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17 17:30:41 -05:00
Dan McGee
3ceef97799 Fix trailing whitespace in whole codebase
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17 17:03:19 -05:00
Sebastien Luttringer
b2688e9559 Update PKGBUILD manpage about startdir deprecation
Signed-off-by: Sebastien Luttringer <seblu@seblu.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-17 16:54:53 -05:00
Dan McGee
b952a3b08c Fix compilation using --without-gpgme
This function is used regardless of whether gpgme support is enabled, so
make sure it is always accessible.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16 19:51:21 -05:00
Allan McRae
c5c1a1349a configure.ac: add checks for more types, functions and headers
This covers most types, functions and headers that we use in the
code base.  Currently we do not use any of these checks, but it
is useful to have the configure output when looking at build issues
on other peoples systems.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16 19:39:07 -05:00
Dave Reisner
b008193c12 dload: zero out pm_errno in curl_download_internal
This reverts some hacky behavior from 5fc3ec and resets the handle's
pm_errno where it should be reset -- prior to each download. This
prevents a transaction with a download from being aborted when a package
is successfully grabbed from a secondary server.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16 19:37:14 -05:00
Dan McGee
cea6d7eb13 doc/PKGBUILD: fix Asciidoc formatting issues
We had this gem:
    ⇐ (less than or equal to)

Due to not ensuring we did literal printing of things like this. Fix it
and a few other problems noticed scanning through both the HTML and
manpage generated files.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16 11:47:53 -05:00
Dan McGee
70db027204 Update authors and contributors
* .mailmap: add mapping for Dave's two email addresses.
* AUTHORS: clear out file, tell people to use `git shortlog -s` instead.
* doc/footer.txt: "promote" Dave, put Xavier and Nagy in past contributors.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16 11:46:44 -05:00
Allan McRae
f41dc7e8fa repo-add: fix creation of signature symlink
When creating a repo outside the current directory, the signature
symlink was not created.

Reported-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16 09:25:10 -05:00
Dan McGee
1175702828 Update message catalogs
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 16:09:45 -05:00
Dan McGee
d4a92cacc6 Update translations from Transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 16:09:11 -05:00
Dan McGee
11b9bc443d repo-add: reorganize output messages for clarity
The use of warning once we had already started adding a package was
confusing as it broke the standard indent pattern. It was especially bad
if adding multiple packages as it wasn't clear what sub-messages applied
to which package being added. This should be an output change only from:

    ==> Adding package '/tmp/sync/netcfg-2.6.7-1-any.pkg.tar.xz'
      -> Computing checksums...
      -> Adding package signature...
    ==> WARNING: An entry for 'netcfg-2.6.7-1' already existed
      -> Removing existing entry 'netcfg-2.6.7-1'...
      -> Creating 'desc' db entry...
      -> Creating 'depends' db entry...

to:

    ==> Adding package '/tmp/sync/netcfg-2.6.7-1-any.pkg.tar.xz'
    ==> WARNING: An entry for 'netcfg-2.6.7-1' already existed
      -> Computing checksums...
      -> Adding package signature...
      -> Removing existing entry 'netcfg-2.6.7-1'...
      -> Creating 'desc' db entry...
      -> Creating 'depends' db entry...

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 15:15:11 -05:00
Dan McGee
11f4a7a48e Only check necessary signatures and checksums
The precedence goes as follows: signature > sha256sum > md5sum

Add some logic and helper methods to check what we have available when
loading a package, and then only check what is necessary to verify the
package. This should speed up sync database verifies as we no longer
will be doing both a checksum and a signature validation.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 15:15:11 -05:00
Rémy Oudompheng
855bc16a9e libalpm: fix a remaining old syntax of RET_ERR() macro
It would prevent compilation of pacman on FreeBSD, and possibly other
systems.

Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 14:55:14 -05:00
Dave Reisner
5fc3ecf7f8 lib/sync: ignore download errors for as long as possible
Previously, the behavior was such that if a sync operation required
packages from multiple repos, a download error in the first repo would
cause a hard repo, ignoring the remainder of the repositories. Change
this behavior so that we do a better job of fetching as many packages as
possible before aborting the transaction.

There's a little bit of refactoring mixed in here to get rid of some
useless variables. Since we now depend heavily on the value of
handle->pm_errno being accurate the determine the function's return
value, we clear it when the transaction state is set.

Fixes FS#25532.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 14:54:21 -05:00
Dan McGee
796eaaed40 Further fixes to replacement iteration
A partial fix for this was in commit 7de92cb22, but this should fix the
remaining cases. There are still several issues dealing with "provision
as replacement" selection however.

Addresses FS#25538 and FS#25527.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 14:47:19 -05:00
Dan McGee
88bd1cec77 Add short example signature config to pacman.conf
This is similar to what we do with every other option.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 13:08:24 -05:00
Dave Reisner
82ffe2cbfd build-sys: always use $(RM) instead of rm -f
These are equivalent. Use the autoconf macro for consistency.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 13:05:27 -05:00
Dave Reisner
1741b5cc30 dist: preserve symlinks on installation
This applies to the repo-remove man page as well as the script itself.

Yes Dan, I ran distcheck afterwards.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 13:05:17 -05:00
Dan McGee
a628feee46 Parse conflicts/provides/replaces at database load time
We did this with depends way back in commit c244cfecf6 in 2007. We
can do it with these fields as well.

Of note is the inclusion of provides even though only '=' is supported-
we'll parse other things, but no guarantees are given as to behavior,
which is more or less similar to before since we only looked for the
equals sign.

Also of note is the non-inclusion of optdepends; this will likely be
resolved down the road.

The biggest benefactors of this change will be the resolving code that
formerly had to parse and reparse several of these fields; it only
happens once now at load time. This does lead to the disadvantage that
we will now always be parsing this information up front even if we never
need it in the split form, but as these are uncommon fields and our
parser is quite efficient it shouldn't be a big concern.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 12:56:41 -05:00
Dan McGee
bd5ec9cd8e Validate the sha256sum if available
Adjust load_internal() to check the sha256sum value if we have it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 12:13:35 -05:00
Dan McGee
f37c501657 Show 'None' in Signatures -Qip/-Si output if none found
This is to be as consistent as possible across both types of display.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 12:12:37 -05:00
Dan McGee
fa4aad5b50 decode_signature: guess signature data length for efficiency
We may end up allocating 1 or 2 extra bytes this way, but it is worth it
to simplify the method and not have to call base64_decode() a second
time. Use the hueristic that base64 encoding produces 3 bytes of decoded
data for every 4 bytes of encoded data.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 12:11:59 -05:00
Dan McGee
f3f39cef84 Remove checksum access indirection
These items are never present in anything but sync databases, nor do we
even try to load them from the local database. Remvoe the indirection
meant to allow the caching layer to work since it will never do anything
anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 12:11:59 -05:00
Dave Reisner
7de92cb223 lib/sync: reset flag after rejecting a replace
This prevents iteration through the remainder of the current tree, with
pacman claiming that they're all replacements to the original
replacement candidate.

:: Synchronizing package databases...
 allanbrokeit is up to date
 testing is up to date
 core is up to date
 extra is up to date
 community-testing is up to date
 community is up to date
:: Starting full system upgrade...
:: Replace util-linux-git with core/util-linux? [Y/n] n
:: Replace util-linux-git with core/vi? [Y/n] n
:: Replace util-linux-git with core/vpnc? [Y/n] n
:: Replace util-linux-git with core/wget? [Y/n] n
:: Replace util-linux-git with core/which? [Y/n] n
:: Replace util-linux-git with core/wireless-regdb? [Y/n] n
:: Replace util-linux-git with core/wireless_tools? [Y/n] n
:: Replace util-linux-git with core/wpa_actiond? [Y/n] n
:: Replace util-linux-git with core/wpa_supplicant? [Y/n] n
:: Replace util-linux-git with core/xfsprogs? [Y/n] n
:: Replace util-linux-git with core/xinetd? [Y/n] n
:: Replace util-linux-git with core/xz? [Y/n] n
:: Replace util-linux-git with core/zd1211-firmware? [Y/n] n
:: Replace util-linux-git with core/zlib? [Y/n] n
 there is nothing to do

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 12:11:59 -05:00
Dan McGee
ebb2e36cc4 Load and allow access to sha256sum
This adds a field in the package struct for this checksum type as well
as allowing access via the API to it. The frontend is now able to
display any read value. Note that this does not implement any use or
verification of the value internally.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 12:11:55 -05:00
Dan McGee
31f2e0cba3 Add ALPM sha256sum routines
These mirror ones we already have for md5sums.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 07:07:13 -05:00
Dan McGee
ff88228abd Add sha2 (sha256) routines from PolarSSL
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 07:07:13 -05:00
Allan McRae
31a7b150b0 repo-add: indicate whether package signature is found
When adding a package to a repo, it is useful to be able to see
that repo-add has indeed found the signature file.

[Dan: update text to be more in line with other messages]

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 07:07:13 -05:00
Dave Reisner
20b5cc96be pacman/package: show presence of signature in in -Si
adds a new API method: alpm_pkg_get_base64_sig

[Dan: don't use a new header string in frontend]

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 07:06:23 -05:00
Dave Reisner
ea79de21d8 README: update with 3.5.0 -> 4.0.0 API changes
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 06:34:15 -05:00
Dave Reisner
71f854dde8 makepkg: don't hardcode path to strip
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 06:33:01 -05:00
Dave Reisner
05f87e0b09 alpm.h: fix inconsistency in function prototype
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 06:30:58 -05:00
Dave Reisner
8d5018e780 add pactest for replacing a shared provider
This is currently expected to fail.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 06:30:25 -05:00
Dave Reisner
ce8f91a71b pactest/sync200: check for curl instead of fetch
We can't just check for LIBS as curl won't be listed. Instead, look at
the length of the LIBCURL var from the Makefile.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 06:29:09 -05:00
Dave Reisner
6bf60568f8 lib/dload: avoid deleting .part file on too-slow xfer
Take this opportunity to refactor the if/then/else logic into a
switch/case which is likely going to be needed to fine tune more
exceptions in the future.

Fixes FS#25531

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 06:26:08 -05:00
Dan McGee
83f076d3a8 Update base64 PolarSSL code
Also adjust our code using it for the size_t adjustments made by
upstream.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-15 06:24:49 -05:00
Dan McGee
835365b817 Update MD5 routines with changes from PolarSSL
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11 20:17:21 -05:00
Dan McGee
c9cc2332cf pacman/query.c: avoid variable redeclaration
We were using i as the loop variable in both the inner and outer loop.
Use j in the inner loop instead for clarity.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11 20:17:21 -05:00
Pang Yan Han
450bcb5d7b pactest: -U --recursive
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11 12:52:18 -05:00
Dan McGee
fffaba50fb scripts/pkgdelta: fix make distcheck
--help and --version are required by the sanity checks performed by
`make distcheck`.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-11 11:56:47 -05:00
214 changed files with 22153 additions and 10278 deletions

View File

@@ -7,6 +7,7 @@ Bryan Ischo <bryan@ischo.com> <bji-keyword-pacman.3644cb@www.ischo.com>
Christos Nouskas <nous@archlinux.us> <nouskas@gmail.com>
Daenyth Blank <daenyth+arch@gmail.com> <Daenyth+Arch@gmail.com>
Daenyth Blank <Daenyth+arch@gmail.com> <Daenyth+git@gmail.com>
Dave Reisner <dreisner@archlinux.org> <d@falconindy.com>
甘露(Gan Lu) <rhythm.gan@gmail.com>
Giovanni Scafora <giovanni@archlinux.org> <linuxmania@gmail.com>
Jaroslaw Swierczynski <swiergot@gmail.com> <swiergot@juvepoland.com>

17
AUTHORS
View File

@@ -1,16 +1 @@
Judd Vinet <jvinet@zeroflux.org>
Aurelien Foret <aurelien@archlinux.org>
Aaron Griffin <aaron@archlinux.org>
Dan McGee <dan@archlinux.org>
Miklós Vajna <vmiklos@frugalware.org>
Christian Hamar <krics@linuxforum.hu>
Josh Wheeler <deltalima@gmail.com>
David Kimpe <DNAku@frugalware.org>
James Rosten <seinfeld90@gmail.com>
Roman Kyrylych <Roman.Kyrylych@gmail.com>
Andrew Fyfe <andrew@neptune-one.net>
Chantry Xavier <shiningxc@gmail.com>
Nagy Gabor <ngaba@bibl.u-szeged.hu>
Nathan Jones <nathanj@insightbb.com>
Allan McRae <mcrae_allan@hotmail.com>
Use `git shortlog -s` for a list of contributors.

View File

@@ -22,7 +22,7 @@ dist_pkgdata_DATA = \
# run the pactest test suite and vercmp tests
check-local: test/pacman test/util src/pacman src/util
$(PYTHON) $(top_srcdir)/test/pacman/pactest.py --debug=1 \
LC_ALL=C $(PYTHON) $(top_srcdir)/test/pacman/pactest.py --debug=1 \
--test $(top_srcdir)/test/pacman/tests/*.py \
-p $(top_builddir)/src/pacman/pacman
$(SH) $(top_srcdir)/test/util/pacsorttest.sh \
@@ -36,4 +36,9 @@ install-data-local:
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
update-po:
$(MAKE) -C lib/libalpm/po update-po
$(MAKE) -C scripts/po update-po
$(MAKE) -C src/pacman/po update-po
# vim:set ts=2 sw=2 noet:

97
NEWS
View File

@@ -1,5 +1,96 @@
VERSION DESCRIPTION
-----------------------------------------------------------------------------
4.0.1 - ensure VerbosePkgList table display supports multibyte chars
- always use stderr for warning/error messages (FS#26555)
- add guidance message for users when public keyring not found
- fix edge case in download progress bar rounding (FS#26853)
- ensure downloads started as tempfiles have correct umask
- ensure unowned symlinks are not overwritten incorrectly
- allow -U operation even without sync databases (FS#26899)
- update libtool files and update fix for -Wl,-as-needed
- fix build when using --disable-static (FS#26652)
- pacman-key: add a keyserver timeout value in --init
- repo-add: fix race condition around lock file removal
- makepkg:
- accept changelog= or install= without a value
- trim trailing whitespace from sensitive variables
- handle PGP signatures with a .sign extension
- delay attachment of signal traps (FS#26196)
- translations: multiple updates and corrections
4.0.0 - well-integrated and powerful signed packages and databases
support in pacman, the library, and scripts (FS#5331)
- over 800 commits to pacman.git since 3.5.4 release
- many code cleanup commits across library/binaries/scripts
- many performance improvement commits across library/binaries
- add new -S --recursive operation to upgrade a full dep chain
- report upgrade size on sync operations (FS#12566)
- early terminal input is flushed before question prompts
- remove duplicate code shared in sync and upgrade operations
- remove ShowSize; replaced with VerbosePkgLists (FS#15772)
- print callback (warning, error) messages to stderr (FS#25099)
- download progress callback has more room for filenames
- fix selection entry for long values (FS#25253)
- make config parsing two-pass process, enhance error messages
- print helpful tips on -Qi <filename> or -S <filename>
- replace libfetch with libcurl for backend download library
- timeout when mirror is not responding (FS#15369)
- full HTTPS protocol support (FS#22435)
- support of non-traditional/redirected URLs (FS#22645)
- ensure downloads are only resumed if appropriate (FS#23803)
- only remove empty directories if no remaining owner (FS#25141)
- better cache directory choosing and honor $TMPDIR (FS#25435)
- replaces are parsed as dependency-style strings (FS#23410)
- split package verification and load stages
- sync database reading refactor for performance
- use a larger buffer for package checksum validation
- filelists now have a dedicated type with metadata
- diskspace check no longer requires iterating package archives
- update and add checksum routines from PolarSSL
- validate sync database sha256sum if available
- correctly parse sizes in database > 2GiB
- API: several type renames from pm* to alpm_* prefix
- API: several enum constant renames from PM to ALPM_* prefix
- API: several types are now public exposed structs
- API: handle is no longer a single global variable
- API: more changes than can be mentioned here, see README
- much improved API documentation for use by Doxygen
- pactest: several performance/checking improvements
- scripts:
- refactor some common components into shared bash library
- split translations into pacman-scripts catalog (FS#15148)
- makepkg:
- allow signing packages after creation
- allow verifying source file signatures (FS#20448)
- add auto-versioned libdepends/libprovides support
- support UPX compression of executables (FS#17213)
- allow usage of an alternate build directory (FS#22308)
- cleancache option has been removed; use shell instead
- improved variable sanity checking (FS#16004)
- better handling of package extensions (.tar.Z or invalid)
- allow PKGEXT/SRCEXT environment overrides (FS#19860)
- only check for writable PKGDEST if necessary (FS#24735)
- check_software function exits early if missing req'd binaries
- do source packaging in fakeroot (FS#24330)
- be more POSIX-compatible in use of `ln` (FS#24893)
- handle spaces with filenames in noextract (FS#25100)
- allow epoch-versioned optdepends
- pacman-key: new keyring management tool for signed data
- pacsort: new utility, sort version numbers as pacman does
- pactree: support sync databases with -s option
- pkgdelta: add a manpage
- repo-add:
- handle and include package signatures in databases
- verify database signature before modification
- sign database after creation/modification
- general script cleanup and bash-ification
- add sha256sums to database (FS#23103)
- contrib/bacman: code cleanups and small bug fixes
- contrib/bash_completion: updates for new options/commands
- contrib/paccache: new, pacman cache cleanup script
- contrib/paclist: rewrite using bash
- contrib/paclog-pkglist: new, recover from missing local DB
- documentation: extensive updates to all manpages
- translations: extensive updates, new languages: lt, zh_TW
3.5.4 - fix display of lists on non-TTYs and other output fixes
- fix group selection entry for large inputs (FS#24253)
- fix divide by zero when downloading zero length files
@@ -122,7 +213,7 @@ VERSION DESCRIPTION
- Installing packages with -U can handle installing
dependencies, conflict resolution and replacing packages
(FS#3492, FS#5798)
- can upgrade the system and install a new package using
- can upgrade the system and install a new package using
"pacman -Syu <pkg>" (FS#15581)
- new -D/--database operation for modifying package install
reasons (FS#12950)
@@ -134,7 +225,7 @@ VERSION DESCRIPTION
- allow -Qo to perform a functional 'which' (FS#8798)
- cache cleaning cleans all directories, not just first
- cleanupdelta: new utility to help remove unused deltas from
a repo database
a repo database
- bash completion: rewrite for size and performance (FS#16630)
- repo-add: handle removing the final package from a repo
- rankmirrors: rewrite using bash
@@ -580,7 +671,7 @@ VERSION DESCRIPTION
- Makefile fix for nonstandard lib search paths (Kevin Piche)
- fixed the leftover directories in /tmp
- speed improvement patches from Tommi Rantala
2.9.2 - bugfix for 2.9.1
2.9.2 - bugfix for 2.9.1
2.9.1 - --refresh now only downloads fresh packages lists if they've
been updated (currently only works with FTP)
2.9 - Improved -Rs functionality -- pacman now tracks why a package

82
README
View File

@@ -154,7 +154,7 @@ 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]
[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
@@ -365,3 +365,83 @@ API CHANGES BETWEEN 3.4 AND 3.5
PM_TRANS_FLAG_NODEPVERSION, PM_TRANS_EVT_DISKSPACE_START,
PM_TRANS_EVT_DISKSPACE_DONE, PM_TRANS_CONV_SELECT_PROVIDER,
PM_TRANS_PROGRESS_DISKSPACE_START, PM_TRANS_PROGRESS_INTEGRITY_START
API CHANGES BETWEEN 3.5 AND 4.0
===============================
[REMOVED]
- error codes:
PM_ERR_LIBFETCH, PM_ERR_WRITE
- alpm_option_set_root(), alpm_option_set_dbpath()
- alpm_list_first()
- alpm_grp_get_name(), alpm_grp_get_pkgs()
- alpm_delta_get_from(), alpm_delta_get_to(), alpm_delta_get_filename(),
alpm_delta_get_md5sum(), alpm_delta_get_size()
- alpm_miss_get_target(), alpm_miss_get_dep(), alpm_miss_get_causingpkg()
- alpm_dep_get_mod(), alpm_dep_get_name(), alpm_dep_get_version()
- alpm_conflict_get_package1(), alpm_conflict_get_package2(),
alpm_conflict_get_reason()
- alpm_fileconflict_get_target(), alpm_fileconflict_get_type(),
alpm_fileconflict_get_file(), alpm_fileconflict_get_ctarget()
- alpm_db_get_url()
[CHANGED]
- PM_ prefixes for enum values are now ALPM_
- pm prefixes for structs and enums are now alpm_
- alpm_initialize now has parameters: char *root, char *dbpath,
_alpm_errno_t *err and returns an alpm_handle_t struct.
- alpm_release now takes an alpm_handle_t *.
- alpm_db_register_sync() now requires a extra parameter of a alpm_siglevel_t.
- alpm_pkg_load() now requires an extra parameter of an alpm_siglevel_t
- alpm_db_setserver() replaced by alpm_db_set_servers(), alpm_db_add_server(),
alpm_db_remove_server()
- alpm_trans_init() no longer takes callbacks, set those using
alpm_option_set_*cb() functions
- many functions now require a first parameter of an alpm_handle_t *:
- alpm_option_get_*
- alpm_option_set_*
- alpm_option_add_*
- alpm_option_remove_*
- alpm_trans_*
- alpm_add_pkg
- alpm_checkconflicts
- alpm_checkdeps
- alpm_db_register_sync
- alpm_db_set_pkgreason
- alpm_db_unregister_all
- alpm_fetch_pkgurl
- alpm_find_dbs_satisfier
- alpm_logaction
- alpm_pkg_load
- alpm_release
- alpm_remove_pkg
- alpm_sync_sysupgrade
- several structs are no longer opaque
- alpm_conflict_t
- alpm_delta_t
- alpm_depend_t
- alpm_depmissing_t
- alpm_depmod_t
- alpm_fileconflict_t
- alpm_group_t
- alpm_pkg_reason_t
[ADDED]
- option functions:
alpm_{get,set}_eventcb(), alpm_option_{get,set}_convcb(),
alpm_option_{get,set}_progresscb()
- package signing functions:
alpm_option_get_default_siglevel(), alpm_option_set_default_siglevel(),
alpm_option_get_gpgdir(), alpm_option_set_gpgdir(), alpm_db_get_siglevel(),
alpm_siglist_cleanup(), alpm_db_check_pgp_signature(), alpm_pkg_check_pgp_signature(),
alpm_pkg_get_origin(), alpm_pkg_get_sha256sum(), alpm_pkg_get_base64_sig()
- list functions:
alpm_list_to_array(), alpm_list_previous()
- structs:
alpm_backup_t, alpm_file_t, alpm_filelist_t
- enums:
alpm_siglevel_t, alpm_sigstatus_t, alpm_sigvalidity_t, alpm_pkgfrom_t
- error codes:
ALPM_ERR_DB_INVALID, ALPM_ERR_DB_INVALID_SIG, ALPM_ERR_GPGME,
ALPM_ERR_PKG_INVALID_CHECKSUM, ALPM_ERR_PKG_INVALID_SIG, ALPM_ERR_SIG_INVALID,
ALPM_ERR_SIG_MISSING

View File

@@ -1,14 +1,13 @@
Thanks to all of those who have helped translate pacman, both in the past
and currently. Here are some of the current translators (past translators
can be found by looking in the GIT history).
Thanks to all of those who have helped translate pacman, both in the past and
currently. Our translations are currently maintained in Transifex; please read
doc/translation-help.txt for more details.
If your language is listed here and you are interested in helping translate,
contact either the pacman mailing list at pacman-dev@archlinux.org, or one
of the translators listed above.
Below is a list of past translators before we switched to Transifex; more can
be found by looking in the GIT history.
If your language is not listed here and you wish it was, let the pacman mailing
list know you are interested in making a translation. We will be happy to add
your language to the mix.
If your language is not already in the various po/ subdirectories and you wish
it was, set up a team in Transifex for your language and we will be happy to
add your language to the mix.
Catalan (ca):
Manuel Tortosa <manutortosa@chakra-project.org>

View File

@@ -42,12 +42,12 @@ AC_PREREQ(2.62)
# pacman_version_micro += 1
m4_define([lib_current], [7])
m4_define([lib_revision], [0])
m4_define([lib_revision], [1])
m4_define([lib_age], [0])
m4_define([pacman_version_major], [4])
m4_define([pacman_version_minor], [0])
m4_define([pacman_version_micro], [0rc1])
m4_define([pacman_version_micro], [1])
m4_define([pacman_version],
[pacman_version_major.pacman_version_minor.pacman_version_micro])
@@ -125,10 +125,12 @@ AC_ARG_ENABLE(git-version,
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC_C99
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_RANLIB
AC_CHECK_PROGS([PYTHON], [python2.7 python2.6 python2.5 python2 python], [false])
AC_PATH_PROGS([BASH_SHELL], [bash bash4 bash3], [false])
@@ -170,17 +172,19 @@ AS_IF([test "x$with_gpgme" != "xno"],
AM_CONDITIONAL([HAVE_LIBGPGME], [test "x$with_gpgme" = "xyes"])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h glob.h libintl.h locale.h mntent.h string.h \
sys/ioctl.h sys/mount.h sys/param.h sys/statvfs.h \
sys/time.h sys/types.h sys/ucred.h syslog.h termios.h \
wchar.h])
AC_CHECK_HEADERS([fcntl.h float.h glob.h libintl.h limits.h locale.h \
mntent.h stddef.h string.h sys/ioctl.h sys/mount.h \
sys/param.h sys/statvfs.h sys/time.h sys/types.h \
sys/ucred.h syslog.h termios.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT64_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_STRUCT_TM
AC_TYPE_UID_T
AC_STRUCT_DIRENT_D_TYPE
@@ -190,10 +194,14 @@ PATH_MAX_DEFINED
AC_FUNC_FORK
AC_FUNC_GETMNTENT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_CHECK_FUNCS([geteuid getmntinfo realpath regcomp strcasecmp \
strndup strrchr strsep swprintf tcflush \
wcwidth uname])
AC_FUNC_STRCOLL
AC_CHECK_FUNCS([dup2 getcwd geteuid getmntinfo gettimeofday memmove memset \
mkdir realpath regcomp rmdir setenv setlocale strcasecmp \
strchr strcspn strdup strerror strndup strrchr strsep strstr \
strtol swprintf tcflush wcwidth uname])
# For the diskspace code
FS_STATS_TYPE
AC_CHECK_MEMBERS([struct statvfs.f_flag],,,[[#include <sys/statvfs.h>]])
@@ -217,7 +225,7 @@ STRIP_STATIC="--strip-debug"
case "${host_os}" in
*bsd*)
SIZECMD="stat -L -f %z"
SEDINPLACE="sed -i ''"
SEDINPLACE="sed -i \"\""
;;
cygwin*)
host_os_cygwin=yes

View File

@@ -36,7 +36,7 @@ edit = sed \
$(OURSCRIPTS): Makefile
@echo ' ' GEN $@;
@rm -f $@ $@.tmp
@$(RM) $@ $@.tmp
@$(edit) $(srcdir)/$@.in >$@.tmp
@chmod +x $@.tmp
@chmod a-w $@.tmp
@@ -44,7 +44,7 @@ $(OURSCRIPTS): Makefile
$(OURFILES): Makefile
@echo ' ' GEN $@;
@rm -f $@ $@.tmp
@$(RM) $@ $@.tmp
@$(edit) $(srcdir)/$@.in >$@.tmp
@chmod a-w $@.tmp
@mv $@.tmp $@

View File

@@ -220,6 +220,9 @@ hi def link pb_k_pkgrel pbKeywords
hi def link pbIllegalPkgdesc Error
hi def link pb_k_desc pbKeywords
hi def link pbIllegalEpoch Error
hi def link pb_k_epoch pbKeywords
hi def link pbIllegalUrl Error
hi def link pb_k_url pbKeywords

View File

@@ -20,69 +20,72 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
shopt -s extglob
shopt -s nullglob
readonly progname="bacman"
readonly progver="0.2.1"
#
# 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"
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
if (( $# != 1 )); then
usage
exit 1
fi
if [ "$1" = "--help" -o "$1" = "-h" ] ; then
usage
exit 0
if [[ $1 == "--help" || $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
if [[ $1 == "--version" || $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
if (( EUID )); then
if [[ -f /usr/bin/fakeroot ]]; then
echo "Entering fakeroot environment"
export INFAKEROOT="1"
/usr/bin/fakeroot -u -- "$0" "$@"
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 @sysconfdir@/pacman.conf ]; then
echo "ERROR: unable to read @sysconfdir@/pacman.conf"
exit 1
if [[ ! -r @sysconfdir@/pacman.conf ]]; then
echo "ERROR: unable to read @sysconfdir@/pacman.conf"
exit 1
fi
eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)
pac_db="${DBPath:-@localstatedir@/lib/pacman/}/local"
if [ ! -r @sysconfdir@/makepkg.conf ]; then
echo "ERROR: unable to read @sysconfdir@/makepkg.conf"
exit 1
if [[ ! -r @sysconfdir@/makepkg.conf ]]; then
echo "ERROR: unable to read @sysconfdir@/makepkg.conf"
exit 1
fi
source "@sysconfdir@/makepkg.conf"
if [ -r ~/.makepkg.conf ]; then
source ~/.makepkg.conf
if [[ -r ~/.makepkg.conf ]]; then
source ~/.makepkg.conf
fi
pkg_arch=${CARCH:-'unknown'}
@@ -90,27 +93,35 @@ pkg_dest="${PKGDEST:-$PWD}"
pkg_pkger=${PACKAGER:-'Unknown Packager'}
pkg_name="$1"
pkg_dir="$(echo $pac_db/$pkg_name-[0-9]*)"
pkg_namver="${pkg_dir##*/}"
pkg_dir=("$pac_db/$pkg_name"-+([^-])-+([^-]))
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
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
if (( ${#pkg_dir[@]} != 1 )); then
printf "ERROR: %d entries for package %s found in pacman database\n" \
${#pkg_dir[@]} "${pkg_name}"
printf "%s\n" "${pkg_dir[@]}"
exit 1
fi
if [[ ! -d $pkg_dir ]]; then
printf "ERROR: package %s is found in pacman database,\n" "${pkg_name}"
printf " but \`%s' is not a directory\n" "${pkg_dir}"
exit 1
fi
#
# Begin
#
echo Package: ${pkg_namver}
work_dir=$(mktemp -d -p /tmp)
echo "Package: ${pkg_namver}"
work_dir=$(mktemp -d --tmpdir bacman.XXXXXXXXXX)
cd "$work_dir" || exit 1
#
@@ -120,136 +131,135 @@ echo "Copying package files..."
cat "$pkg_dir"/files |
while read i; do
if [ -z "$i" ] ; then
continue
fi
if [[ -z $i ]]; then
continue
fi
if [[ "$i" =~ %[A-Z]*% ]] ; then
current=$i
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 -
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" -a ! -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
# 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
if (( ret )); then
rm -rf "$work_dir"
exit 1
fi
pkg_size=$(du -sk | awk '{print $1 * 1024}')
#
# .PKGINFO stuff
# TODO adopt makepkg's write_pkginfo() into this or scripts/library
#
echo Generating .PKGINFO metadata...
echo "# Generated by $progname $progver" > .PKGINFO
if [ "$INFAKEROOT" = "1" ]; then
echo "# Using $(fakeroot -v)" >> .PKGINFO
if [[ $INFAKEROOT == "1" ]]; then
echo "# Using $(fakeroot -v)" >> .PKGINFO
fi
echo "# $(LC_ALL=C date)" >> .PKGINFO
echo "#" >> .PKGINFO
cat "$pkg_dir"/{desc,files} |
while read i; do
if [[ -z "$i" ]]; then
continue;
fi
if [[ -z $i ]]; then
continue;
fi
if [[ "$i" =~ %[A-Z]*% ]] ; then
current=$i
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
;;
%DEPENDS%)
echo "depend = $i" >> .PKGINFO
;;
%OPTDEPENDS%)
echo "optdepend = $i" >> .PKGINFO
;;
%CONFLICTS%)
echo "conflict = $i" >> .PKGINFO
;;
%PROVIDES%)
echo "provides = $i" >> .PKGINFO
;;
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
;;
%DEPENDS%)
echo "depend = $i" >> .PKGINFO
;;
%OPTDEPENDS%)
echo "optdepend = $i" >> .PKGINFO
;;
%CONFLICTS%)
echo "conflict = $i" >> .PKGINFO
;;
%PROVIDES%)
echo "provides = $i" >> .PKGINFO
;;
# files
%BACKUP%)
# strip the md5sum after the tab
echo "backup = ${i%%$'\t'*}" >> .PKGINFO
;;
esac
# files
%BACKUP%)
# strip the md5sum after the tab
echo "backup = ${i%%$'\t'*}" >> .PKGINFO
;;
esac
done
comp_files=".PKGINFO"
if [ -f "$pkg_dir/install" ] ; then
cp "$pkg_dir/install" "$work_dir/.INSTALL"
comp_files+=" .INSTALL"
if [[ -f $pkg_dir/install ]]; then
cp "$pkg_dir/install" "$work_dir/.INSTALL"
comp_files+=" .INSTALL"
fi
if [ -f $pkg_dir/changelog ] ; then
cp "$pkg_dir/changelog" "$work_dir/.CHANGELOG"
comp_files+=" .CHANGELOG"
if [[ -f $pkg_dir/changelog ]]; then
cp "$pkg_dir/changelog" "$work_dir/.CHANGELOG"
comp_files+=" .CHANGELOG"
fi
#
@@ -263,36 +273,27 @@ chmod 644 "$work_dir"/{.PKGINFO,.CHANGELOG,.INSTALL} 2> /dev/null
#
echo "Generating the package..."
case "$PKGEXT" in
*tar.gz) EXT=${PKGEXT%.gz} ;;
*tar.bz2) EXT=${PKGEXT%.bz2} ;;
*tar.xz) EXT=${PKGEXT%.xz} ;;
*tar) EXT=${PKGEXT} ;;
*) echo "WARNING: '%s' is not a valid archive extension." \
"$PKGEXT" ; EXT=$PKGEXT ;;
esac
pkg_file="$pkg_dest/$pkg_namver-$pkg_arch${PKGEXT}"
ret=0
# when fileglobbing, we want * in an empty directory to expand to
# the null string rather than itself
shopt -s nullglob
# TODO: Maybe this can be set globally for robustness
shopt -s -o pipefail
bsdtar -cf - $comp_files * |
case "$PKGEXT" in
*tar.gz) gzip -c -f -n ;;
*tar.bz2) bzip2 -c -f ;;
*tar.xz) xz -c -z - ;;
*tar) cat ;;
esac > ${pkg_file} || ret=$?
*tar.gz) gzip -c -f -n ;;
*tar.bz2) bzip2 -c -f ;;
*tar.xz) xz -c -z - ;;
*tar.Z) compress -c -f ;;
*tar) cat ;;
*) echo "WARNING: '%s' is not a valid archive extension." \
"$PKGEXT" >&2; cat ;;
esac > "${pkg_file}"; 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
if (( ret )); 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"

View File

@@ -27,6 +27,21 @@ _arch_incomp() {
local r="\s-(-${1#* }\s|\w*${1% *})"; [[ $COMP_LINE =~ $r ]]
}
_pacman_key() {
local cur opts prev
COMPREPLY=()
_get_comp_words_by_ref cur prev
if [[ $cur = -* &&
$prev != -@(a|-add|c|-config|g|-gpgdir|h|-help|import?(-trustdb)) ]]; then
opts=('add delete export finger help list-keys recv-keys updatedb verify version
config edit-key gpgdir import import-trustdb init keyserver list-sigs
lsign-key populate refresh-keys'
'a d e f h l r u v V')
_arch_ptr2comp opts
fi
true
}
_makepkg() {
local cur opts prev
COMPREPLY=()
@@ -35,7 +50,7 @@ _makepkg() {
opts=('allsource asroot check clean config force geninteg help holdver ignorearch
install log nobuild nocheck nocolor noconfirm nodeps noextract noprogressbar
nosign pkg repackage rmdeps sign skipinteg source syncdeps'
'A L R c d e f g h i m o p r s')
'A L R S c d e f g h i m o p r s')
_arch_ptr2comp opts
fi
true
@@ -59,7 +74,7 @@ _pacman() {
query=('changelog check deps explicit file foreign groups info list owns
search unrequired upgrades' 'c e g i k l m o p s t u')
remove=('cascade dbonly nodeps nosave print recursive unneeded' 'c n p s u')
sync=('asdeps asexplicit clean downloadonly force groups ignore ignoregroup
sync=('asdeps asexplicit clean dbonly downloadonly force groups ignore ignoregroup
info list needed nodeps print refresh recursive search sysupgrade'
'c f g i l p s u w y')
upgrade=('asdeps asexplicit force needed nodeps print recursive' 'f p')
@@ -109,5 +124,6 @@ else
fi
complete -F _makepkg -o default makepkg
complete -F _pacman_key -o default pacman-key
# ex:et ts=2 sw=2 ft=sh

View File

@@ -21,8 +21,8 @@
shopt -s extglob
declare -a candidates=() cmdopts=() whitelist=() blacklist=()
declare -i delete=0 dryrun=0 filecount=0 keep=3 move=0 totalsaved=0
declare cachedir=@localstatedir@/cache/pacman/pkg delim=$'\n' movedir= scanarch=
declare -i delete=0 dryrun=0 filecount=0 move=0 needsroot=0 totalsaved=0 verbose=0
declare cachedir=@localstatedir@/cache/pacman/pkg delim=$'\n' keep=3 movedir= scanarch=
msg() {
local mesg=$1; shift
@@ -95,10 +95,8 @@ pkgfilter() {
# enforce architecture match if specified
if (!scanarch || scanarch == idx[2]) {
count = split(packages[idx[1], idx[2]], pkgs, SUBSEP)
if (count > keep) {
for(i = 1; i <= count - keep; i++) {
print pkgs[i]
}
for(i = 1; i <= count - keep; i++) {
print pkgs[i]
}
}
}
@@ -121,7 +119,7 @@ size_to_human() {
}
sizestr = sprintf("%.2f", size)
sub(/.?0+$/, "", sizestr)
sub(/\.?0+$/, "", sizestr)
printf("%s %s", sizestr, suffix[count])
}'
}
@@ -155,7 +153,8 @@ summarize() {
while read -r pkg; do
if (( verbose >= 3 )); then
[[ $pkg =~ $pkg_re ]] && name=${BASH_REMATCH[1]} arch=${BASH_REMATCH[2]}
if [[ -z $seen || $seenarch != $arch || $seen != $name ]]; then
if [[ -z $seen || $seenarch != "$arch" || $seen != "$name" ]]; then
seen=$name seenarch=$arch
printf '%s (%s):\n' "$name" "$arch"
fi
printf ' %s\n' "$pkg"
@@ -222,8 +221,10 @@ while getopts ':a:c:dfhi:k:m:rsuvz' opt; do
blacklist+=("${ign[@]}")
unset i ign ;;
k) keep=$OPTARG
if [[ $keep != $OPTARG ]] || (( keep < 0 )); then
if [[ -z $keep || -n ${keep//[0-9]/} ]]; then
die 'argument to option -k must be a non-negative integer'
else
keep=$(( 10#$keep ))
fi ;;
m) move=1 movedir=$OPTARG ;;
r) delete=1 ;;
@@ -298,3 +299,5 @@ elif (( move )); then
fi
summarize "$pkgcount" "${candidates[@]}"
# vim: set ts=2 sw=2 noet:

View File

@@ -116,12 +116,12 @@ _pacman_action_none() {
_pacman_action_query() {
local context state line
typeset -A opt_args
# _arguments -s : \
# "$_pacman_opts_common[@]" \
# "$_pacman_opts_query_actions[@]" \
# "$_pacman_opts_query_modifiers[@]"
case $state in
query_file)
_arguments -s : \
@@ -168,12 +168,12 @@ _pacman_action_remove() {
_pacman_action_sync() {
local context state line
typeset -A opt_args
# _arguments -s : \
# "$_pacman_opts_common[@]" \
# "$_pacman_opts_sync_actions[@]" #\
# #"$_pacman_opts_sync_modifiers[@]"
case $state in
sync_clean)
_arguments -s : \

4
doc/.gitignore vendored
View File

@@ -9,7 +9,9 @@ pkgdelta.8
repo-add.8
repo-remove.8
vercmp.8
*.css
asciidoc-manpage.css
asciidoc.css
asciidoc.js
*.html
*.xml
man3

View File

@@ -1,11 +1,13 @@
# Doxyfile 1.5.5
# Doxyfile 1.7.5.1
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = libalpm
PROJECT_NUMBER =
PROJECT_NUMBER =
PROJECT_BRIEF = "Arch Linux Package Manager Library"
PROJECT_LOGO =
OUTPUT_DIRECTORY = ./
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
@@ -25,27 +27,31 @@ ABBREVIATE_BRIEF = "The $name class" \
ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES =
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING =
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -63,20 +69,27 @@ INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -86,25 +99,26 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../lib/libalpm/
INPUT_ENCODING = UTF-8
FILE_PATTERNS =
FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE =
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
@@ -121,31 +135,58 @@ VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = NO
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
HHC_LOCATION =
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
USE_INLINE_TREES = NO
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
MATHJAX_EXTENSIONS =
SEARCHENGINE = NO
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
@@ -154,13 +195,16 @@ LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PAPER_TYPE = letter
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -168,8 +212,8 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
@@ -182,8 +226,8 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@@ -195,9 +239,9 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
@@ -207,24 +251,31 @@ INCLUDE_PATH = ../..
INCLUDE_FILE_PATTERNS = *.h
PREDEFINED = HAVE_CONFIG_H= \
SYMHIDDEN= \
SYMEXPORT=
EXPAND_AS_DEFINED =
SYMEXPORT= \
HAVE_LIBARCHIVE \
HAVE_LIBCURL \
HAVE_LIBGPGME
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
MSCGEN_PATH =
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
@@ -237,15 +288,13 @@ CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
INTERACTIVE_SVG = NO
DOT_PATH =
DOTFILE_DIRS =
MSCFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 3
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO

View File

@@ -41,6 +41,7 @@ HTML_DOCS = \
EXTRA_DIST = \
asciidoc.conf \
asciidoc-override.css \
pacman.8.txt \
makepkg.8.txt \
repo-add.8.txt \
@@ -76,7 +77,7 @@ REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
endif
man_MANS =
dist_man_MANS = $(ASCIIDOC_MANS) repo-remove.8
dist_man_MANS = $(ASCIIDOC_MANS)
if USE_DOXYGEN
man_MANS += $(DOXYGEN_MANS)
@@ -91,8 +92,9 @@ html: $(HTML_DOCS)
website: html
bsdtar czf website.tar.gz $(HTML_DOCS) \
asciidoc-override.css \
-C /etc/asciidoc/stylesheets/ \
asciidoc.css asciidoc-manpage.css \
asciidoc.css \
-C /etc/asciidoc/javascripts/ \
asciidoc.js \
-C /etc/asciidoc/ \
@@ -116,7 +118,7 @@ A2X_OPTS = \
--destination-dir='./'
# These rules are due to the includes and files of the asciidoc text
$(ASCIIDOC_MANS): asciidoc.conf footer.txt
$(ASCIIDOC_MANS): asciidoc.conf footer.txt Makefile
a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS) --out-file=./$@.xml" $(srcdir)/$@.txt
%.html: %.txt
@@ -128,9 +130,9 @@ HACKING.html: ../HACKING
dos2unix $@
# Customizations for certain HTML docs
$(HTML_MANPAGES): asciidoc.conf footer.txt
$(HTML_OTHER): asciidoc.conf
%.html: ASCIIDOC_OPTS += -a linkcss -a toc -a icons
$(HTML_MANPAGES): asciidoc.conf footer.txt Makefile
$(HTML_OTHER): asciidoc.conf Makefile
%.html: ASCIIDOC_OPTS += -a linkcss -a toc -a icons -a max-width=960px -a stylesheet=asciidoc-override.css
%.8.html: ASCIIDOC_OPTS += -d manpage
%.5.html: ASCIIDOC_OPTS += -d manpage
%.3.html: ASCIIDOC_OPTS += -d manpage
@@ -148,7 +150,17 @@ pacman.conf.5 pacman.conf.5.html: pacman.conf.5.txt
libalpm.3 libalpm.3.html: libalpm.3.txt
# this one is just a symlink
repo-remove.8: repo-add.8
rm -f repo-remove.8
$(RM) repo-remove.8
$(LN_S) repo-add.8 repo-remove.8
install-data-hook:
cd $(DESTDIR)$(mandir)/man8 && \
$(RM) repo-remove.8 && \
( $(LN_S) repo-add.8 repo-remove.8 || \
ln repo-add.8 repo-remove.8 || \
cp repo-add.8 repo-remove.8 )
uninstall-hook:
$(RM) $(DESTDIR)$(mandir)/man8/repo-remove.8
# vim:set ts=2 sw=2 noet:

View File

@@ -87,7 +87,7 @@ similar to `$_basekernver`.
Specifies a special install script that is to be included in the package.
This file should reside in the same directory as the PKGBUILD, and will
be copied into the package by makepkg. It does not need to be included
in the source array (e.g., `install=pkgname.install`).
in the source array (e.g., `install=$pkgname.install`).
*changelog*::
Specifies a changelog file that is to be included in the package.
@@ -107,6 +107,10 @@ similar to `$_basekernver`.
It is also possible to change the name of the downloaded file, which is helpful
with weird URLs and for handling multiple source files with the same
name. The syntax is: `source=('filename::url')`.
+
Files in the source array with extensions `.sig`, `.sign` or `.asc` are recognized by
makepkg as PGP signatures and will be automatically used to verify the integrity
of the corresponding source file.
*noextract (array)*::
An array of filenames corresponding to those from the source array. Files
@@ -117,7 +121,7 @@ name. The syntax is: `source=('filename::url')`.
This array contains an MD5 hash for every source file specified in the
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
`makepkg -g >> PKGBUILD`. If desired, move the md5sums line to an
appropriate location.
*sha1sums, sha256sums, sha384sums, sha512sums (arrays)*::
@@ -134,7 +138,7 @@ name. The syntax is: `source=('filename::url')`.
*arch (array)*::
Defines on which architectures the given package is available (e.g.,
`arch=('i686' 'x86_64')`). Packages that contain no architecture specific
files should use arch=('any').
files should use `arch=('any')`.
*backup (array)*::
An array of filenames, without preceding slashes, that
@@ -146,9 +150,9 @@ name. The syntax is: `source=('filename::url')`.
An array of packages this package depends on to run. Entries in
this list should be surrounded with single quotes and contain at least
the package name. Entries can also include a version requirement of the
form 'name<>version', where <> is one of five comparisons: >= (greater
than or equal to), <= (less than or equal to), = (equal to), > (greater
than), or < (less than).
form 'name<>version', where `<>` is one of five comparisons: `>=` (greater
than or equal to), `<=` (less than or equal to), `=` (equal to), `>`
(greater than), or `<` (less than).
+
If the dependency name appears to be a library (ends with .so), makepkg will
try to find a binary that depends on the library in the built package and
@@ -178,18 +182,19 @@ disables auto detection.
*conflicts (array)*::
An array of packages that will conflict with this package (i.e. they
cannot both be installed at the same time). This directive follows the
same format as depends. Versioned conflicts are also supported.
same format as depends. Versioned conflicts are supported using the
operators as described in `depends`.
*provides (array)*::
An array of ``virtual provisions'' this package provides. This allows
a package to provide dependencies other than its own package name. For
example, the dcron package can provide 'cron', which allows packages to
depend on 'cron' rather than 'dcron OR fcron'.
Versioned provisions are also possible, in the 'name=version' format.
For example, dcron can provide 'cron=2.0' to satisfy the 'cron>=2.0'
dependency of other packages. Provisions involving the '>' and '<'
operators are invalid as only specific versions of a package may be
provided.
+
Versioned provisions are also possible, in the 'name=version' format. For
example, dcron can provide 'cron=2.0' to satisfy the 'cron>=2.0' dependency of
other packages. Provisions involving the `>` and `<` operators are invalid as
only specific versions of a package may be provided.
+
If the provision name appears to be a library (ends with .so), makepkg will
try to find the library in the built package and append the correct
@@ -199,9 +204,11 @@ version. Appending the version yourself disables auto detection.
An array of packages this package should replace. This can be used
to handle renamed/combined packages. For example, if the 'j2re' package
is renamed to 'jre', this directive allows future upgrades to continue
as expected even though the package has moved. Sysupgrade is currently
the only pacman operation that utilizes this field, a normal sync will
not use its value.
as expected even though the package has moved. Versioned replaces are
supported using the operators as described in `depends`.
+
Sysupgrade is currently the only pacman operation that utilizes this field.
A normal sync or upgrade will not use its value.
*options (array)*::
This array allows you to override some of makepkg's default behavior
@@ -273,6 +280,7 @@ variables for use during the build and install process:
*startdir*::
This contains the absolute path to the directory where the PKGBUILD is
located, which is usually the output of `$(pwd)` when makepkg is started.
Use of this variable is deprecated and strongly discouraged.
*srcdir*::
This contains the directory where makepkg extracts, or copies, all source

View File

@@ -0,0 +1,7 @@
table th, table td {
padding: 0.2em 1em;
}
table td p.table {
margin: 0;
}

View File

@@ -20,12 +20,15 @@ Current maintainers:
* Allan McRae <allan@archlinux.org>
* Dan McGee <dan@archlinux.org>
* Xavier Chantry <shiningxc@gmail.com>
* Dave Reisner <dreisner@archlinux.org>
Past contributors:
Past major contributors:
* Judd Vinet <jvinet@zeroflux.org>
* Aurelien Foret <aurelien@archlinux.org>
* Aaron Griffin <aaron@archlinux.org>
* Xavier Chantry <shiningxc@gmail.com>
* Nagy Gabor <ngaba@bibl.u-szeged.hu>
See the 'AUTHORS' file for additional contributors.
For additional contributors, use `git shortlog -s` on the pacman.git
repository.

View File

@@ -16,10 +16,10 @@ automatically and can download packages from a remote server.
History
~~~~~~~
Version 2.0 of pacman introduced the ability to sync packages (the `--sync`
Version 2.0 of pacman introduced the ability to sync packages (the '\--sync'
option) with a master server through the use of package databases. Prior to
this, packages would have to be installed manually using the `--add` and
`--upgrade` operations.
this, packages would have to be installed manually using the '\--add' and
'\--upgrade' operations.
Version 3.0 was the switch to a two-part pacman- a backend named libalpm
(library for Arch Linux Package Management), and the familiar pacman frontend.
@@ -28,6 +28,9 @@ being able to handle a much wider variety of cases. The switch to a
library-based program should also make it easier in the future to develop
alternative front ends.
Version 4.0 added package signing and verification capabilities to the entire
makepkg/repo-add/pacman toolchain via GNUPG and GPGME.
Documentation
-------------
@@ -62,47 +65,97 @@ contain the biggest changes in a format more concise than the commit log.
Releases
--------
`------------`-------
Date Version
---------------------
2011-08-10 v3.5.4
2011-06-07 v3.5.3
2011-04-18 v3.5.2
2011-03-23 v3.5.1
2011-03-16 v3.5.0
2011-01-22 v3.4.3
2010-12-29 v3.4.2
2010-09-03 v3.4.1
2010-06-16 v3.4.0
2009-11-10 v3.3.3
2009-10-05 v3.3.2
2009-09-22 v3.3.1
2009-08-02 v3.3.0
2009-01-05 v3.2.2
2008-08-26 v3.2.1
2008-07-30 v3.2.0
2008-04-01 v3.1.4
2008-03-06 v3.1.3
2008-02-20 v3.1.2
2008-01-20 v3.1.1
2008-01-09 v3.1.0
2007-09-16 v3.0.6
2007-06-17 v3.0.5
2007-05-08 v3.0.4
2007-04-28 v3.0.3
2007-04-23 v3.0.2
2007-04-04 v3.0.1
2007-03-25 v3.0.0
2006-02-02 v2.9.8
2005-09-16 v2.9.7
2005-06-10 v2.9.6
2005-01-11 v2.9.5
2004-12-19 v2.9.4
2004-12-18 v2.9.3
2004-09-25 v2.9.2
2004-09-24 v2.9.1
2004-09-18 v2.9
---------------------
[frame="none",grid="none",options="autowidth",cols="3*a"]
|======
|
[frame="topbot",grid="none",options="header,autowidth"]
!======
!Version !Date
!4.0.0 !2011-09-13
!4.0.0rc2 !2011-09-22
!4.0.0rc1 !2011-08-11
!3.5.4 !2011-08-10
!3.5.3 !2011-06-07
!3.5.2 !2011-04-18
!3.5.1 !2011-03-23
!3.5.0 !2011-03-16
!3.4.3 !2011-01-22
!3.4.2 !2010-12-29
!3.4.1 !2010-09-03
!3.4.0 !2010-06-16
!3.3.3 !2009-11-10
!3.3.2 !2009-10-05
!3.3.1 !2009-09-22
!3.3.0 !2009-08-02
!3.2.2 !2009-01-05
!3.2.1 !2008-08-26
!3.2.0 !2008-07-30
!3.1.4 !2008-04-01
!3.1.3 !2008-03-06
!3.1.2 !2008-02-20
!3.1.1 !2008-01-20
!3.1.0 !2008-01-09
!======
|
[frame="topbot",grid="none",options="header,autowidth"]
!======
!Version !Date
!2.9.8 !2006-02-02
!2.9.7 !2005-09-16
!2.9.7-TEST3 !2005-09-11
!2.9.7-TEST2 !2005-09-07
!2.9.7-TEST !2005-08-19
!2.9.6 !2005-06-10
!2.9.5 !2005-01-11
!2.9.4 !2004-12-20
!2.9.3 !2004-12-19
!2.9.2 !2004-09-25
!2.9.1 !2004-09-25
!2.9 !2004-09-18
!2.8.4 !2004-08-23
!2.8.3 !2004-08-04
!2.8.2 !2004-07-22
!2.8.1 !2004-07-17
!2.8 !2004-07-03
!2.7.9 !2004-04-30
!2.7.8 !2004-04-29
!2.7.7 !2004-04-15
!2.7.6 !2004-04-04
!2.7.5 !2004-03-02
!2.7.4 !2004-02-18
!2.7.3 !2004-02-07
!======
|
[frame="topbot",grid="none",options="header,autowidth"]
!======
!Version !Date
!2.7.2 !2004-01-04
!2.7.1 !2003-12-21
!2.7 !2003-11-25
!2.6.4 !2003-10-17
!2.6.3 !2003-10-01
!2.6.2 !2003-09-29
!2.6.1 !2003-09-15
!2.6 !2003-09-03
!2.5.1 !2003-07-12
!2.5 !2003-05-30
!2.4.1 !2003-04-19
!2.4 !2003-04-11
!2.3.2 !2003-03-17
!2.3.1 !2003-03-14
!2.3 !2003-02-27
!2.2 !2002-12-11
!2.1 !2002-09-16
!2.0 !2002-08-09
!1.23 !2002-04-30
!1.22 !2002-04-12
!1.21 !2002-04-03
!1.2 !2002-03-18
!1.1 !2002-03-10
!1.0 !2002-02-25
!======
|======
Source code for all releases is available at
link:ftp://ftp.archlinux.org/other/pacman/[]. To install, download the newest

View File

@@ -117,7 +117,7 @@ Options
*-o, \--nobuild*::
Download and extract files only, but do not build them. Useful with the
`\--noextract` option if you wish to tweak the files in src/ before
'\--noextract' option if you wish to tweak the files in src/ before
building.
*-p* <buildscript>::
@@ -138,6 +138,13 @@ Options
dependencies are not found, pacman will try to resolve them. If
successful, the missing packages will be downloaded and installed.
*-S, \--source*::
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. Because integrity checks are verified,
all source files of the package need to be present or downloadable.
*\--allsource*::
Do not actually build the package, but build a source-only tarball that
includes all sources, including those that are normally download via
@@ -145,13 +152,6 @@ Options
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 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. Because integrity checks are verified,
all source files of the package need to be present or downloadable.
*\--pkg <list>*::
Only build listed packages from a split package.

View File

@@ -96,7 +96,7 @@ Options
*check*;;
Run the check() function if present in the PKGBUILD. This can be
enabled or disabled for individual packages through the use of
makepkg's `--check` and `--nocheck` options respectively.
makepkg's '\--check' and '\--nocheck' options respectively.
*sign*;;
Generate a PGP signature file using GnuPG. This will execute `gpg
@@ -120,7 +120,7 @@ Options
**GPGKEY=**""::
Specify a key to use for gpg signing instead of the default key in the
keyring. Can be overridden with makepkg's `--key` option.
keyring. Can be overridden with makepkg's '\--key' option.
**OPTIONS=(**strip docs libtool emptydirs zipman purge !upx**)**::
This array contains options that affect the default packaging. They are

View File

@@ -23,7 +23,7 @@ provides the ability to import and export keys, fetch keys from keyservers and
update the key trust database.
More complex keyring management can be achieved using GnuPG directly combined with
the `--homedir` option pointing at the pacman keyring (located in
the '\--homedir' option pointing at the pacman keyring (located in
+{sysconfdir}/pacman.d/gnupg+ by default).
@@ -45,9 +45,9 @@ Options
Export key(s) identified by the specified keyid(s) to 'stdout'. If no keyid
is specified, all keys will be exported.
*\--edit-key * <keyid(s)>::
Present a menu for key management task on the specified keyids. Useful for
adjusting a keys trust level.
*\--edit-key* <keyid(s)>::
Present a menu for key management task on the specified keyid(s). Useful
for adjusting a keys trust level.
*-f, \--finger* [keyid(s)]::
List a fingerprint for each specified keyid, or for all known keys if no
@@ -60,39 +60,81 @@ Options
*-h, \--help*::
Output syntax and command line options.
*--import* <dir(s)>::
Adds keys from pubring.gpg into pacman's keyring and imports ownertrust
values from trustdb.gpg in the specified directories.
*\--import* <dir(s)>::
Imports keys from `pubring.gpg` into the public keyring from the specified
directories.
*--import-dirs* <dir(s)> ::
Imports ownertrust values from trustdb.gpg in the specified directories.
*\--import-trustdb* <dir(s)> ::
Imports ownertrust values from `trustdb.gpg` into the shared trust database
from the specified directories.
*--init*::
*\--init*::
Ensure the keyring is properly initialized and has the required access
permissions.
*\--keyserver* <keyserver>::
Use the specified keyserver if the operation requires one. This will take
precedence over any keyserver option specified in a `gpg.conf`
configuration file. Running '\--init' with this option will set the default
keyserver if one was not already configured.
*-l, \--list-keys* [keyid(s)]::
Lists all or specified keys from the public keyring.
*--list-sigs* [keyid(s)]::
Same as --list-keys, but the signatures are listed too.
*\--list-sigs* [keyid(s)]::
Same as '\--list-keys', but the signatures are listed too.
*-r, \--receive* <keyserver> <keyid(s)>::
Fetch the specified keyids from the specified key server URL.
*\--lsign-key* <keyid>::
Locally sign the given key. This is primarily used to root the web of trust
in the local private key generated by '\--init'.
*\--reload*::
Reloads the keys from the keyring package.
*-r, \--recv-keys* <keyid(s)>::
Equivalent to '\--recv-keys' in GnuPG.
*\--refresh-keys* [keyid(s)]::
Equivalent to '\--refresh-keys' in GnuPG.
*\--populate* [keyring(s)]::
Reload the default keys from the (optionally provided) keyrings in
+{pkgdatadir}/keyrings+. For more information, see
<<SC,Providing a Keyring for Import>> below.
*-u, \--updatedb*::
Equivalent to \--check-trustdb in GnuPG.
Equivalent to '\--check-trustdb' in GnuPG.
* -v, \--verify* <signature>::
*-v, \--verify* <signature>::
Verify the given signature file.
*-V, \--version*::
Displays the program version.
Providing a Keyring for Import
------------------------------
A distribution or other repository provided may want to provide a set of
PGP keys used in the signing of its packages and repository databases that can
be readily imported into the pacman keyring. This is achieved by providing a
PGP keyring file `foo.gpg` that contains the keys for the foo keyring in the
directory +{pkgdatadir}/keyrings+.
Optionally, the file `foo-trusted` can be provided containing a list of trusted
key IDs for that keyring. This is a file in a format compatible with 'gpg
\--export-ownertrust' output. This file will inform the user which keys a user
needs to verify and sign to build a local web of trust, in addition to
assigning provided owner trust values.
Also optionally, the file `foo-revoked` can be provided containing a list of
revoked key IDs for that keyring. Revoked is defined as "no longer valid for
any signing", so should be used with prudence. A key being marked as revoked
will be disabled in the keyring and no longer treated as valid, so this always
takes priority over it's trusted state in any other keyring.
All files are required to be signed (detached) by a trusted PGP key that the
user must manually import to the pacman keyring. This prevents a potentially
malicious repository adding keys to the pacman keyring without the users
knowledge.
See Also
--------
linkman:pacman[8], linkman:pacman.conf[5]

View File

@@ -86,7 +86,7 @@ You can also use `pacman -Su` to upgrade all packages that are out of date. See
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
1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
Numeric:
1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
+

View File

@@ -26,7 +26,7 @@ numbers. It outputs values as follows:
Version comparsion operates as follows:
Alphanumeric:
1.0a < 1.0alpha < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0
1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
Numeric:
1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0

View File

@@ -23,7 +23,7 @@ edit = sed \
$(dist_sysconf_DATA): Makefile
@echo ' ' GEN $@;
@rm -f $@ $@.tmp
@$(RM) $@ $@.tmp
@$(edit) `test -f ./$@.in || echo $(srcdir)/`$@.in >$@.tmp
@mv $@.tmp $@

View File

@@ -11,7 +11,7 @@
DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
'rsync::/usr/bin/rsync -z %u %o'
'rsync::/usr/bin/rsync --no-motd -z %u %o'
'scp::/usr/bin/scp -C %u %o')
# Other common tools:

View File

@@ -17,8 +17,8 @@
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 -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto
@@ -29,13 +29,16 @@ Architecture = auto
#NoUpgrade =
#NoExtract =
# Misc options (all disabled by default)
# Misc options
#UseSyslog
#UseDelta
#TotalDownload
#CheckSpace
CheckSpace
#VerbosePkgLists
# PGP signature checking
#SigLevel = Optional
#
# REPOSITORIES
# - can be defined here or included from another file
@@ -60,6 +63,7 @@ Architecture = auto
# servers immediately after the header and they will be used before the
# default mirrors.
#[core]
#SigLevel = Required
#Server = ftp://ftp.example.com/foobar/$repo/os/$arch/
# The file referenced here should contain a list of 'Server = ' lines.
#Include = @sysconfdir@/pacman.d/mirrorlist
@@ -67,5 +71,6 @@ Architecture = auto
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

View File

@@ -51,7 +51,8 @@ libalpm_la_SOURCES = \
if !HAVE_LIBSSL
libalpm_la_SOURCES += \
md5.h md5.c
md5.h md5.c \
sha2.h sha2.c
endif
if HAVE_LIBGPGME

View File

@@ -25,6 +25,7 @@
#include <time.h>
#include <string.h>
#include <limits.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -76,8 +77,8 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
local = _alpm_db_get_pkgfromcache(handle->db_local, pkgname);
if(local) {
const char *localpkgname = alpm_pkg_get_name(local);
const char *localpkgver = alpm_pkg_get_version(local);
const char *localpkgname = local->name;
const char *localpkgver = local->version;
int cmp = _alpm_pkg_compare_versions(pkg, local);
if(cmp == 0) {
@@ -451,50 +452,44 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
size_t pkg_current, size_t pkg_count)
{
int i, ret = 0, errors = 0;
char scriptlet[PATH_MAX];
int is_upgrade = 0;
int is_upgrade;
alpm_pkg_t *oldpkg = NULL;
alpm_db_t *db = handle->db_local;
alpm_trans_t *trans = handle->trans;
const char *pkgfile;
ASSERT(trans != NULL, return -1);
snprintf(scriptlet, PATH_MAX, "%s%s-%s/install",
_alpm_db_path(db), alpm_pkg_get_name(newpkg),
alpm_pkg_get_version(newpkg));
/* see if this is an upgrade. if so, remove the old package first */
alpm_pkg_t *local = _alpm_db_get_pkgfromcache(db, newpkg->name);
if(local) {
is_upgrade = 1;
/* we'll need to save some record for backup checks later */
oldpkg = _alpm_pkg_dup(local);
EVENT(trans, ALPM_TRANS_EVT_UPGRADE_START, newpkg, oldpkg);
_alpm_log(handle, ALPM_LOG_DEBUG, "upgrading package %s-%s\n",
newpkg->name, newpkg->version);
if(_alpm_pkg_dup(local, &oldpkg) == -1) {
ret = -1;
goto cleanup;
}
/* copy over the install reason */
newpkg->reason = alpm_pkg_get_reason(oldpkg);
newpkg->reason = alpm_pkg_get_reason(local);
/* pre_upgrade scriptlet */
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle, newpkg->origin_data.file,
"pre_upgrade", newpkg->version, oldpkg->version);
}
EVENT(handle, ALPM_EVENT_UPGRADE_START, newpkg, local);
} else {
is_upgrade = 0;
EVENT(handle, ALPM_EVENT_ADD_START, newpkg, NULL);
}
EVENT(trans, ALPM_TRANS_EVT_ADD_START, newpkg, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s-%s\n",
newpkg->name, newpkg->version);
pkgfile = newpkg->origin_data.file;
/* pre_install scriptlet */
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle, newpkg->origin_data.file,
"pre_install", newpkg->version, NULL);
}
_alpm_log(handle, ALPM_LOG_DEBUG, "%s package %s-%s\n",
is_upgrade ? "upgrading" : "adding", newpkg->name, newpkg->version);
/* pre_install/pre_upgrade scriptlet */
if(alpm_pkg_has_scriptlet(newpkg) &&
!(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
const char *scriptlet_name = is_upgrade ? "pre_upgrade" : "pre_install";
_alpm_runscriptlet(handle, pkgfile,
scriptlet_name, newpkg->version, NULL, 1);
}
/* we override any pre-set reason if we have alldeps or allexplicit set */
@@ -517,7 +512,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
changelog/install script installation (FS#12263) */
if(_alpm_local_db_prepare(db, newpkg)) {
alpm_logaction(handle, "error: could not create database entry %s-%s\n",
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
newpkg->name, newpkg->version);
handle->pm_errno = ALPM_ERR_DB_WRITE;
ret = -1;
goto cleanup;
@@ -526,8 +521,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
if(!(trans->flags & ALPM_TRANS_FLAG_DBONLY)) {
struct archive *archive;
struct archive_entry *entry;
char cwd[PATH_MAX] = "";
int restore_cwd = 0;
int cwdfd;
_alpm_log(handle, ALPM_LOG_DEBUG, "extracting files\n");
@@ -540,19 +534,20 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
archive_read_support_compression_all(archive);
archive_read_support_format_all(archive);
_alpm_log(handle, ALPM_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) {
_alpm_log(handle, ALPM_LOG_DEBUG, "archive: %s\n", pkgfile);
if(archive_read_open_filename(archive, pkgfile,
ALPM_BUFFER_SIZE) != ARCHIVE_OK) {
handle->pm_errno = ALPM_ERR_PKG_OPEN;
ret = -1;
goto cleanup;
}
/* save the cwd so we can restore it later */
if(getcwd(cwd, PATH_MAX) == NULL) {
do {
cwdfd = open(".", O_RDONLY);
} while(cwdfd == -1 && errno == EINTR);
if(cwdfd < 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not get current working directory\n"));
} else {
restore_cwd = 1;
}
/* libarchive requires this for extracting hard links */
@@ -565,11 +560,11 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
/* call PROGRESS once with 0 percent, as we sort-of skip that here */
if(is_upgrade) {
PROGRESS(trans, ALPM_TRANS_PROGRESS_UPGRADE_START,
alpm_pkg_get_name(newpkg), 0, pkg_count, pkg_current);
PROGRESS(handle, ALPM_PROGRESS_UPGRADE_START,
newpkg->name, 0, pkg_count, pkg_current);
} else {
PROGRESS(trans, ALPM_TRANS_PROGRESS_ADD_START,
alpm_pkg_get_name(newpkg), 0, pkg_count, pkg_current);
PROGRESS(handle, ALPM_PROGRESS_ADD_START,
newpkg->name, 0, pkg_count, pkg_current);
}
for(i = 0; archive_read_next_header(archive, &entry) == ARCHIVE_OK; i++) {
@@ -581,9 +576,6 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
* (missing metadata sizes) */
int64_t pos = archive_position_compressed(archive);
percent = (pos * 100) / newpkg->size;
_alpm_log(handle, ALPM_LOG_DEBUG, "decompression progress: "
"%d%% (%"PRId64" / %jd)\n",
percent, pos, (intmax_t)newpkg->size);
if(percent >= 100) {
percent = 100;
}
@@ -592,13 +584,11 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
}
if(is_upgrade) {
PROGRESS(trans, ALPM_TRANS_PROGRESS_UPGRADE_START,
alpm_pkg_get_name(newpkg), percent, pkg_count,
pkg_current);
PROGRESS(handle, ALPM_PROGRESS_UPGRADE_START,
newpkg->name, percent, pkg_count, pkg_current);
} else {
PROGRESS(trans, ALPM_TRANS_PROGRESS_ADD_START,
alpm_pkg_get_name(newpkg), percent, pkg_count,
pkg_current);
PROGRESS(handle, ALPM_PROGRESS_ADD_START,
newpkg->name, percent, pkg_count, pkg_current);
}
/* extract the next file from the archive */
@@ -607,8 +597,12 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
archive_read_finish(archive);
/* restore the old cwd if we have it */
if(restore_cwd && chdir(cwd) != 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), cwd, strerror(errno));
if(cwdfd >= 0) {
if(fchdir(cwdfd) != 0) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("could not restore working directory (%s)\n"), strerror(errno));
}
close(cwdfd);
}
if(errors) {
@@ -635,9 +629,9 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
if(_alpm_local_db_write(db, newpkg, INFRQ_ALL)) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not update database entry %s-%s\n"),
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
newpkg->name, newpkg->version);
alpm_logaction(handle, "error: could not update database entry %s-%s\n",
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
newpkg->name, newpkg->version);
handle->pm_errno = ALPM_ERR_DB_WRITE;
ret = -1;
goto cleanup;
@@ -645,34 +639,32 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
if(_alpm_db_add_pkgincache(db, newpkg) == -1) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not add entry '%s' in cache\n"),
alpm_pkg_get_name(newpkg));
newpkg->name);
}
if(is_upgrade) {
PROGRESS(trans, ALPM_TRANS_PROGRESS_UPGRADE_START,
alpm_pkg_get_name(newpkg), 100, pkg_count, pkg_current);
PROGRESS(handle, ALPM_PROGRESS_UPGRADE_START,
newpkg->name, 100, pkg_count, pkg_current);
} else {
PROGRESS(trans, ALPM_TRANS_PROGRESS_ADD_START,
alpm_pkg_get_name(newpkg), 100, pkg_count, pkg_current);
PROGRESS(handle, ALPM_PROGRESS_ADD_START,
newpkg->name, 100, pkg_count, pkg_current);
}
/* run the post-install script if it exists */
if(alpm_pkg_has_scriptlet(newpkg)
&& !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
if(is_upgrade) {
_alpm_runscriptlet(handle, scriptlet, "post_upgrade",
alpm_pkg_get_version(newpkg),
oldpkg ? alpm_pkg_get_version(oldpkg) : NULL);
} else {
_alpm_runscriptlet(handle, scriptlet, "post_install",
alpm_pkg_get_version(newpkg), NULL);
}
char *scriptlet = _alpm_local_db_pkgpath(db, newpkg, "install");
const char *scriptlet_name = is_upgrade ? "post_upgrade" : "post_install";
_alpm_runscriptlet(handle, scriptlet, scriptlet_name,
newpkg->version, oldpkg ? oldpkg->version : NULL, 0);
free(scriptlet);
}
if(is_upgrade) {
EVENT(trans, ALPM_TRANS_EVT_UPGRADE_DONE, newpkg, oldpkg);
EVENT(handle, ALPM_EVENT_UPGRADE_DONE, newpkg, oldpkg);
} else {
EVENT(trans, ALPM_TRANS_EVT_ADD_DONE, newpkg, oldpkg);
EVENT(handle, ALPM_EVENT_ADD_DONE, newpkg, oldpkg);
}
cleanup:

View File

@@ -78,11 +78,6 @@ alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath,
bindtextdomain("libalpm", LOCALEDIR);
#endif
#ifdef HAVE_LIBCURL
curl_global_init(CURL_GLOBAL_SSL);
myhandle->curl = curl_easy_init();
#endif
return myhandle;
cleanup:
@@ -96,7 +91,7 @@ cleanup:
/** Release the library. This should be the last alpm call you make.
* After this returns, handle should be considered invalid and cannot be reused
* in any way.
* @param handle the context handle
* @param myhandle the context handle
* @return 0 on success, -1 on error
*/
int SYMEXPORT alpm_release(alpm_handle_t *myhandle)
@@ -133,9 +128,30 @@ int SYMEXPORT alpm_release(alpm_handle_t *myhandle)
* @brief Various libalpm functions
*/
/* Get the version of library */
const char SYMEXPORT *alpm_version(void) {
/** Get the version of library.
* @return the library version, e.g. "6.0.4"
* */
const char SYMEXPORT *alpm_version(void)
{
return LIB_VERSION;
}
/** Get the capabilities of the library.
* @return a bitmask of the capabilities
* */
enum alpm_caps SYMEXPORT alpm_capabilities(void)
{
return 0
#ifdef ENABLE_NLS
| ALPM_CAPABILITY_NLS
#endif
#ifdef HAVE_LIBCURL
| ALPM_CAPABILITY_DOWNLOADER
#endif
#ifdef HAVE_LIBGPGME
| ALPM_CAPABILITY_SIGNATURES
#endif
| 0;
}
/* vim: set ts=2 sw=2 noet: */

View File

@@ -60,6 +60,12 @@ typedef enum _alpm_pkgreason_t {
ALPM_PKG_REASON_DEPEND = 1
} alpm_pkgreason_t;
typedef enum _alpm_pkgfrom_t {
PKG_FROM_FILE = 1,
PKG_FROM_LOCALDB,
PKG_FROM_SYNCDB
} alpm_pkgfrom_t;
/** Types of version constraints in dependency specs. */
typedef enum _alpm_depmod_t {
/** No version constraint */
@@ -111,6 +117,7 @@ typedef enum _alpm_sigstatus_t {
ALPM_SIGSTATUS_KEY_EXPIRED,
ALPM_SIGSTATUS_SIG_EXPIRED,
ALPM_SIGSTATUS_KEY_UNKNOWN,
ALPM_SIGSTATUS_KEY_DISABLED,
ALPM_SIGSTATUS_INVALID
} alpm_sigstatus_t;
@@ -155,7 +162,7 @@ typedef struct _alpm_conflict_t {
unsigned long package2_hash;
char *package1;
char *package2;
char *reason;
alpm_depend_t *reason;
} alpm_conflict_t;
/** File conflict */
@@ -209,16 +216,33 @@ typedef struct _alpm_backup_t {
char *hash;
} alpm_backup_t;
/** Signature result. Contains the number of signatures found and pointers to
* arrays containing key and status info. All contained arrays have size
* #count.*/
typedef struct _alpm_pgpkey_t {
void *data;
char *fingerprint;
char *uid;
char *name;
char *email;
time_t created;
time_t expires;
} alpm_pgpkey_t;
/** Signature result. Contains the key, status, and validity of a given
* signature.
*/
typedef struct _alpm_sigresult_t {
int count;
alpm_sigstatus_t *status;
alpm_sigvalidity_t *validity;
char **uid;
alpm_pgpkey_t key;
alpm_sigstatus_t status;
alpm_sigvalidity_t validity;
} alpm_sigresult_t;
/** Signature list. Contains the number of signatures found and a pointer to an
* array of results. The array is of size count.
*/
typedef struct _alpm_siglist_t {
size_t count;
alpm_sigresult_t *results;
} alpm_siglist_t;
/*
* Logging facilities
*/
@@ -236,6 +260,122 @@ typedef enum _alpm_loglevel_t {
typedef void (*alpm_cb_log)(alpm_loglevel_t, const char *, va_list);
int alpm_logaction(alpm_handle_t *handle, const char *fmt, ...);
/** Events.
* NULL parameters are passed to in all events unless specified otherwise.
*/
typedef enum _alpm_event_t {
/** Dependencies will be computed for a package. */
ALPM_EVENT_CHECKDEPS_START = 1,
/** Dependencies were computed for a package. */
ALPM_EVENT_CHECKDEPS_DONE,
/** File conflicts will be computed for a package. */
ALPM_EVENT_FILECONFLICTS_START,
/** File conflicts were computed for a package. */
ALPM_EVENT_FILECONFLICTS_DONE,
/** Dependencies will be resolved for target package. */
ALPM_EVENT_RESOLVEDEPS_START,
/** Dependencies were resolved for target package. */
ALPM_EVENT_RESOLVEDEPS_DONE,
/** Inter-conflicts will be checked for target package. */
ALPM_EVENT_INTERCONFLICTS_START,
/** Inter-conflicts were checked for target package. */
ALPM_EVENT_INTERCONFLICTS_DONE,
/** Package will be installed.
* A pointer to the target package is passed to the callback.
*/
ALPM_EVENT_ADD_START,
/** Package was installed.
* A pointer to the new package is passed to the callback.
*/
ALPM_EVENT_ADD_DONE,
/** Package will be removed.
* A pointer to the target package is passed to the callback.
*/
ALPM_EVENT_REMOVE_START,
/** Package was removed.
* A pointer to the removed package is passed to the callback.
*/
ALPM_EVENT_REMOVE_DONE,
/** Package will be upgraded.
* A pointer to the upgraded package is passed to the callback.
*/
ALPM_EVENT_UPGRADE_START,
/** Package was upgraded.
* A pointer to the new package, and a pointer to the old package is passed
* to the callback, respectively.
*/
ALPM_EVENT_UPGRADE_DONE,
/** Target package's integrity will be checked. */
ALPM_EVENT_INTEGRITY_START,
/** Target package's integrity was checked. */
ALPM_EVENT_INTEGRITY_DONE,
/** Target package will be loaded. */
ALPM_EVENT_LOAD_START,
/** Target package is finished loading. */
ALPM_EVENT_LOAD_DONE,
/** Target deltas's integrity will be checked. */
ALPM_EVENT_DELTA_INTEGRITY_START,
/** Target delta's integrity was checked. */
ALPM_EVENT_DELTA_INTEGRITY_DONE,
/** Deltas will be applied to packages. */
ALPM_EVENT_DELTA_PATCHES_START,
/** Deltas were applied to packages. */
ALPM_EVENT_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.
*/
ALPM_EVENT_DELTA_PATCH_START,
/** Delta patch was applied to target package. */
ALPM_EVENT_DELTA_PATCH_DONE,
/** Delta patch failed to apply to target package. */
ALPM_EVENT_DELTA_PATCH_FAILED,
/** Scriptlet has printed information.
* A line of text is passed to the callback.
*/
ALPM_EVENT_SCRIPTLET_INFO,
/** Files will be downloaded from a repository.
* The repository's tree name is passed to the callback.
*/
ALPM_EVENT_RETRIEVE_START,
/** Disk space usage will be computed for a package */
ALPM_EVENT_DISKSPACE_START,
/** Disk space usage was computed for a package */
ALPM_EVENT_DISKSPACE_DONE,
} alpm_event_t;
/** Event callback */
typedef void (*alpm_cb_event)(alpm_event_t, void *, void *);
/** Questions */
typedef enum _alpm_question_t {
ALPM_QUESTION_INSTALL_IGNOREPKG = 1,
ALPM_QUESTION_REPLACE_PKG = (1 << 1),
ALPM_QUESTION_CONFLICT_PKG = (1 << 2),
ALPM_QUESTION_CORRUPTED_PKG = (1 << 3),
ALPM_QUESTION_LOCAL_NEWER = (1 << 4),
ALPM_QUESTION_REMOVE_PKGS = (1 << 5),
ALPM_QUESTION_SELECT_PROVIDER = (1 << 6),
ALPM_QUESTION_IMPORT_KEY = (1 << 7)
} alpm_question_t;
/** Question callback */
typedef void (*alpm_cb_question)(alpm_question_t, void *, void *, void *, int *);
/** Progress */
typedef enum _alpm_progress_t {
ALPM_PROGRESS_ADD_START,
ALPM_PROGRESS_UPGRADE_START,
ALPM_PROGRESS_REMOVE_START,
ALPM_PROGRESS_CONFLICTS_START,
ALPM_PROGRESS_DISKSPACE_START,
ALPM_PROGRESS_INTEGRITY_START,
ALPM_PROGRESS_LOAD_START,
} alpm_progress_t;
/** Progress callback */
typedef void (*alpm_cb_progress)(alpm_progress_t, const char *, int, size_t, size_t);
/*
* Downloading
*/
@@ -292,6 +432,21 @@ alpm_cb_totaldl alpm_option_get_totaldlcb(alpm_handle_t *handle);
/** Sets the callback used to report total download size. */
int alpm_option_set_totaldlcb(alpm_handle_t *handle, alpm_cb_totaldl cb);
/** Returns the callback used for events. */
alpm_cb_event alpm_option_get_eventcb(alpm_handle_t *handle);
/** Sets the callback used for events. */
int alpm_option_set_eventcb(alpm_handle_t *handle, alpm_cb_event cb);
/** Returns the callback used for questions. */
alpm_cb_question alpm_option_get_questioncb(alpm_handle_t *handle);
/** Sets the callback used for questions. */
int alpm_option_set_questioncb(alpm_handle_t *handle, alpm_cb_question cb);
/** Returns the callback used for operation progress. */
alpm_cb_progress alpm_option_get_progresscb(alpm_handle_t *handle);
/** Sets the callback used for operation progress. */
int alpm_option_set_progresscb(alpm_handle_t *handle, alpm_cb_progress cb);
/** Returns the root of the destination filesystem. Read-only. */
const char *alpm_option_get_root(alpm_handle_t *handle);
@@ -526,7 +681,7 @@ int alpm_db_set_pkgreason(alpm_handle_t *handle, alpm_pkg_t *pkg,
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int alpm_pkg_load(alpm_handle_t *handle, const char *filename, int full,
alpm_siglevel_t, alpm_pkg_t **pkg);
alpm_siglevel_t level, alpm_pkg_t **pkg);
/** Free a package.
* @param pkg package pointer to free
@@ -578,6 +733,11 @@ const char *alpm_pkg_get_name(alpm_pkg_t *pkg);
*/
const char *alpm_pkg_get_version(alpm_pkg_t *pkg);
/** Returns the origin of the package.
* @return an alpm_pkgfrom_t constant, -1 on error
*/
alpm_pkgfrom_t alpm_pkg_get_origin(alpm_pkg_t *pkg);
/** Returns the package description.
* @param pkg a pointer to package
* @return a reference to an internal string
@@ -609,19 +769,27 @@ time_t alpm_pkg_get_installdate(alpm_pkg_t *pkg);
const char *alpm_pkg_get_packager(alpm_pkg_t *pkg);
/** Returns the package's MD5 checksum as a string.
* The returned string is a sequence of lowercase hexadecimal digits.
* The returned string is a sequence of 32 lowercase hexadecimal digits.
* @param pkg a pointer to package
* @return a reference to an internal string
*/
const char *alpm_pkg_get_md5sum(alpm_pkg_t *pkg);
/** Returns the package's SHA256 checksum as a string.
* The returned string is a sequence of 64 lowercase hexadecimal digits.
* @param pkg a pointer to package
* @return a reference to an internal string
*/
const char *alpm_pkg_get_sha256sum(alpm_pkg_t *pkg);
/** Returns the architecture for which the package was built.
* @param pkg a pointer to package
* @return a reference to an internal string
*/
const char *alpm_pkg_get_arch(alpm_pkg_t *pkg);
/** Returns the size of the package.
/** Returns the size of the package. This is only available for sync database
* packages and package files, not those loaded from the local database.
* @param pkg a pointer to package
* @return the size of the package in bytes.
*/
@@ -663,15 +831,15 @@ alpm_list_t *alpm_pkg_get_depends(alpm_pkg_t *pkg);
*/
alpm_list_t *alpm_pkg_get_optdepends(alpm_pkg_t *pkg);
/** Returns the list of package names conflicting with pkg.
/** Returns the list of packages conflicting with pkg.
* @param pkg a pointer to package
* @return a reference to an internal list of strings.
* @return a reference to an internal list of alpm_depend_t structures.
*/
alpm_list_t *alpm_pkg_get_conflicts(alpm_pkg_t *pkg);
/** Returns the list of package names provided by pkg.
/** Returns the list of packages provided by pkg.
* @param pkg a pointer to package
* @return a reference to an internal list of strings.
* @return a reference to an internal list of alpm_depend_t structures.
*/
alpm_list_t *alpm_pkg_get_provides(alpm_pkg_t *pkg);
@@ -683,7 +851,7 @@ alpm_list_t *alpm_pkg_get_deltas(alpm_pkg_t *pkg);
/** Returns the list of packages to be replaced by pkg.
* @param pkg a pointer to package
* @return a reference to an internal list of strings.
* @return a reference to an internal list of alpm_depend_t structures.
*/
alpm_list_t *alpm_pkg_get_replaces(alpm_pkg_t *pkg);
@@ -713,6 +881,12 @@ alpm_list_t *alpm_pkg_get_backup(alpm_pkg_t *pkg);
*/
alpm_db_t *alpm_pkg_get_db(alpm_pkg_t *pkg);
/** Retuns the base64 encoded package signature.
* @param pkg a pointer to package
* @return a reference to an internal string
*/
const char *alpm_pkg_get_base64_sig(alpm_pkg_t *pkg);
/* End of alpm_pkg_t accessors */
/* @} */
@@ -735,9 +909,7 @@ void *alpm_pkg_changelog_open(alpm_pkg_t *pkg);
* error occurred.
*/
size_t alpm_pkg_changelog_read(void *ptr, size_t size,
const alpm_pkg_t *pkg, const void *fp);
/*int alpm_pkg_changelog_feof(const alpm_pkg_t *pkg, void *fp);*/
const alpm_pkg_t *pkg, void *fp);
int alpm_pkg_changelog_close(const alpm_pkg_t *pkg, void *fp);
@@ -763,11 +935,11 @@ alpm_list_t *alpm_pkg_unused_deltas(alpm_pkg_t *pkg);
* Signatures
*/
int alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg, alpm_sigresult_t *result);
int alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg, alpm_siglist_t *siglist);
int alpm_db_check_pgp_signature(alpm_db_t *db, alpm_sigresult_t *result);
int alpm_db_check_pgp_signature(alpm_db_t *db, alpm_siglist_t *siglist);
int alpm_sigresult_cleanup(alpm_sigresult_t *result);
int alpm_siglist_cleanup(alpm_siglist_t *siglist);
/*
* Groups
@@ -824,117 +996,6 @@ typedef enum _alpm_transflag_t {
ALPM_TRANS_FLAG_NOLOCK = (1 << 17)
} alpm_transflag_t;
/** Transaction events.
* NULL parameters are passed to in all events unless specified otherwise.
*/
typedef enum _alpm_transevt_t {
/** Dependencies will be computed for a package. */
ALPM_TRANS_EVT_CHECKDEPS_START = 1,
/** Dependencies were computed for a package. */
ALPM_TRANS_EVT_CHECKDEPS_DONE,
/** File conflicts will be computed for a package. */
ALPM_TRANS_EVT_FILECONFLICTS_START,
/** File conflicts were computed for a package. */
ALPM_TRANS_EVT_FILECONFLICTS_DONE,
/** Dependencies will be resolved for target package. */
ALPM_TRANS_EVT_RESOLVEDEPS_START,
/** Dependencies were resolved for target package. */
ALPM_TRANS_EVT_RESOLVEDEPS_DONE,
/** Inter-conflicts will be checked for target package. */
ALPM_TRANS_EVT_INTERCONFLICTS_START,
/** Inter-conflicts were checked for target package. */
ALPM_TRANS_EVT_INTERCONFLICTS_DONE,
/** Package will be installed.
* A pointer to the target package is passed to the callback.
*/
ALPM_TRANS_EVT_ADD_START,
/** Package was installed.
* A pointer to the new package is passed to the callback.
*/
ALPM_TRANS_EVT_ADD_DONE,
/** Package will be removed.
* A pointer to the target package is passed to the callback.
*/
ALPM_TRANS_EVT_REMOVE_START,
/** Package was removed.
* A pointer to the removed package is passed to the callback.
*/
ALPM_TRANS_EVT_REMOVE_DONE,
/** Package will be upgraded.
* A pointer to the upgraded package is passed to the callback.
*/
ALPM_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.
*/
ALPM_TRANS_EVT_UPGRADE_DONE,
/** Target package's integrity will be checked. */
ALPM_TRANS_EVT_INTEGRITY_START,
/** Target package's integrity was checked. */
ALPM_TRANS_EVT_INTEGRITY_DONE,
/** Target deltas's integrity will be checked. */
ALPM_TRANS_EVT_DELTA_INTEGRITY_START,
/** Target delta's integrity was checked. */
ALPM_TRANS_EVT_DELTA_INTEGRITY_DONE,
/** Deltas will be applied to packages. */
ALPM_TRANS_EVT_DELTA_PATCHES_START,
/** Deltas were applied to packages. */
ALPM_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.
*/
ALPM_TRANS_EVT_DELTA_PATCH_START,
/** Delta patch was applied to target package. */
ALPM_TRANS_EVT_DELTA_PATCH_DONE,
/** Delta patch failed to apply to target package. */
ALPM_TRANS_EVT_DELTA_PATCH_FAILED,
/** Scriptlet has printed information.
* A line of text is passed to the callback.
*/
ALPM_TRANS_EVT_SCRIPTLET_INFO,
/** Files will be downloaded from a repository.
* The repository's tree name is passed to the callback.
*/
ALPM_TRANS_EVT_RETRIEVE_START,
/** Disk space usage will be computed for a package */
ALPM_TRANS_EVT_DISKSPACE_START,
/** Disk space usage was computed for a package */
ALPM_TRANS_EVT_DISKSPACE_DONE,
} alpm_transevt_t;
/** Transaction Conversations (ie, questions) */
typedef enum _alpm_transconv_t {
ALPM_TRANS_CONV_INSTALL_IGNOREPKG = 1,
ALPM_TRANS_CONV_REPLACE_PKG = (1 << 1),
ALPM_TRANS_CONV_CONFLICT_PKG = (1 << 2),
ALPM_TRANS_CONV_CORRUPTED_PKG = (1 << 3),
ALPM_TRANS_CONV_LOCAL_NEWER = (1 << 4),
ALPM_TRANS_CONV_REMOVE_PKGS = (1 << 5),
ALPM_TRANS_CONV_SELECT_PROVIDER = (1 << 6),
} alpm_transconv_t;
/** Transaction Progress */
typedef enum _alpm_transprog_t {
ALPM_TRANS_PROGRESS_ADD_START,
ALPM_TRANS_PROGRESS_UPGRADE_START,
ALPM_TRANS_PROGRESS_REMOVE_START,
ALPM_TRANS_PROGRESS_CONFLICTS_START,
ALPM_TRANS_PROGRESS_DISKSPACE_START,
ALPM_TRANS_PROGRESS_INTEGRITY_START,
} alpm_transprog_t;
/** Transaction Event callback */
typedef void (*alpm_trans_cb_event)(alpm_transevt_t, void *, void *);
/** Transaction Conversation callback */
typedef void (*alpm_trans_cb_conv)(alpm_transconv_t, void *, void *,
void *, int *);
/** Transaction Progress callback */
typedef void (*alpm_trans_cb_progress)(alpm_transprog_t, const char *, int, size_t, size_t);
/** Returns the bitfield of flags for the current transaction.
* @param handle the context handle
* @return the bitfield of transaction flags
@@ -945,25 +1006,20 @@ alpm_transflag_t alpm_trans_get_flags(alpm_handle_t *handle);
* @param handle the context handle
* @return a list of alpm_pkg_t structures
*/
alpm_list_t * alpm_trans_get_add(alpm_handle_t *handle);
alpm_list_t *alpm_trans_get_add(alpm_handle_t *handle);
/** Returns the list of packages removed by the transaction.
* @param handle the context handle
* @return a list of alpm_pkg_t structures
*/
alpm_list_t * alpm_trans_get_remove(alpm_handle_t *handle);
alpm_list_t *alpm_trans_get_remove(alpm_handle_t *handle);
/** Initialize the transaction.
* @param handle the context handle
* @param flags flags of the transaction (like nodeps, etc)
* @param event event callback function pointer
* @param conv question callback function pointer
* @param progress progress callback function pointer
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags,
alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress cb_progress);
int alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags);
/** Prepare a transaction.
* @param handle the context handle
@@ -1052,6 +1108,7 @@ char *alpm_dep_compute_string(const alpm_depend_t *dep);
/* checksums */
char *alpm_compute_md5sum(const char *name);
char *alpm_compute_sha256sum(const char *filename);
/** @addtogroup alpm_api_errors Error Codes
* @{
@@ -1134,7 +1191,15 @@ const char *alpm_strerror(enum _alpm_errno_t err);
alpm_handle_t *alpm_initialize(const char *root, const char *dbpath,
enum _alpm_errno_t *err);
int alpm_release(alpm_handle_t *handle);
enum alpm_caps {
ALPM_CAPABILITY_NLS = (1 << 0),
ALPM_CAPABILITY_DOWNLOADER = (1 << 1),
ALPM_CAPABILITY_SIGNATURES = (1 << 2)
};
const char *alpm_version(void);
enum alpm_caps alpm_capabilities(void);
/* End of alpm_api */
/** @} */

View File

@@ -89,7 +89,7 @@ alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
{
alpm_list_t *ptr, *lp;
ptr = calloc(1, sizeof(alpm_list_t));
ptr = malloc(sizeof(alpm_list_t));
if(ptr == NULL) {
return list;
}
@@ -127,7 +127,7 @@ alpm_list_t SYMEXPORT *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_
} else {
alpm_list_t *add = NULL, *prev = NULL, *next = list;
add = calloc(1, sizeof(alpm_list_t));
add = malloc(sizeof(alpm_list_t));
if(add == NULL) {
return list;
}
@@ -206,12 +206,18 @@ alpm_list_t SYMEXPORT *alpm_list_join(alpm_list_t *first, alpm_list_t *second)
*/
alpm_list_t SYMEXPORT *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn)
{
alpm_list_t *newlist, *lp;
alpm_list_t *newlist, *lp, *tail_ptr, *left_tail_ptr, *right_tail_ptr;
if(left == NULL)
if(left == NULL) {
return right;
if(right == NULL)
}
if(right == NULL) {
return left;
}
/* Save tail node pointers for future use */
left_tail_ptr = left->prev;
right_tail_ptr = right->prev;
if(fn(left->data, right->data) <= 0) {
newlist = left;
@@ -242,19 +248,18 @@ alpm_list_t SYMEXPORT *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, a
if(left != NULL) {
lp->next = left;
left->prev = lp;
tail_ptr = left_tail_ptr;
}
else if(right != NULL) {
lp->next = right;
right->prev = lp;
tail_ptr = right_tail_ptr;
}
else {
tail_ptr = lp;
}
/* Find our tail pointer
* TODO maintain this in the algorithm itself */
lp = newlist;
while(lp && lp->next) {
lp = lp->next;
}
newlist->prev = lp;
newlist->prev = tail_ptr;
return newlist;
}
@@ -465,7 +470,7 @@ alpm_list_t SYMEXPORT *alpm_list_copy_data(const alpm_list_t *list,
const alpm_list_t *lp = list;
alpm_list_t *newlist = NULL;
while(lp) {
void *newdata = calloc(1, size);
void *newdata = malloc(size);
if(newdata) {
memcpy(newdata, lp->data, size);
newlist = alpm_list_add(newlist, newdata);
@@ -543,7 +548,6 @@ inline alpm_list_t SYMEXPORT *alpm_list_next(const alpm_list_t *node)
* @brief Get the previous element of a list.
*
* @param list the list head
* @param node the list node
*
* @return the previous element, or NULL when no previous element exist
*/
@@ -771,7 +775,7 @@ void SYMEXPORT *alpm_list_to_array(const alpm_list_t *list, size_t n,
return NULL;
}
array = calloc(n, size);
array = malloc(n * size);
if(array == NULL) {
return NULL;
}

View File

@@ -65,10 +65,10 @@ static const unsigned char base64_dec_map[128] =
/*
* Encode a buffer into base64 format
*/
int base64_encode( unsigned char *dst, int *dlen,
const unsigned char *src, int slen )
int base64_encode( unsigned char *dst, size_t *dlen,
const unsigned char *src, size_t slen )
{
int i, n;
size_t i, n;
int C1, C2, C3;
unsigned char *p;
@@ -128,10 +128,10 @@ int base64_encode( unsigned char *dst, int *dlen,
/*
* Decode a base64-formatted buffer
*/
int base64_decode( unsigned char *dst, int *dlen,
const unsigned char *src, int slen )
int base64_decode( unsigned char *dst, size_t *dlen,
const unsigned char *src, size_t slen )
{
int i, j, n;
size_t i, j, n;
unsigned long x;
unsigned char *p;

View File

@@ -25,8 +25,10 @@
#ifndef _BASE64_H
#define _BASE64_H
#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL 0x0010
#define POLARSSL_ERR_BASE64_INVALID_CHARACTER 0x0012
#include <string.h>
#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL -0x0010 /**< Output buffer too small. */
#define POLARSSL_ERR_BASE64_INVALID_CHARACTER -0x0012 /**< Invalid character in input. */
/**
* \brief Encode a buffer into base64 format
@@ -43,8 +45,8 @@
* \note Call this function with *dlen = 0 to obtain the
* required buffer size in *dlen
*/
int base64_encode( unsigned char *dst, int *dlen,
const unsigned char *src, int slen );
int base64_encode( unsigned char *dst, size_t *dlen,
const unsigned char *src, size_t slen );
/**
* \brief Decode a base64-formatted buffer
@@ -62,7 +64,7 @@ int base64_encode( unsigned char *dst, int *dlen,
* \note Call this function with *dlen = 0 to obtain the
* required buffer size in *dlen
*/
int base64_decode( unsigned char *dst, int *dlen,
const unsigned char *src, int slen );
int base64_decode( unsigned char *dst, size_t *dlen,
const unsigned char *src, size_t slen );
#endif /* base64.h */

View File

@@ -57,12 +57,6 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq);
* initialized.
*/
static const char *_cache_get_filename(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC, NULL);
return pkg->filename;
}
static const char *_cache_get_desc(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC, NULL);
@@ -93,24 +87,12 @@ static const char *_cache_get_packager(alpm_pkg_t *pkg)
return pkg->packager;
}
static const char *_cache_get_md5sum(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC, NULL);
return pkg->md5sum;
}
static const char *_cache_get_arch(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC, NULL);
return pkg->arch;
}
static off_t _cache_get_size(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC, -1);
return pkg->size;
}
static off_t _cache_get_isize(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_DESC, -1);
@@ -171,12 +153,6 @@ static alpm_list_t *_cache_get_replaces(alpm_pkg_t *pkg)
return pkg->replaces;
}
/* local packages can not have deltas */
static alpm_list_t *_cache_get_deltas(alpm_pkg_t UNUSED *pkg)
{
return NULL;
}
static alpm_filelist_t *_cache_get_files(alpm_pkg_t *pkg)
{
LAZY_LOAD(INFRQ_FILES, NULL);
@@ -197,13 +173,11 @@ static alpm_list_t *_cache_get_backup(alpm_pkg_t *pkg)
*/
static void *_cache_changelog_open(alpm_pkg_t *pkg)
{
char clfile[PATH_MAX];
snprintf(clfile, PATH_MAX, "%s/%s/%s-%s/changelog",
alpm_option_get_dbpath(pkg->handle),
alpm_db_get_name(alpm_pkg_get_db(pkg)),
alpm_pkg_get_name(pkg),
alpm_pkg_get_version(pkg));
return fopen(clfile, "r");
alpm_db_t *db = alpm_pkg_get_db(pkg);
char *clfile = _alpm_local_db_pkgpath(db, pkg, "changelog");
FILE *f = fopen(clfile, "r");
free(clfile);
return f;
}
/**
@@ -216,7 +190,7 @@ static void *_cache_changelog_open(alpm_pkg_t *pkg)
* @return the number of characters read, or 0 if there is no more data
*/
static size_t _cache_changelog_read(void *ptr, size_t size,
const alpm_pkg_t UNUSED *pkg, const void *fp)
const alpm_pkg_t UNUSED *pkg, void *fp)
{
return fread(ptr, 1, size, (FILE *)fp);
}
@@ -244,15 +218,12 @@ static int _cache_force_load(alpm_pkg_t *pkg)
* logic.
*/
static struct pkg_operations local_pkg_ops = {
.get_filename = _cache_get_filename,
.get_desc = _cache_get_desc,
.get_url = _cache_get_url,
.get_builddate = _cache_get_builddate,
.get_installdate = _cache_get_installdate,
.get_packager = _cache_get_packager,
.get_md5sum = _cache_get_md5sum,
.get_arch = _cache_get_arch,
.get_size = _cache_get_size,
.get_isize = _cache_get_isize,
.get_reason = _cache_get_reason,
.has_scriptlet = _cache_has_scriptlet,
@@ -263,7 +234,6 @@ static struct pkg_operations local_pkg_ops = {
.get_conflicts = _cache_get_conflicts,
.get_provides = _cache_get_provides,
.get_replaces = _cache_get_replaces,
.get_deltas = _cache_get_deltas,
.get_files = _cache_get_files,
.get_backup = _cache_get_backup,
@@ -325,6 +295,9 @@ static int local_db_validate(alpm_db_t *db)
if(db->status & DB_STATUS_VALID) {
return 0;
}
if(db->status & DB_STATUS_INVALID) {
return -1;
}
dbpath = _alpm_db_path(db);
if(dbpath == NULL) {
@@ -335,11 +308,16 @@ static int local_db_validate(alpm_db_t *db)
if(errno == ENOENT) {
/* database dir doesn't exist yet */
db->status |= DB_STATUS_VALID;
db->status &= ~DB_STATUS_INVALID;
db->status &= ~DB_STATUS_EXISTS;
db->status |= DB_STATUS_MISSING;
return 0;
} else {
RET_ERR(db->handle, ALPM_ERR_DB_OPEN, -1);
}
}
db->status |= DB_STATUS_EXISTS;
db->status &= ~DB_STATUS_MISSING;
while((ent = readdir(dbdir)) != NULL) {
const char *name = ent->d_name;
@@ -355,12 +333,15 @@ static int local_db_validate(alpm_db_t *db)
snprintf(path, PATH_MAX, "%s%s/depends", dbpath, name);
if(access(path, F_OK) == 0) {
/* we found a depends file- bail */
db->status &= ~DB_STATUS_VALID;
db->status |= DB_STATUS_INVALID;
db->handle->pm_errno = ALPM_ERR_DB_VERSION;
goto done;
}
}
/* we found no depends file after full scan */
db->status |= DB_STATUS_VALID;
db->status &= ~DB_STATUS_INVALID;
ret = 0;
done:
@@ -380,6 +361,11 @@ static int local_db_populate(alpm_db_t *db)
const char *dbpath;
DIR *dbdir;
if(db->status & DB_STATUS_INVALID) {
RET_ERR(db->handle, ALPM_ERR_DB_INVALID, -1);
}
/* note: DB_STATUS_MISSING is not fatal for local database */
dbpath = _alpm_db_path(db);
if(dbpath == NULL) {
/* pm_errno set in _alpm_db_path() */
@@ -390,6 +376,8 @@ static int local_db_populate(alpm_db_t *db)
if(dbdir == NULL) {
if(errno == ENOENT) {
/* no database existing yet is not an error */
db->status &= ~DB_STATUS_EXISTS;
db->status |= DB_STATUS_MISSING;
return 0;
}
RET_ERR(db->handle, ALPM_ERR_DB_OPEN, -1);
@@ -397,6 +385,8 @@ static int local_db_populate(alpm_db_t *db)
if(fstat(dirfd(dbdir), &buf) != 0) {
RET_ERR(db->handle, ALPM_ERR_DB_OPEN, -1);
}
db->status |= DB_STATUS_EXISTS;
db->status &= ~DB_STATUS_MISSING;
if(buf.st_nlink >= 2) {
est_count = buf.st_nlink;
} else {
@@ -485,7 +475,7 @@ static int local_db_populate(alpm_db_t *db)
}
/* Note: the return value must be freed by the caller */
static char *get_pkgpath(alpm_db_t *db, alpm_pkg_t *info)
char *_alpm_local_db_pkgpath(alpm_db_t *db, alpm_pkg_t *info, const char *filename)
{
size_t len;
char *pkgpath;
@@ -493,8 +483,10 @@ static char *get_pkgpath(alpm_db_t *db, alpm_pkg_t *info)
dbpath = _alpm_db_path(db);
len = strlen(dbpath) + strlen(info->name) + strlen(info->version) + 3;
len += filename ? strlen(filename) : 0;
MALLOC(pkgpath, len, RET_ERR(db->handle, ALPM_ERR_MEMORY, NULL));
sprintf(pkgpath, "%s%s-%s/", dbpath, info->name, info->version);
sprintf(pkgpath, "%s%s-%s/%s", dbpath, info->name, info->version,
filename ? filename : "");
return pkgpath;
}
@@ -510,18 +502,27 @@ static char *get_pkgpath(alpm_db_t *db, alpm_pkg_t *info)
#define READ_AND_STORE_ALL(f) do { \
char *linedup; \
if(fgets(line, sizeof(line), fp) == NULL && !feof(fp)) goto error; \
if(fgets(line, sizeof(line), fp) == NULL) {\
if(!feof(fp)) goto error; else break; \
} \
if(_alpm_strip_newline(line) == 0) break; \
STRDUP(linedup, line, goto error); \
f = alpm_list_add(f, linedup); \
} while(1) /* note the while(1) and not (0) */
#define READ_AND_SPLITDEP(f) do { \
if(fgets(line, sizeof(line), fp) == NULL) {\
if(!feof(fp)) goto error; else break; \
} \
if(_alpm_strip_newline(line) == 0) break; \
f = alpm_list_add(f, _alpm_splitdep(line)); \
} while(1) /* note the while(1) and not (0) */
static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
{
FILE *fp = NULL;
char path[PATH_MAX];
char line[1024];
char *pkgpath = NULL;
char *pkgpath;
alpm_db_t *db = info->origin_data.db;
/* bitmask logic here:
@@ -543,27 +544,35 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
_alpm_log(db->handle, ALPM_LOG_FUNCTION, "loading package data for %s : level=0x%x\n",
info->name, inforeq);
/* clear out 'line', to be certain - and to make valgrind happy */
memset(line, 0, sizeof(line));
pkgpath = get_pkgpath(db, info);
if(access(pkgpath, F_OK)) {
pkgpath = _alpm_local_db_pkgpath(db, info, NULL);
if(!pkgpath || access(pkgpath, F_OK)) {
/* directory doesn't exist or can't be opened */
_alpm_log(db->handle, ALPM_LOG_DEBUG, "cannot find '%s-%s' in db '%s'\n",
info->name, info->version, db->treename);
goto error;
}
free(pkgpath);
/* clear out 'line', to be certain - and to make valgrind happy */
memset(line, 0, sizeof(line));
/* DESC */
if(inforeq & INFRQ_DESC && !(info->infolevel & INFRQ_DESC)) {
snprintf(path, PATH_MAX, "%sdesc", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
char *path = _alpm_local_db_pkgpath(db, info, "desc");
if(!path || (fp = fopen(path, "r")) == NULL) {
_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
free(path);
goto error;
}
free(path);
while(!feof(fp)) {
READ_NEXT();
if(fgets(line, sizeof(line), fp) == NULL && !feof(fp)) {
goto error;
}
if(_alpm_strip_newline(line) == 0) {
/* length of stripped line was zero */
continue;
}
if(strcmp(line, "%NAME%") == 0) {
READ_NEXT();
if(strcmp(line, info->name) != 0) {
@@ -596,32 +605,20 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
READ_AND_STORE(info->packager);
} else if(strcmp(line, "%REASON%") == 0) {
READ_NEXT();
info->reason = (alpm_pkgreason_t)atol(line);
info->reason = (alpm_pkgreason_t)atoi(line);
} else if(strcmp(line, "%SIZE%") == 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.
*/
READ_NEXT();
info->size = atol(line);
/* also store this value to isize */
info->isize = info->size;
info->isize = _alpm_strtoofft(line);
} else if(strcmp(line, "%REPLACES%") == 0) {
READ_AND_STORE_ALL(info->replaces);
READ_AND_SPLITDEP(info->replaces);
} else if(strcmp(line, "%DEPENDS%") == 0) {
/* Different than the rest because of the _alpm_splitdep call. */
while(1) {
READ_NEXT();
if(strlen(line) == 0) break;
info->depends = alpm_list_add(info->depends, _alpm_splitdep(line));
}
READ_AND_SPLITDEP(info->depends);
} else if(strcmp(line, "%OPTDEPENDS%") == 0) {
READ_AND_STORE_ALL(info->optdepends);
} else if(strcmp(line, "%CONFLICTS%") == 0) {
READ_AND_STORE_ALL(info->conflicts);
READ_AND_SPLITDEP(info->conflicts);
} else if(strcmp(line, "%PROVIDES%") == 0) {
READ_AND_STORE_ALL(info->provides);
READ_AND_SPLITDEP(info->provides);
}
}
fclose(fp);
@@ -631,11 +628,13 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
/* FILES */
if(inforeq & INFRQ_FILES && !(info->infolevel & INFRQ_FILES)) {
snprintf(path, PATH_MAX, "%sfiles", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
char *path = _alpm_local_db_pkgpath(db, info, "files");
if(!path || (fp = fopen(path, "r")) == NULL) {
_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
free(path);
goto error;
}
free(path);
while(fgets(line, sizeof(line), fp)) {
_alpm_strip_newline(line);
if(strcmp(line, "%FILES%") == 0) {
@@ -686,19 +685,18 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
/* INSTALL */
if(inforeq & INFRQ_SCRIPTLET && !(info->infolevel & INFRQ_SCRIPTLET)) {
snprintf(path, PATH_MAX, "%sinstall", pkgpath);
char *path = _alpm_local_db_pkgpath(db, info, "install");
if(access(path, F_OK) == 0) {
info->scriptlet = 1;
}
free(path);
info->infolevel |= INFRQ_SCRIPTLET;
}
free(pkgpath);
return 0;
error:
info->infolevel |= INFRQ_ERROR;
free(pkgpath);
if(fp) {
fclose(fp);
}
@@ -709,14 +707,14 @@ int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info)
{
mode_t oldmask;
int retval = 0;
char *pkgpath = NULL;
char *pkgpath;
if(checkdbdir(db) != 0) {
return -1;
}
oldmask = umask(0000);
pkgpath = get_pkgpath(db, info);
pkgpath = _alpm_local_db_pkgpath(db, info, NULL);
if((retval = mkdir(pkgpath, 0755)) != 0) {
_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not create directory %s: %s\n"),
@@ -732,36 +730,31 @@ int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info)
int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
{
FILE *fp = NULL;
char path[PATH_MAX];
mode_t oldmask;
alpm_list_t *lp = NULL;
alpm_list_t *lp;
int retval = 0;
char *pkgpath = NULL;
if(db == NULL || info == NULL) {
if(db == NULL || info == NULL || !(db->status & DB_STATUS_LOCAL)) {
return -1;
}
pkgpath = get_pkgpath(db, info);
/* make sure we have a sane umask */
oldmask = umask(0022);
if(strcmp(db->treename, "local") != 0) {
return -1;
}
/* DESC */
if(inforeq & INFRQ_DESC) {
char *path;
_alpm_log(db->handle, ALPM_LOG_DEBUG, "writing %s-%s DESC information back to db\n",
info->name, info->version);
snprintf(path, PATH_MAX, "%sdesc", pkgpath);
if((fp = fopen(path, "w")) == NULL) {
path = _alpm_local_db_pkgpath(db, info, "desc");
if(!path || (fp = fopen(path, "w")) == NULL) {
_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"),
path, strerror(errno));
retval = -1;
free(path);
goto cleanup;
}
free(path);
fprintf(fp, "%%NAME%%\n%s\n\n"
"%%VERSION%%\n%s\n\n", info->name, info->version);
if(info->desc) {
@@ -778,7 +771,9 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
if(info->replaces) {
fputs("%REPLACES%\n", fp);
for(lp = info->replaces; lp; lp = lp->next) {
fprintf(fp, "%s\n", (char *)lp->data);
char *depstring = alpm_dep_compute_string(lp->data);
fprintf(fp, "%s\n", depstring);
free(depstring);
}
fprintf(fp, "\n");
}
@@ -837,14 +832,18 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
if(info->conflicts) {
fputs("%CONFLICTS%\n", fp);
for(lp = info->conflicts; lp; lp = lp->next) {
fprintf(fp, "%s\n", (char *)lp->data);
char *depstring = alpm_dep_compute_string(lp->data);
fprintf(fp, "%s\n", depstring);
free(depstring);
}
fprintf(fp, "\n");
}
if(info->provides) {
fputs("%PROVIDES%\n", fp);
for(lp = info->provides; lp; lp = lp->next) {
fprintf(fp, "%s\n", (char *)lp->data);
char *depstring = alpm_dep_compute_string(lp->data);
fprintf(fp, "%s\n", depstring);
free(depstring);
}
fprintf(fp, "\n");
}
@@ -855,15 +854,18 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
/* FILES */
if(inforeq & INFRQ_FILES) {
char *path;
_alpm_log(db->handle, ALPM_LOG_DEBUG, "writing %s-%s FILES information back to db\n",
info->name, info->version);
snprintf(path, PATH_MAX, "%sfiles", pkgpath);
if((fp = fopen(path, "w")) == NULL) {
path = _alpm_local_db_pkgpath(db, info, "files");
if(!path || (fp = fopen(path, "w")) == NULL) {
_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"),
path, strerror(errno));
retval = -1;
free(path);
goto cleanup;
}
free(path);
if(info->files.count) {
size_t i;
fprintf(fp, "%%FILES%%\n");
@@ -890,7 +892,6 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
cleanup:
umask(oldmask);
free(pkgpath);
if(fp) {
fclose(fp);
@@ -902,10 +903,9 @@ cleanup:
int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info)
{
int ret = 0;
char *pkgpath = NULL;
pkgpath = get_pkgpath(db, info);
char *pkgpath = _alpm_local_db_pkgpath(db, info, NULL);
/* TODO explicit file removes and then an rmdir? */
ret = _alpm_rmrf(pkgpath);
free(pkgpath);
if(ret != 0) {

View File

@@ -59,7 +59,7 @@ static void *_package_changelog_open(alpm_pkg_t *pkg)
archive_read_support_format_all(archive);
if(archive_read_open_filename(archive, pkgfile,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
ALPM_BUFFER_SIZE) != ARCHIVE_OK) {
RET_ERR(pkg->handle, ALPM_ERR_PKG_OPEN, NULL);
}
@@ -87,7 +87,7 @@ static void *_package_changelog_open(alpm_pkg_t *pkg)
* @return the number of characters read, or 0 if there is no more data
*/
static size_t _package_changelog_read(void *ptr, size_t size,
const alpm_pkg_t UNUSED *pkg, const void *fp)
const alpm_pkg_t UNUSED *pkg, void *fp)
{
ssize_t sret = archive_read_data((struct archive *)fp, ptr, size);
/* Report error (negative values) */
@@ -187,18 +187,21 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t *
STRDUP(newpkg->arch, ptr, return -1);
} else if(strcmp(key, "size") == 0) {
/* size in the raw package is uncompressed (installed) size */
newpkg->isize = atol(ptr);
newpkg->isize = _alpm_strtoofft(ptr);
} else if(strcmp(key, "depend") == 0) {
alpm_depend_t *dep = _alpm_splitdep(ptr);
newpkg->depends = alpm_list_add(newpkg->depends, dep);
} else if(strcmp(key, "optdepend") == 0) {
newpkg->optdepends = alpm_list_add(newpkg->optdepends, strdup(ptr));
} else if(strcmp(key, "conflict") == 0) {
newpkg->conflicts = alpm_list_add(newpkg->conflicts, strdup(ptr));
alpm_depend_t *conflict = _alpm_splitdep(ptr);
newpkg->conflicts = alpm_list_add(newpkg->conflicts, conflict);
} else if(strcmp(key, "replaces") == 0) {
newpkg->replaces = alpm_list_add(newpkg->replaces, strdup(ptr));
alpm_depend_t *replace = _alpm_splitdep(ptr);
newpkg->replaces = alpm_list_add(newpkg->replaces, replace);
} else if(strcmp(key, "provides") == 0) {
newpkg->provides = alpm_list_add(newpkg->provides, strdup(ptr));
alpm_depend_t *provide = _alpm_splitdep(ptr);
newpkg->provides = alpm_list_add(newpkg->provides, provide);
} else if(strcmp(key, "backup") == 0) {
alpm_backup_t *backup;
CALLOC(backup, 1, sizeof(alpm_backup_t), return -1);
@@ -269,20 +272,90 @@ static alpm_file_t *files_msort(alpm_file_t *files, size_t n)
return files;
}
/**
* Validate a package.
* @param handle the context handle
* @param pkgfile path to the package file
* @param syncpkg package object to load verification data from (md5sum,
* sha256sum, and/or base64 signature)
* @param level the required level of signature verification
* @param sigdata signature data from the package to pass back
* @return 0 if package is fully valid, -1 and pm_errno otherwise
*/
int _alpm_pkg_validate_internal(alpm_handle_t *handle,
const char *pkgfile, alpm_pkg_t *syncpkg, alpm_siglevel_t level,
alpm_siglist_t **sigdata)
{
int has_sig;
handle->pm_errno = 0;
if(pkgfile == NULL || strlen(pkgfile) == 0) {
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
}
/* attempt to access the package file, ensure it exists */
if(access(pkgfile, R_OK) != 0) {
RET_ERR(handle, ALPM_ERR_PKG_NOT_FOUND, -1);
}
/* can we get away with skipping checksums? */
has_sig = 0;
if(level & ALPM_SIG_PACKAGE) {
if(syncpkg && syncpkg->base64_sig) {
has_sig = 1;
} else {
char *sigpath = _alpm_sigpath(handle, pkgfile);
if(sigpath && !_alpm_access(handle, NULL, sigpath, R_OK)) {
has_sig = 1;
}
free(sigpath);
}
}
if(syncpkg && !has_sig) {
if(syncpkg->md5sum && !syncpkg->sha256sum) {
_alpm_log(handle, ALPM_LOG_DEBUG, "md5sum: %s\n", syncpkg->md5sum);
_alpm_log(handle, ALPM_LOG_DEBUG, "checking md5sum for %s\n", pkgfile);
if(_alpm_test_checksum(pkgfile, syncpkg->md5sum, ALPM_CSUM_MD5) != 0) {
RET_ERR(handle, ALPM_ERR_PKG_INVALID_CHECKSUM, -1);
}
}
if(syncpkg->sha256sum) {
_alpm_log(handle, ALPM_LOG_DEBUG, "sha256sum: %s\n", syncpkg->sha256sum);
_alpm_log(handle, ALPM_LOG_DEBUG, "checking sha256sum for %s\n", pkgfile);
if(_alpm_test_checksum(pkgfile, syncpkg->sha256sum, ALPM_CSUM_SHA256) != 0) {
RET_ERR(handle, ALPM_ERR_PKG_INVALID_CHECKSUM, -1);
}
}
}
/* even if we don't have a sig, run the check code if level tells us to */
if(has_sig || level & ALPM_SIG_PACKAGE) {
const char *sig = syncpkg ? syncpkg->base64_sig : NULL;
_alpm_log(handle, ALPM_LOG_DEBUG, "sig data: %s\n", sig ? sig : "<from .sig>");
if(_alpm_check_pgp_helper(handle, pkgfile, sig,
level & ALPM_SIG_PACKAGE_OPTIONAL, level & ALPM_SIG_PACKAGE_MARGINAL_OK,
level & ALPM_SIG_PACKAGE_UNKNOWN_OK, sigdata)) {
handle->pm_errno = ALPM_ERR_PKG_INVALID_SIG;
return -1;
}
}
return 0;
}
/**
* Load a package and create the corresponding alpm_pkg_t struct.
* @param handle the context handle
* @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 alpm_pkg_t struct
* through the full archive
*/
alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile,
int full, const char *md5sum, const char *base64_sig,
alpm_siglevel_t level)
alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
const char *pkgfile, int full)
{
int ret;
int config = 0;
int ret, config = 0;
struct archive *archive;
struct archive_entry *entry;
alpm_pkg_t *newpkg = NULL;
@@ -304,29 +377,10 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile,
newpkg->size = st.st_size;
} else {
/* couldn't stat the pkgfile, return an error */
RET_ERR(handle, ALPM_ERR_PKG_OPEN, NULL);
RET_ERR(handle, ALPM_ERR_PKG_NOT_FOUND, NULL);
}
/* first steps- validate the package file */
_alpm_log(handle, ALPM_LOG_DEBUG, "md5sum: %s\n", md5sum);
if(md5sum) {
_alpm_log(handle, ALPM_LOG_DEBUG, "checking md5sum for %s\n", pkgfile);
if(_alpm_test_md5sum(pkgfile, md5sum) != 0) {
alpm_pkg_free(newpkg);
RET_ERR(handle, ALPM_ERR_PKG_INVALID_CHECKSUM, NULL);
}
}
_alpm_log(handle, ALPM_LOG_DEBUG, "base64_sig: %s\n", base64_sig);
if(level & ALPM_SIG_PACKAGE &&
_alpm_check_pgp_helper(handle, pkgfile, base64_sig,
level & ALPM_SIG_PACKAGE_OPTIONAL, level & ALPM_SIG_PACKAGE_MARGINAL_OK,
level & ALPM_SIG_PACKAGE_UNKNOWN_OK, ALPM_ERR_PKG_INVALID_SIG)) {
_alpm_pkg_free(newpkg);
return NULL;
}
/* next- try to create an archive object to read in the package */
/* try to create an archive object to read in the package */
if((archive = archive_read_new()) == NULL) {
alpm_pkg_free(newpkg);
RET_ERR(handle, ALPM_ERR_LIBARCHIVE, NULL);
@@ -336,7 +390,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile,
archive_read_support_format_all(archive);
if(archive_read_open_filename(archive, pkgfile,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
ALPM_BUFFER_SIZE) != ARCHIVE_OK) {
alpm_pkg_free(newpkg);
RET_ERR(handle, ALPM_ERR_PKG_OPEN, NULL);
}
@@ -428,17 +482,19 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile,
newpkg->origin_data.file = strdup(pkgfile);
newpkg->ops = get_file_pkg_ops();
newpkg->handle = handle;
newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_SCRIPTLET;
if(full) {
/* attempt to hand back any memory we don't need */
files = realloc(files, sizeof(alpm_file_t) * files_count);
/* "checking for conflicts" requires a sorted list, ensure that here */
_alpm_log(handle, ALPM_LOG_DEBUG, "sorting package filelist for %s\n", pkgfile);
newpkg->files.files = files_msort(files, files_count);
if(files) {
/* attempt to hand back any memory we don't need */
files = realloc(files, sizeof(alpm_file_t) * files_count);
/* "checking for conflicts" requires a sorted list, ensure that here */
_alpm_log(handle, ALPM_LOG_DEBUG,
"sorting package filelist for %s\n", pkgfile);
newpkg->files.files = files_msort(files, files_count);
}
newpkg->files.count = files_count;
newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_FILES | INFRQ_SCRIPTLET;
} else {
newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_SCRIPTLET;
newpkg->infolevel |= INFRQ_FILES;
}
return newpkg;
@@ -458,7 +514,11 @@ int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int ful
CHECK_HANDLE(handle, return -1);
ASSERT(pkg != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1));
*pkg = _alpm_pkg_load_internal(handle, filename, full, NULL, NULL, level);
if(_alpm_pkg_validate_internal(handle, filename, NULL, level, NULL) == -1) {
/* pm_errno is set by pkg_validate */
return -1;
}
*pkg = _alpm_pkg_load_internal(handle, filename, full);
if(*pkg == NULL) {
/* pm_errno is set by pkg_load */
return -1;

View File

@@ -41,13 +41,12 @@
static char *get_sync_dir(alpm_handle_t *handle)
{
const char *dbpath = alpm_option_get_dbpath(handle);
size_t len = strlen(dbpath) + 6;
size_t len = strlen(handle->dbpath) + 6;
char *syncpath;
struct stat buf;
MALLOC(syncpath, len, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
sprintf(syncpath, "%s%s", dbpath, "sync/");
sprintf(syncpath, "%s%s", handle->dbpath, "sync/");
if(stat(syncpath, &buf) != 0) {
_alpm_log(handle, ALPM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
@@ -70,37 +69,65 @@ static char *get_sync_dir(alpm_handle_t *handle)
static int sync_db_validate(alpm_db_t *db)
{
alpm_siglevel_t level;
const char *dbpath;
if(db->status & DB_STATUS_VALID) {
if(db->status & DB_STATUS_VALID || db->status & DB_STATUS_MISSING) {
return 0;
}
if(db->status & DB_STATUS_INVALID) {
db->handle->pm_errno = ALPM_ERR_DB_INVALID_SIG;
return -1;
}
dbpath = _alpm_db_path(db);
if(!dbpath) {
/* pm_errno set in _alpm_db_path() */
return -1;
}
/* we can skip any validation if the database doesn't exist */
if(access(dbpath, R_OK) != 0 && errno == ENOENT) {
db->status &= ~DB_STATUS_EXISTS;
db->status |= DB_STATUS_MISSING;
_alpm_log(db->handle, ALPM_LOG_WARNING,
"database file for '%s' does not exist\n", db->treename);
goto valid;
}
db->status |= DB_STATUS_EXISTS;
db->status &= ~DB_STATUS_MISSING;
/* this takes into account the default verification level if UNKNOWN
* was assigned to this db */
level = alpm_db_get_siglevel(db);
if(level & ALPM_SIG_DATABASE) {
const char *dbpath = _alpm_db_path(db);
if(!dbpath) {
/* pm_errno set in _alpm_db_path() */
return -1;
}
/* we can skip any validation if the database doesn't exist */
if(access(dbpath, R_OK) != 0 && errno == ENOENT) {
goto valid;
return 0;
}
if(_alpm_check_pgp_helper(db->handle, dbpath, NULL,
int retry, ret;
do {
retry = 0;
alpm_siglist_t *siglist;
ret = _alpm_check_pgp_helper(db->handle, dbpath, NULL,
level & ALPM_SIG_DATABASE_OPTIONAL, level & ALPM_SIG_DATABASE_MARGINAL_OK,
level & ALPM_SIG_DATABASE_UNKNOWN_OK, ALPM_ERR_DB_INVALID_SIG)) {
level & ALPM_SIG_DATABASE_UNKNOWN_OK, &siglist);
if(ret) {
retry = _alpm_process_siglist(db->handle, db->treename, siglist,
level & ALPM_SIG_DATABASE_OPTIONAL, level & ALPM_SIG_DATABASE_MARGINAL_OK,
level & ALPM_SIG_DATABASE_UNKNOWN_OK);
}
alpm_siglist_cleanup(siglist);
free(siglist);
} while(retry);
if(ret) {
db->status &= ~DB_STATUS_VALID;
db->status |= DB_STATUS_INVALID;
db->handle->pm_errno = ALPM_ERR_DB_INVALID_SIG;
return 1;
}
}
valid:
db->status |= DB_STATUS_VALID;
db->status &= ~DB_STATUS_INVALID;
return 0;
}
@@ -167,32 +194,36 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
/* attempt to grab a lock */
if(_alpm_handle_lock(handle)) {
free(syncpath);
umask(oldmask);
RET_ERR(handle, ALPM_ERR_HANDLE_LOCK, -1);
}
for(i = db->servers; i; i = i->next) {
const char *server = i->data;
struct dload_payload *payload;
struct dload_payload payload;
size_t len;
int sig_ret = 0;
CALLOC(payload, 1, sizeof(*payload), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
memset(&payload, 0, sizeof(struct dload_payload));
/* set hard upper limit of 25MiB */
payload->max_size = 25 * 1024 * 1024;
payload.max_size = 25 * 1024 * 1024;
/* print server + filename into a buffer (leave space for .sig) */
len = strlen(server) + strlen(db->treename) + 9;
CALLOC(payload->fileurl, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(payload->fileurl, len, "%s/%s.db", server, db->treename);
payload->handle = handle;
payload->force = force;
/* print server + filename into a buffer */
len = strlen(server) + strlen(db->treename) + 5;
MALLOC(payload.fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(payload.fileurl, len, "%s/%s.db", server, db->treename);
payload.handle = handle;
payload.force = force;
payload.unlink_on_fail = 1;
ret = _alpm_download(payload, syncpath, NULL);
ret = _alpm_download(&payload, syncpath, NULL);
_alpm_dload_payload_reset(&payload);
if(ret == 0 && (level & ALPM_SIG_DATABASE)) {
/* an existing sig file is no good at this point */
char *sigpath = _alpm_db_sig_path(db);
char *sigpath = _alpm_sigpath(handle, _alpm_db_path(db));
if(!sigpath) {
ret = -1;
break;
@@ -201,20 +232,23 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
free(sigpath);
/* if we downloaded a DB, we want the .sig from the same server */
snprintf(payload->fileurl, len, "%s/%s.db.sig", server, db->treename);
payload->handle = handle;
payload->force = 1;
payload->errors_ok = (level & ALPM_SIG_DATABASE_OPTIONAL);
/* print server + filename into a buffer (leave space for .sig) */
len = strlen(server) + strlen(db->treename) + 9;
MALLOC(payload.fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(payload.fileurl, len, "%s/%s.db.sig", server, db->treename);
payload.handle = handle;
payload.force = 1;
payload.errors_ok = (level & ALPM_SIG_DATABASE_OPTIONAL);
/* set hard upper limit of 16KiB */
payload->max_size = 16 * 1024;
payload.max_size = 16 * 1024;
sig_ret = _alpm_download(payload, syncpath, NULL);
sig_ret = _alpm_download(&payload, syncpath, NULL);
/* errors_ok suppresses error messages, but not the return code */
sig_ret = payload->errors_ok ? 0 : sig_ret;
sig_ret = payload.errors_ok ? 0 : sig_ret;
_alpm_dload_payload_reset(&payload);
}
_alpm_dload_payload_free(payload);
if(ret != -1 && sig_ret != -1) {
break;
}
@@ -234,7 +268,12 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
/* Cache needs to be rebuilt */
_alpm_db_free_pkgcache(db);
/* clear all status flags regarding validity/existence */
db->status &= ~DB_STATUS_VALID;
db->status &= ~DB_STATUS_INVALID;
db->status &= ~DB_STATUS_EXISTS;
db->status &= ~DB_STATUS_MISSING;
if(sync_db_validate(db)) {
/* pm_errno should be set */
ret = -1;
@@ -244,7 +283,7 @@ cleanup:
if(_alpm_handle_unlock(handle)) {
_alpm_log(handle, ALPM_LOG_WARNING, _("could not remove lock file %s\n"),
alpm_option_get_lockfile(handle));
handle->lockfile);
}
free(syncpath);
umask(oldmask);
@@ -378,6 +417,13 @@ static int sync_db_populate(alpm_db_t *db)
struct archive_entry *entry;
alpm_pkg_t *pkg = NULL;
if(db->status & DB_STATUS_INVALID) {
RET_ERR(db->handle, ALPM_ERR_DB_INVALID, -1);
}
if(db->status & DB_STATUS_MISSING) {
RET_ERR(db->handle, ALPM_ERR_DB_NOT_FOUND, -1);
}
if((archive = archive_read_new()) == NULL) {
RET_ERR(db->handle, ALPM_ERR_LIBARCHIVE, -1);
}
@@ -394,7 +440,7 @@ static int sync_db_populate(alpm_db_t *db)
_alpm_log(db->handle, ALPM_LOG_DEBUG, "opening database archive %s\n", dbpath);
if(archive_read_open_filename(archive, dbpath,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
ALPM_BUFFER_SIZE) != ARCHIVE_OK) {
_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), dbpath,
archive_error_string(archive));
archive_read_finish(archive);
@@ -412,11 +458,8 @@ static int sync_db_populate(alpm_db_t *db)
}
while(archive_read_next_header(archive, &entry) == ARCHIVE_OK) {
const struct stat *st;
st = archive_entry_stat(entry);
if(S_ISDIR(st->st_mode)) {
mode_t mode = archive_entry_mode(entry);
if(S_ISDIR(mode)) {
continue;
} else {
/* we have desc, depends or deltas - parse it */
@@ -460,6 +503,12 @@ static int sync_db_populate(alpm_db_t *db)
f = alpm_list_add(f, linedup); \
} while(1) /* note the while(1) and not (0) */
#define READ_AND_SPLITDEP(f) do { \
if(_alpm_archive_fgets(archive, &buf) != ARCHIVE_OK) goto error; \
if(_alpm_strip_newline(buf.line) == 0) break; \
f = alpm_list_add(f, _alpm_splitdep(line)); \
} while(1) /* note the while(1) and not (0) */
static int sync_db_read(alpm_db_t *db, struct archive *archive,
struct archive_entry *entry, alpm_pkg_t **likely_pkg)
{
@@ -495,7 +544,10 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
int ret;
while((ret = _alpm_archive_fgets(archive, &buf)) == ARCHIVE_OK) {
char *line = buf.line;
_alpm_strip_newline(line);
if(_alpm_strip_newline(line) == 0) {
/* length of stripped line was zero */
continue;
}
if(strcmp(line, "%NAME%") == 0) {
READ_NEXT();
@@ -527,41 +579,27 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
} else if(strcmp(line, "%PACKAGER%") == 0) {
READ_AND_STORE(pkg->packager);
} else if(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.
*/
READ_NEXT();
pkg->size = atol(line);
/* also store this value to isize if isize is unset */
if(pkg->isize == 0) {
pkg->isize = pkg->size;
}
pkg->size = _alpm_strtoofft(line);
} else if(strcmp(line, "%ISIZE%") == 0) {
READ_NEXT();
pkg->isize = atol(line);
pkg->isize = _alpm_strtoofft(line);
} else if(strcmp(line, "%MD5SUM%") == 0) {
READ_AND_STORE(pkg->md5sum);
} else if(strcmp(line, "%SHA256SUM%") == 0) {
/* we don't do anything with this value right now */
READ_NEXT();
READ_AND_STORE(pkg->sha256sum);
} else if(strcmp(line, "%PGPSIG%") == 0) {
READ_AND_STORE(pkg->base64_sig);
} else if(strcmp(line, "%REPLACES%") == 0) {
READ_AND_STORE_ALL(pkg->replaces);
READ_AND_SPLITDEP(pkg->replaces);
} else if(strcmp(line, "%DEPENDS%") == 0) {
/* Different than the rest because of the _alpm_splitdep call. */
while(1) {
READ_NEXT();
if(strlen(line) == 0) break;
pkg->depends = alpm_list_add(pkg->depends, _alpm_splitdep(line));
}
READ_AND_SPLITDEP(pkg->depends);
} else if(strcmp(line, "%OPTDEPENDS%") == 0) {
READ_AND_STORE_ALL(pkg->optdepends);
} else if(strcmp(line, "%CONFLICTS%") == 0) {
READ_AND_STORE_ALL(pkg->conflicts);
READ_AND_SPLITDEP(pkg->conflicts);
} else if(strcmp(line, "%PROVIDES%") == 0) {
READ_AND_STORE_ALL(pkg->provides);
READ_AND_SPLITDEP(pkg->provides);
} else if(strcmp(line, "%DELTAS%") == 0) {
/* Different than the rest because of the _alpm_delta_parse call. */
while(1) {

View File

@@ -42,7 +42,7 @@
#include "deps.h"
static alpm_conflict_t *conflict_new(alpm_pkg_t *pkg1, alpm_pkg_t *pkg2,
const char *reason)
alpm_depend_t *reason)
{
alpm_conflict_t *conflict;
@@ -52,7 +52,7 @@ static alpm_conflict_t *conflict_new(alpm_pkg_t *pkg1, alpm_pkg_t *pkg2,
conflict->package2_hash = pkg2->name_hash;
STRDUP(conflict->package1, pkg1->name, return NULL);
STRDUP(conflict->package2, pkg2->name, return NULL);
STRDUP(conflict->reason, reason, return NULL);
conflict->reason = reason;
return conflict;
}
@@ -61,7 +61,6 @@ void _alpm_conflict_free(alpm_conflict_t *conflict)
{
FREE(conflict->package2);
FREE(conflict->package1);
FREE(conflict->reason);
FREE(conflict);
}
@@ -74,7 +73,7 @@ alpm_conflict_t *_alpm_conflict_dup(const alpm_conflict_t *conflict)
newconflict->package2_hash = conflict->package2_hash;
STRDUP(newconflict->package1, conflict->package1, return NULL);
STRDUP(newconflict->package2, conflict->package2, return NULL);
STRDUP(newconflict->reason, conflict->reason, return NULL);
newconflict->reason = conflict->reason;
return newconflict;
}
@@ -103,16 +102,18 @@ static int conflict_isin(alpm_conflict_t *needle, alpm_list_t *haystack)
* @param reason reason for this conflict
*/
static int add_conflict(alpm_handle_t *handle, alpm_list_t **baddeps,
alpm_pkg_t *pkg1, alpm_pkg_t *pkg2, const char *reason)
alpm_pkg_t *pkg1, alpm_pkg_t *pkg2, alpm_depend_t *reason)
{
alpm_conflict_t *conflict = conflict_new(pkg1, pkg2, reason);
if(!conflict) {
return -1;
}
_alpm_log(handle, ALPM_LOG_DEBUG, "package %s conflicts with %s (by %s)\n",
pkg1->name, pkg2->name, reason);
if(!conflict_isin(conflict, *baddeps)) {
char *conflict_str = alpm_dep_compute_string(reason);
*baddeps = alpm_list_add(*baddeps, conflict);
_alpm_log(handle, ALPM_LOG_DEBUG, "package %s conflicts with %s (by %s)\n",
pkg1->name, pkg2->name, conflict_str);
free(conflict_str);
} else {
_alpm_conflict_free(conflict);
}
@@ -144,9 +145,8 @@ static void check_conflict(alpm_handle_t *handle,
alpm_list_t *j;
for(j = alpm_pkg_get_conflicts(pkg1); j; j = j->next) {
const char *conflict = j->data;
alpm_depend_t *conflict = j->data;
alpm_list_t *k;
alpm_depend_t *parsed_conflict = _alpm_splitdep(conflict);
for(k = list2; k; k = k->next) {
alpm_pkg_t *pkg2 = k->data;
@@ -157,7 +157,7 @@ static void check_conflict(alpm_handle_t *handle,
continue;
}
if(_alpm_depcmp(pkg2, parsed_conflict)) {
if(_alpm_depcmp(pkg2, conflict)) {
if(order >= 0) {
add_conflict(handle, baddeps, pkg1, pkg2, conflict);
} else {
@@ -165,7 +165,6 @@ static void check_conflict(alpm_handle_t *handle,
}
}
}
_alpm_dep_free(parsed_conflict);
}
}
}
@@ -181,10 +180,7 @@ alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, alpm_list_t *packages)
return baddeps;
}
/* Check for target vs (db - target) conflicts
* In case of conflict the package1 field of pmdepconflict_t contains
* the target package, package2 field contains the local package
*/
/* Check for target vs (db - target) conflicts */
alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages)
{
alpm_list_t *baddeps = NULL;
@@ -280,30 +276,29 @@ static alpm_list_t *filelist_operation(alpm_filelist_t *filesA,
return ret;
}
/* Adds alpm_fileconflict_t to a conflicts list. Pass the conflicts list, type
* (either ALPM_FILECONFLICT_TARGET or ALPM_FILECONFLICT_FILESYSTEM), a file
* string, and either two package names or one package name and NULL. This is
* a wrapper for former functionality that was done inline.
/* Adds alpm_fileconflict_t to a conflicts list. Pass the conflicts list, the
* conflicting file path, and either two packages or one package and NULL.
*/
static alpm_list_t *add_fileconflict(alpm_handle_t *handle,
alpm_list_t *conflicts, alpm_fileconflicttype_t type, const char *filestr,
const char *name1, const char *name2)
alpm_list_t *conflicts, const char *filestr,
alpm_pkg_t *pkg1, alpm_pkg_t *pkg2)
{
alpm_fileconflict_t *conflict;
MALLOC(conflict, sizeof(alpm_fileconflict_t), goto error);
conflict->type = type;
STRDUP(conflict->target, name1, goto error);
STRDUP(conflict->target, pkg1->name, goto error);
STRDUP(conflict->file, filestr, goto error);
if(name2) {
STRDUP(conflict->ctarget, name2, goto error);
if(pkg2) {
conflict->type = ALPM_FILECONFLICT_TARGET;
STRDUP(conflict->ctarget, pkg2->name, goto error);
} else {
conflict->type = ALPM_FILECONFLICT_FILESYSTEM;
STRDUP(conflict->ctarget, "", goto error);
}
conflicts = alpm_list_add(conflicts, conflict);
_alpm_log(handle, ALPM_LOG_DEBUG, "found file conflict %s, packages %s and %s\n",
filestr, name1, name2 ? name2 : "(filesystem)");
filestr, pkg1->name, pkg2 ? pkg2->name : "(filesystem)");
return conflicts;
@@ -388,7 +383,6 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
alpm_list_t *i, *conflicts = NULL;
size_t numtargs = alpm_list_count(upgrade);
size_t current;
alpm_trans_t *trans = handle->trans;
if(!upgrade) {
return NULL;
@@ -406,11 +400,11 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
size_t filenum;
int percent = (current * 100) / numtargs;
PROGRESS(trans, ALPM_TRANS_PROGRESS_CONFLICTS_START, "", percent,
PROGRESS(handle, ALPM_PROGRESS_CONFLICTS_START, "", percent,
numtargs, current);
/* CHECK 1: check every target against every target */
_alpm_log(handle, ALPM_LOG_DEBUG, "searching for file conflicts: %s\n",
alpm_pkg_get_name(p1));
p1->name);
for(j = i->next; j; j = j->next) {
alpm_list_t *common_files;
alpm_pkg_t *p2 = j->data;
@@ -421,10 +415,9 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
alpm_list_t *k;
char path[PATH_MAX];
for(k = common_files; k; k = k->next) {
snprintf(path, PATH_MAX, "%s%s", handle->root, (char *)k->data);
conflicts = add_fileconflict(handle, conflicts,
ALPM_FILECONFLICT_TARGET, path,
alpm_pkg_get_name(p1), alpm_pkg_get_name(p2));
alpm_file_t *file = k->data;
snprintf(path, PATH_MAX, "%s%s", handle->root, file->name);
conflicts = add_fileconflict(handle, conflicts, path, p1, p2);
if(handle->pm_errno == ALPM_ERR_MEMORY) {
FREELIST(conflicts);
FREELIST(common_files);
@@ -476,16 +469,18 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
continue;
}
_alpm_log(handle, ALPM_LOG_DEBUG, "checking possible conflict: %s\n", path);
if(S_ISDIR(file->mode)) {
struct stat sbuf;
if(S_ISDIR(lsbuf.st_mode)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "%s is a directory, not a conflict\n", path);
_alpm_log(handle, ALPM_LOG_DEBUG, "file is a directory, not a conflict\n");
continue;
}
stat(path, &sbuf);
if(S_ISLNK(lsbuf.st_mode) && S_ISDIR(sbuf.st_mode)) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"%s is a symlink to a dir, hopefully not a conflict\n", path);
"file is a symlink to a dir, hopefully not a conflict\n");
continue;
}
/* if we made it to here, we want all subsequent path comparisons to
@@ -494,7 +489,6 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
path[strlen(path) - 1] = '\0';
}
_alpm_log(handle, ALPM_LOG_DEBUG, "checking possible conflict: %s\n", path);
relative_path = path + strlen(handle->root);
/* Check remove list (will we remove the conflicting local file?) */
@@ -503,7 +497,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
if(rempkg && _alpm_filelist_contains(alpm_pkg_get_files(rempkg),
relative_path)) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"local file will be removed, not a conflict: %s\n", path);
"local file will be removed, not a conflict\n");
resolved_conflict = 1;
}
}
@@ -524,7 +518,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
handle->trans->skip_remove =
alpm_list_add(handle->trans->skip_remove, strdup(filestr));
_alpm_log(handle, ALPM_LOG_DEBUG,
"file changed packages, adding to remove skiplist: %s\n", path);
"file changed packages, adding to remove skiplist\n");
resolved_conflict = 1;
}
}
@@ -542,16 +536,20 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
free(dir);
}
if(!resolved_conflict && dbpkg) {
/* check if a component of the filepath was a link. canonicalize the path
* and look for it in the old package. note that the actual file under
* consideration cannot itself be a link, as it might be unowned- path
* components can be safely checked as all directories are "unowned". */
if(!resolved_conflict && dbpkg && !S_ISLNK(lsbuf.st_mode)) {
char *rpath = calloc(PATH_MAX, sizeof(char));
const char *relative_rpath;
if(!realpath(path, rpath)) {
free(rpath);
continue;
}
relative_rpath = rpath + strlen(handle->root);
if(_alpm_filelist_contains(alpm_pkg_get_files(dbpkg), relative_rpath)) {
resolved_conflict = 1;
if(realpath(path, rpath)) {
relative_rpath = rpath + strlen(handle->root);
if(_alpm_filelist_contains(alpm_pkg_get_files(dbpkg), relative_rpath)) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"package contained the resolved realpath\n");
resolved_conflict = 1;
}
}
free(rpath);
}
@@ -567,14 +565,13 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
}
if(!found) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"file was unowned but in new backup list: %s\n", path);
"file was unowned but in new backup list\n");
resolved_conflict = 1;
}
}
if(!resolved_conflict) {
conflicts = add_fileconflict(handle, conflicts,
ALPM_FILECONFLICT_FILESYSTEM, path, p1->name, NULL);
conflicts = add_fileconflict(handle, conflicts, path, p1, NULL);
if(handle->pm_errno == ALPM_ERR_MEMORY) {
FREELIST(conflicts);
if(dbpkg) {
@@ -590,7 +587,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
free(tmpfiles.files);
}
}
PROGRESS(trans, ALPM_TRANS_PROGRESS_CONFLICTS_START, "", 100,
PROGRESS(handle, ALPM_PROGRESS_CONFLICTS_START, "", 100,
numtargs, current);
return conflicts;

View File

@@ -224,7 +224,7 @@ alpm_siglevel_t SYMEXPORT alpm_db_get_siglevel(alpm_db_t *db)
{
ASSERT(db != NULL, return -1);
if(db->siglevel & ALPM_SIG_USE_DEFAULT) {
return alpm_option_get_default_siglevel(db->handle);
return db->handle->siglevel;
} else {
return db->siglevel;
}
@@ -326,7 +326,11 @@ alpm_db_t *_alpm_db_new(const char *treename, int is_local)
CALLOC(db, 1, sizeof(alpm_db_t), return NULL);
STRDUP(db->treename, treename, return NULL);
db->is_local = is_local;
if(is_local) {
db->status |= DB_STATUS_LOCAL;
} else {
db->status &= ~DB_STATUS_LOCAL;
}
return db;
}
@@ -353,13 +357,13 @@ const char *_alpm_db_path(alpm_db_t *db)
const char *dbpath;
size_t pathsize;
dbpath = alpm_option_get_dbpath(db->handle);
dbpath = db->handle->dbpath;
if(!dbpath) {
_alpm_log(db->handle, ALPM_LOG_ERROR, _("database path is undefined\n"));
RET_ERR(db->handle, ALPM_ERR_DB_OPEN, NULL);
}
if(db->is_local) {
if(db->status & DB_STATUS_LOCAL) {
pathsize = strlen(dbpath) + strlen(db->treename) + 2;
CALLOC(db->_path, 1, pathsize, RET_ERR(db->handle, ALPM_ERR_MEMORY, NULL));
sprintf(db->_path, "%s%s/", dbpath, db->treename);
@@ -375,24 +379,10 @@ const char *_alpm_db_path(alpm_db_t *db)
return db->_path;
}
char *_alpm_db_sig_path(alpm_db_t *db)
{
char *sigpath;
size_t len;
const char *dbfile = _alpm_db_path(db);
if(!db || !dbfile) {
return NULL;
}
len = strlen(dbfile) + strlen(".sig") + 1;
CALLOC(sigpath, len, sizeof(char), RET_ERR(db->handle, ALPM_ERR_MEMORY, NULL));
sprintf(sigpath, "%s.sig", dbfile);
return sigpath;
}
int _alpm_db_cmp(const void *d1, const void *d2)
{
alpm_db_t *db1 = (alpm_db_t *)d1;
alpm_db_t *db2 = (alpm_db_t *)d2;
const alpm_db_t *db1 = d1;
const alpm_db_t *db2 = d2;
return strcmp(db1->treename, db2->treename);
}
@@ -421,7 +411,7 @@ alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles)
for(j = list; j; j = j->next) {
alpm_pkg_t *pkg = j->data;
const char *matched = NULL;
const char *name = alpm_pkg_get_name(pkg);
const char *name = pkg->name;
const char *desc = alpm_pkg_get_desc(pkg);
/* check name as regex AND as plain text */
@@ -437,7 +427,8 @@ alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles)
if(!matched) {
/* check provides */
for(k = alpm_pkg_get_provides(pkg); k; k = k->next) {
if(regexec(&reg, k->data, 0, 0, 0) == 0) {
alpm_depend_t *provide = k->data;
if(regexec(&reg, provide->name, 0, 0, 0) == 0) {
matched = k->data;
break;
}
@@ -517,9 +508,11 @@ void _alpm_db_free_pkgcache(alpm_db_t *db)
_alpm_log(db->handle, ALPM_LOG_DEBUG,
"freeing package cache for repository '%s'\n", db->treename);
alpm_list_free_inner(_alpm_db_get_pkgcache(db),
if(db->pkgcache) {
alpm_list_free_inner(db->pkgcache->list,
(alpm_list_fn_free)_alpm_pkg_free);
_alpm_pkghash_free(db->pkgcache);
_alpm_pkghash_free(db->pkgcache);
}
db->status &= ~DB_STATUS_PKGCACHE;
free_groupcache(db);
@@ -562,13 +555,12 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg)
return -1;
}
newpkg = _alpm_pkg_dup(pkg);
if(newpkg == NULL) {
if(_alpm_pkg_dup(pkg, &newpkg)) {
return -1;
}
_alpm_log(db->handle, ALPM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n",
alpm_pkg_get_name(newpkg), db->treename);
newpkg->name, db->treename);
db->pkgcache = _alpm_pkghash_add_sorted(db->pkgcache, newpkg);
free_groupcache(db);
@@ -585,13 +577,13 @@ int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_t *pkg)
}
_alpm_log(db->handle, ALPM_LOG_DEBUG, "removing entry '%s' from '%s' cache\n",
alpm_pkg_get_name(pkg), db->treename);
pkg->name, db->treename);
db->pkgcache = _alpm_pkghash_remove(db->pkgcache, pkg, &data);
if(data == NULL) {
/* package not found */
_alpm_log(db->handle, ALPM_LOG_DEBUG, "cannot remove entry '%s' from '%s' cache: not found\n",
alpm_pkg_get_name(pkg), db->treename);
pkg->name, db->treename);
return -1;
}

View File

@@ -47,8 +47,13 @@ typedef enum _alpm_dbinfrq_t {
/** Database status. Bitflags. */
enum _alpm_dbstatus_t {
DB_STATUS_VALID = (1 << 0),
DB_STATUS_PKGCACHE = (1 << 1),
DB_STATUS_GRPCACHE = (1 << 2)
DB_STATUS_INVALID = (1 << 1),
DB_STATUS_EXISTS = (1 << 2),
DB_STATUS_MISSING = (1 << 3),
DB_STATUS_LOCAL = (1 << 10),
DB_STATUS_PKGCACHE = (1 << 11),
DB_STATUS_GRPCACHE = (1 << 12)
};
struct db_operations {
@@ -63,16 +68,13 @@ struct __alpm_db_t {
char *treename;
/* do not access directly, use _alpm_db_path(db) for lazy access */
char *_path;
/* also indicates whether we are RO or RW */
int is_local;
/* flags determining validity, loaded caches, etc. */
enum _alpm_dbstatus_t status;
alpm_pkghash_t *pkgcache;
alpm_list_t *grpcache;
alpm_list_t *servers;
alpm_siglevel_t siglevel;
struct db_operations *ops;
/* flags determining validity, local, loaded caches, etc. */
enum _alpm_dbstatus_t status;
alpm_siglevel_t siglevel;
};
@@ -80,7 +82,6 @@ struct __alpm_db_t {
alpm_db_t *_alpm_db_new(const char *treename, int is_local);
void _alpm_db_free(alpm_db_t *db);
const char *_alpm_db_path(alpm_db_t *db);
char *_alpm_db_sig_path(alpm_db_t *db);
int _alpm_db_cmp(const void *d1, const void *d2);
alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles);
alpm_db_t *_alpm_db_register_local(alpm_handle_t *handle);
@@ -92,6 +93,7 @@ void _alpm_db_unregister(alpm_db_t *db);
int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info);
int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq);
int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info);
char *_alpm_local_db_pkgpath(alpm_db_t *db, alpm_pkg_t *info, const char *filename);
/* cache bullshit */
/* packages */

View File

@@ -89,12 +89,28 @@ static void graph_init_size(alpm_handle_t *handle, alpm_list_t *vertices)
/* determine whether the delta file already exists */
fpath = _alpm_filecache_find(handle, vdelta->delta);
md5sum = alpm_compute_md5sum(fpath);
if(fpath && md5sum && strcmp(md5sum, vdelta->delta_md5) == 0) {
vdelta->download_size = 0;
if(fpath) {
md5sum = alpm_compute_md5sum(fpath);
if(md5sum && strcmp(md5sum, vdelta->delta_md5) == 0) {
vdelta->download_size = 0;
}
FREE(md5sum);
FREE(fpath);
} else {
char *fnamepart;
CALLOC(fnamepart, strlen(vdelta->delta) + 6, sizeof(char), return);
sprintf(fnamepart, "%s.part", vdelta->delta);
fpath = _alpm_filecache_find(handle, fnamepart);
if(fpath) {
struct stat st;
if(stat(fpath, &st) == 0) {
vdelta->download_size = vdelta->delta_size - st.st_size;
vdelta->download_size = vdelta->download_size < 0 ? 0 : vdelta->download_size;
}
FREE(fpath);
}
FREE(fnamepart);
}
FREE(fpath);
FREE(md5sum);
/* determine whether a base 'from' file exists */
fpath = _alpm_filecache_find(handle, vdelta->from);
@@ -249,12 +265,8 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota
alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(alpm_pkg_t *pkg)
{
off_t pkgsize = alpm_pkg_get_size(pkg);
alpm_list_t *unused = find_unused(
alpm_pkg_get_deltas(pkg),
alpm_pkg_get_filename(pkg),
pkgsize * MAX_DELTA_RATIO);
return unused;
ASSERT(pkg != NULL, return NULL);
return find_unused(pkg->deltas, pkg->filename, pkg->size * MAX_DELTA_RATIO);
}
/** @} */
@@ -299,7 +311,7 @@ alpm_delta_t *_alpm_delta_parse(char *line)
tmp2 = tmp;
tmp = strchr(tmp, ' ');
*(tmp++) = '\0';
delta->delta_size = atol(tmp2);
delta->delta_size = _alpm_strtoofft(tmp2);
tmp2 = tmp;
tmp = strchr(tmp, ' ');

View File

@@ -230,7 +230,7 @@ static alpm_pkg_t *find_dep_satisfier(alpm_list_t *pkgs, alpm_depend_t *dep)
{
alpm_list_t *i;
for(i = pkgs; i; i = alpm_list_next(i)) {
for(i = pkgs; i; i = i->next) {
alpm_pkg_t *pkg = i->data;
if(_alpm_depcmp(pkg, dep)) {
return pkg;
@@ -368,41 +368,38 @@ static int dep_vercmp(const char *version1, alpm_depmod_t mod,
return equal;
}
int _alpm_depcmp_literal(alpm_pkg_t *pkg, alpm_depend_t *dep)
{
if(pkg->name_hash != dep->name_hash
|| strcmp(pkg->name, dep->name) != 0) {
/* skip more expensive checks */
return 0;
}
return dep_vercmp(pkg->version, dep->mod, dep->version);
}
int _alpm_depcmp(alpm_pkg_t *pkg, alpm_depend_t *dep)
{
alpm_list_t *i;
int satisfy = 0;
int satisfy = _alpm_depcmp_literal(pkg, dep);
/* check (pkg->name, pkg->version) */
if(pkg->name_hash != dep->name_hash) {
/* skip more expensive checks */
} else {
satisfy = (strcmp(pkg->name, dep->name) == 0
&& dep_vercmp(pkg->version, dep->mod, dep->version));
if(satisfy) {
return satisfy;
}
if(satisfy) {
return satisfy;
}
/* check provisions, format : "name=version" */
/* check provisions, name and version if available */
for(i = alpm_pkg_get_provides(pkg); i && !satisfy; i = i->next) {
const char *provision = i->data;
const char *provver = strchr(provision, '=');
alpm_depend_t *provision = i->data;
if(provver == NULL) { /* no provision version */
satisfy = (dep->mod == ALPM_DEP_MOD_ANY
&& strcmp(provision, dep->name) == 0);
} else {
/* This is a bit tricker than the old code for performance reasons. To
* prevent the need to copy and duplicate strings, strncmp only the name
* portion if they are the same length, since there is a version and
* operator in play here. Cast is to silence sign conversion warning;
* we know provver >= provision if we are here. */
size_t namelen = (size_t)(provver - provision);
provver += 1;
satisfy = (strlen(dep->name) == namelen
&& strncmp(provision, dep->name, namelen) == 0
&& dep_vercmp(provver, dep->mod, dep->version));
if(dep->mod == ALPM_DEP_MOD_ANY) {
/* any version will satisfy the requirement */
satisfy = (provision->name_hash == dep->name_hash
&& strcmp(provision->name, dep->name) == 0);
} else if (provision->mod == ALPM_DEP_MOD_EQ) {
/* provision specifies a version, so try it out */
satisfy = (provision->name_hash == dep->name_hash
&& strcmp(provision->name, dep->name) == 0
&& dep_vercmp(provision->version, dep->mod, dep->version));
}
}
@@ -412,39 +409,51 @@ int _alpm_depcmp(alpm_pkg_t *pkg, alpm_depend_t *dep)
alpm_depend_t *_alpm_splitdep(const char *depstring)
{
alpm_depend_t *depend;
const char *ptr, *version = NULL;
const char *ptr, *version;
size_t deplen;
if(depstring == NULL) {
return NULL;
}
CALLOC(depend, 1, sizeof(alpm_depend_t), return NULL);
MALLOC(depend, sizeof(alpm_depend_t), return NULL);
deplen = strlen(depstring);
/* 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. */
if((ptr = strstr(depstring, ">="))) {
depend->mod = ALPM_DEP_MOD_GE;
version = ptr + 2;
} else if((ptr = strstr(depstring, "<="))) {
depend->mod = ALPM_DEP_MOD_LE;
version = ptr + 2;
} else if((ptr = strstr(depstring, "="))) {
if((ptr = memchr(depstring, '<', deplen))) {
if(ptr[1] == '=') {
depend->mod = ALPM_DEP_MOD_LE;
version = ptr + 2;
} else {
depend->mod = ALPM_DEP_MOD_LT;
version = ptr + 1;
}
} else if((ptr = memchr(depstring, '>', deplen))) {
if(ptr[1] == '=') {
depend->mod = ALPM_DEP_MOD_GE;
version = ptr + 2;
} else {
depend->mod = ALPM_DEP_MOD_GT;
version = ptr + 1;
}
} else if((ptr = memchr(depstring, '=', deplen))) {
/* Note: we must do =,<,> checks after <=, >= checks */
depend->mod = ALPM_DEP_MOD_EQ;
version = ptr + 1;
} else if((ptr = strstr(depstring, "<"))) {
depend->mod = ALPM_DEP_MOD_LT;
version = ptr + 1;
} else if((ptr = strstr(depstring, ">"))) {
depend->mod = ALPM_DEP_MOD_GT;
version = ptr + 1;
} else {
/* no version specified, leave version and ptr NULL */
/* no version specified, leave ptr NULL and set version to NULL */
depend->mod = ALPM_DEP_MOD_ANY;
depend->version = NULL;
version = NULL;
}
/* copy the right parts to the right places */
STRNDUP(depend->name, depstring, ptr - depstring, return NULL);
if(ptr) {
STRNDUP(depend->name, depstring, ptr - depstring, return NULL);
} else {
STRDUP(depend->name, depstring, return NULL);
}
depend->name_hash = _alpm_hash_sdbm(depend->name);
if(version) {
STRDUP(depend->version, version, return NULL);
@@ -515,13 +524,14 @@ static int can_remove_package(alpm_db_t *db, alpm_pkg_t *pkg,
* @param db package database to do dependency tracing in
* @param *targs pointer to a list of packages
* @param include_explicit if 0, explicitly installed packages are not included
* @return 0 on success, -1 on errors
*/
void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit)
int _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit)
{
alpm_list_t *i, *j;
if(db == NULL || targs == NULL) {
return;
return -1;
}
for(i = targs; i; i = i->next) {
@@ -530,13 +540,18 @@ void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit)
alpm_pkg_t *deppkg = j->data;
if(_alpm_dep_edge(pkg, deppkg)
&& can_remove_package(db, deppkg, targs, include_explicit)) {
alpm_pkg_t *copy;
_alpm_log(db->handle, ALPM_LOG_DEBUG, "adding '%s' to the targets\n",
deppkg->name);
/* add it to the target list */
targs = alpm_list_add(targs, _alpm_pkg_dup(deppkg));
if(_alpm_pkg_dup(deppkg, &copy)) {
return -1;
}
targs = alpm_list_add(targs, copy);
}
}
}
return 0;
}
/**
@@ -564,14 +579,16 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep,
/* 1. literals */
for(i = dbs; i; i = i->next) {
alpm_pkg_t *pkg = _alpm_db_get_pkgfromcache(i->data, dep->name);
if(pkg && _alpm_depcmp(pkg, dep) && !_alpm_pkg_find(excluding, pkg->name)) {
if(pkg && _alpm_depcmp_literal(pkg, dep)
&& !_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(handle, pkg)) {
int install = 0;
if(prompt) {
QUESTION(handle->trans, ALPM_TRANS_CONV_INSTALL_IGNOREPKG, pkg,
QUESTION(handle, ALPM_QUESTION_INSTALL_IGNOREPKG, pkg,
NULL, NULL, &install);
} else {
_alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version);
_alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"),
pkg->name, pkg->version);
}
if(!install) {
ignored = 1;
@@ -585,15 +602,18 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep,
for(i = dbs; i; i = i->next) {
for(j = _alpm_db_get_pkgcache(i->data); j; j = j->next) {
alpm_pkg_t *pkg = j->data;
if(_alpm_depcmp(pkg, dep) && strcmp(pkg->name, dep->name) != 0 &&
!_alpm_pkg_find(excluding, pkg->name)) {
/* with hash != hash, we can even skip the strcmp() as we know they can't
* possibly be the same string */
if(pkg->name_hash != dep->name_hash && _alpm_depcmp(pkg, dep)
&& !_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(handle, pkg)) {
int install = 0;
if(prompt) {
QUESTION(handle->trans, ALPM_TRANS_CONV_INSTALL_IGNOREPKG,
QUESTION(handle, ALPM_QUESTION_INSTALL_IGNOREPKG,
pkg, NULL, NULL, &install);
} else {
_alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version);
_alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"),
pkg->name, pkg->version);
}
if(!install) {
ignored = 1;
@@ -611,7 +631,7 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep,
/* first check if one provider is already installed locally */
for(i = providers; i; i = i->next) {
alpm_pkg_t *pkg = i->data;
if(_alpm_pkghash_find(_alpm_db_get_pkgcache_hash(handle->db_local), pkg->name)) {
if(_alpm_db_get_pkgfromcache(handle->db_local, pkg->name)) {
alpm_list_free(providers);
return pkg;
}
@@ -622,11 +642,12 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep,
int index = 0;
if(count > 1) {
/* if there is more than one provider, we ask the user */
QUESTION(handle->trans, ALPM_TRANS_CONV_SELECT_PROVIDER,
QUESTION(handle, ALPM_QUESTION_SELECT_PROVIDER,
providers, dep, NULL, &index);
}
if(index >= 0 && index < count) {
alpm_pkg_t *pkg = alpm_list_getdata(alpm_list_nth(providers, index));
alpm_list_t *nth = alpm_list_nth(providers, index);
alpm_pkg_t *pkg = nth->data;
alpm_list_free(providers);
return pkg;
}
@@ -674,6 +695,7 @@ alpm_pkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle,
* @param handle the context handle
* @param localpkgs is the list of local packages
* @param pkg is the package to resolve
* @param preferred packages to prefer when resolving
* @param packages is a pointer to a list of packages which will be
* searched first for any dependency packages needed to complete the
* resolve, and to which will be added any [pkg] and all of its

View File

@@ -31,11 +31,12 @@ void _alpm_dep_free(alpm_depend_t *dep);
alpm_depend_t *_alpm_dep_dup(const alpm_depend_t *dep);
void _alpm_depmiss_free(alpm_depmissing_t *miss);
alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_list_t *targets, int reverse);
void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit);
int _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit);
int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t *pkg,
alpm_list_t *preferred, alpm_list_t **packages, alpm_list_t *remove,
alpm_list_t **data);
alpm_depend_t *_alpm_splitdep(const char *depstring);
int _alpm_depcmp_literal(alpm_pkg_t *pkg, alpm_depend_t *dep);
int _alpm_depcmp(alpm_pkg_t *pkg, alpm_depend_t *dep);
#endif /* _ALPM_DEPS_H */

View File

@@ -104,7 +104,7 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle)
}
for(; entries-- > 0; fsp++) {
CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(ALPM_ERR_MEMORY, NULL));
CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
mp->mount_dir = strdup(fsp->f_mntonname);
mp->mount_dir_len = strlen(mp->mount_dir);
memcpy(&(mp->fsp), fsp, sizeof(FSSTATSTYPE));
@@ -179,7 +179,7 @@ static int calculate_removed_size(alpm_handle_t *handle,
/* the addition of (divisor - 1) performs ceil() with integer division */
mp->blocks_needed -=
(st.st_size + mp->fsp.f_bsize - 1l) / mp->fsp.f_bsize;
(st.st_size + mp->fsp.f_bsize - 1) / mp->fsp.f_bsize;
mp->used |= USED_REMOVE;
}
@@ -211,7 +211,7 @@ static int calculate_installed_size(alpm_handle_t *handle,
/* approximate space requirements for db entries */
if(filename[0] == '.') {
filename = alpm_option_get_dbpath(handle);
filename = handle->dbpath;
}
snprintf(path, PATH_MAX, "%s%s", handle->root, filename);
@@ -225,7 +225,7 @@ static int calculate_installed_size(alpm_handle_t *handle,
/* the addition of (divisor - 1) performs ceil() with integer division */
mp->blocks_needed +=
(file->size + mp->fsp.f_bsize - 1l) / mp->fsp.f_bsize;
(file->size + mp->fsp.f_bsize - 1) / mp->fsp.f_bsize;
mp->used |= USED_INSTALL;
}
@@ -251,7 +251,8 @@ int _alpm_check_diskspace(alpm_handle_t *handle)
if(root_mp == NULL) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not determine root mount point %s\n"),
handle->root);
return -1;
error = 1;
goto finish;
}
replaces = alpm_list_count(trans->remove);
@@ -260,7 +261,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle)
for(targ = trans->remove; targ; targ = targ->next, current++) {
alpm_pkg_t *local_pkg;
int percent = (current * 100) / numtargs;
PROGRESS(trans, ALPM_TRANS_PROGRESS_DISKSPACE_START, "", percent,
PROGRESS(handle, ALPM_PROGRESS_DISKSPACE_START, "", percent,
numtargs, current);
local_pkg = targ->data;
@@ -271,7 +272,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle)
for(targ = trans->add; targ; targ = targ->next, current++) {
alpm_pkg_t *pkg, *local_pkg;
int percent = (current * 100) / numtargs;
PROGRESS(trans, ALPM_TRANS_PROGRESS_DISKSPACE_START, "", percent,
PROGRESS(handle, ALPM_PROGRESS_DISKSPACE_START, "", percent,
numtargs, current);
pkg = targ->data;
@@ -282,7 +283,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle)
}
calculate_installed_size(handle, mount_points, pkg);
for(i = mount_points; i; i = alpm_list_next(i)) {
for(i = mount_points; i; i = i->next) {
alpm_mountpoint_t *data = i->data;
if(data->blocks_needed > data->max_blocks_needed) {
data->max_blocks_needed = data->blocks_needed;
@@ -290,10 +291,10 @@ int _alpm_check_diskspace(alpm_handle_t *handle)
}
}
PROGRESS(trans, ALPM_TRANS_PROGRESS_DISKSPACE_START, "", 100,
PROGRESS(handle, ALPM_PROGRESS_DISKSPACE_START, "", 100,
numtargs, current);
for(i = mount_points; i; i = alpm_list_next(i)) {
for(i = mount_points; i; i = i->next) {
alpm_mountpoint_t *data = i->data;
if(data->used && data->read_only) {
_alpm_log(handle, ALPM_LOG_ERROR, _("Partition %s is mounted read only\n"),
@@ -301,24 +302,26 @@ int _alpm_check_diskspace(alpm_handle_t *handle)
error = 1;
} else if(data->used & USED_INSTALL) {
/* cushion is roughly min(5% capacity, 20MiB) */
long fivepc = ((long)data->fsp.f_blocks / 20) + 1;
long twentymb = (20 * 1024 * 1024 / (long)data->fsp.f_bsize) + 1;
long cushion = fivepc < twentymb ? fivepc : twentymb;
fsblkcnt_t fivepc = (data->fsp.f_blocks / 20) + 1;
fsblkcnt_t twentymb = (20 * 1024 * 1024 / data->fsp.f_bsize) + 1;
fsblkcnt_t cushion = fivepc < twentymb ? fivepc : twentymb;
blkcnt_t needed = data->max_blocks_needed + cushion;
_alpm_log(handle, ALPM_LOG_DEBUG, "partition %s, needed %ld, cushion %ld, free %ld\n",
data->mount_dir, data->max_blocks_needed, cushion,
(unsigned long)data->fsp.f_bfree);
if(data->max_blocks_needed + cushion >= 0 &&
(unsigned long)(data->max_blocks_needed + cushion) > data->fsp.f_bfree) {
_alpm_log(handle, ALPM_LOG_ERROR, _("Partition %s too full: %ld blocks needed, %ld blocks free\n"),
data->mount_dir, data->max_blocks_needed + cushion,
(unsigned long)data->fsp.f_bfree);
_alpm_log(handle, ALPM_LOG_DEBUG,
"partition %s, needed %jd, cushion %ju, free %ju\n",
data->mount_dir, (intmax_t)data->max_blocks_needed,
(uintmax_t)cushion, (uintmax_t)data->fsp.f_bfree);
if(needed >= 0 && (fsblkcnt_t)needed > data->fsp.f_bfree) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("Partition %s too full: %jd blocks needed, %jd blocks free\n"),
data->mount_dir, (intmax_t)needed, (uintmax_t)data->fsp.f_bfree);
error = 1;
}
}
}
for(i = mount_points; i; i = alpm_list_next(i)) {
finish:
for(i = mount_points; i; i = i->next) {
alpm_mountpoint_t *data = i->data;
FREE(data->mount_dir);
}

View File

@@ -26,6 +26,9 @@
#if defined(HAVE_SYS_STATVFS_H)
#include <sys/statvfs.h>
#endif
#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
#include "alpm.h"
@@ -39,8 +42,8 @@ typedef struct __alpm_mountpoint_t {
char *mount_dir;
size_t mount_dir_len;
/* storage for additional disk usage calculations */
long blocks_needed;
long max_blocks_needed;
blkcnt_t blocks_needed;
blkcnt_t max_blocks_needed;
enum mount_used_level used;
int read_only;
FSSTATSTYPE fsp;

View File

@@ -43,8 +43,6 @@
#include "handle.h"
#ifdef HAVE_LIBCURL
static double prevprogress; /* last download amount */
static const char *get_filename(const char *url)
{
char *filename = strrchr(url, '/');
@@ -60,64 +58,83 @@ static char *get_fullpath(const char *path, const char *filename,
char *filepath;
/* len = localpath len + filename len + suffix len + null */
size_t len = strlen(path) + strlen(filename) + strlen(suffix) + 1;
CALLOC(filepath, len, sizeof(char), return NULL);
MALLOC(filepath, len, return NULL);
snprintf(filepath, len, "%s%s%s", path, filename, suffix);
return filepath;
}
#define check_stop() if(dload_interrupted) { ret = -1; goto cleanup; }
enum sighandlers { OLD = 0, NEW = 1 };
static CURL *get_libcurl_handle(alpm_handle_t *handle)
{
if(!handle->curl) {
curl_global_init(CURL_GLOBAL_SSL);
handle->curl = curl_easy_init();
}
return handle->curl;
}
enum {
ABORT_SIGINT = 1,
ABORT_OVER_MAXFILESIZE
};
static int dload_interrupted;
static void inthandler(int UNUSED signum)
{
dload_interrupted = 1;
dload_interrupted = ABORT_SIGINT;
}
static int curl_progress(void *file, double dltotal, double dlnow,
double UNUSED ultotal, double UNUSED ulnow)
{
struct dload_payload *payload = (struct dload_payload *)file;
double current_size, total_size;
off_t current_size, total_size;
/* SIGINT sent, abort by alerting curl */
if(dload_interrupted) {
return 1;
}
current_size = payload->initial_size + (off_t)dlnow;
/* is our filesize still under any set limit? */
if(payload->max_size && current_size > payload->max_size) {
dload_interrupted = ABORT_OVER_MAXFILESIZE;
return 1;
}
/* none of what follows matters if the front end has no callback */
if(payload->handle->dlcb == NULL) {
return 0;
}
current_size = payload->initial_size + dlnow;
total_size = payload->initial_size + dltotal;
total_size = payload->initial_size + (off_t)dltotal;
if(DOUBLE_EQ(dltotal, 0) || DOUBLE_EQ(prevprogress, total_size)) {
if(DOUBLE_EQ(dltotal, 0.0) || payload->prevprogress == total_size) {
return 0;
}
/* initialize the progress bar here to avoid displaying it when
* a repo is up to date and nothing gets downloaded */
if(DOUBLE_EQ(prevprogress, 0)) {
payload->handle->dlcb(payload->filename, 0, (long)dltotal);
if(payload->prevprogress == 0) {
payload->handle->dlcb(payload->remote_name, 0, (off_t)dltotal);
}
payload->handle->dlcb(payload->filename, (long)current_size, (long)total_size);
payload->handle->dlcb(payload->remote_name, current_size, total_size);
prevprogress = current_size;
payload->prevprogress = current_size;
return 0;
}
static int curl_gethost(const char *url, char *buffer)
static int curl_gethost(const char *url, char *buffer, size_t buf_len)
{
size_t hostlen;
char *p;
char *p, *q;
if(strncmp(url, "file://", 7) == 0) {
strcpy(buffer, _("disk"));
p = _("disk");
hostlen = strlen(p);
} else {
p = strstr(url, "//");
if(!p) {
@@ -125,13 +142,28 @@ static int curl_gethost(const char *url, char *buffer)
}
p += 2; /* jump over the found // */
hostlen = strcspn(p, "/");
if(hostlen > 255) {
/* buffer overflow imminent */
return 1;
/* there might be a user:pass@ on the URL. hide it. avoid using memrchr()
* for portability concerns. */
q = p + hostlen;
while(--q > p) {
if(*q == '@') {
break;
}
}
if(*q == '@' && p != q) {
hostlen -= q - p + 1;
p = q + 1;
}
snprintf(buffer, hostlen + 1, "%s", p);
}
if(hostlen > buf_len - 1) {
/* buffer overflow imminent */
return 1;
}
memcpy(buffer, p, hostlen);
buffer[hostlen] = '\0';
return 0;
}
@@ -146,6 +178,14 @@ static int utimes_long(const char *path, long seconds)
return 0;
}
/* prefix to avoid possible future clash with getumask(3) */
static mode_t _getumask(void)
{
mode_t mask = umask(0);
umask(mask);
return mask;
}
static size_t parse_headers(void *ptr, size_t size, size_t nmemb, void *user)
{
size_t realsize = size * nmemb;
@@ -169,7 +209,7 @@ static size_t parse_headers(void *ptr, size_t size, size_t nmemb, void *user)
endptr--;
}
STRNDUP(payload->cd_filename, fptr, endptr - fptr + 1,
STRNDUP(payload->content_disp_name, fptr, endptr - fptr + 1,
RET_ERR(payload->handle, ALPM_ERR_MEMORY, realsize));
}
}
@@ -177,162 +217,248 @@ static size_t parse_headers(void *ptr, size_t size, size_t nmemb, void *user)
return realsize;
}
static void curl_set_handle_opts(struct dload_payload *payload,
CURL *curl, char *error_buffer)
{
alpm_handle_t *handle = payload->handle;
const char *useragent = getenv("HTTP_USER_AGENT");
struct stat st;
/* the curl_easy handle is initialized with the alpm handle, so we only need
* to reset the handle's parameters for each time it's used. */
curl_easy_reset(curl);
curl_easy_setopt(curl, CURLOPT_URL, payload->fileurl);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error_buffer);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10L);
curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, curl_progress);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, (void *)payload);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024L);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, parse_headers);
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, (void *)payload);
curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
_alpm_log(handle, ALPM_LOG_DEBUG, "url: %s\n", payload->fileurl);
if(payload->max_size) {
_alpm_log(handle, ALPM_LOG_DEBUG, "maxsize: %jd\n",
(intmax_t)payload->max_size);
curl_easy_setopt(curl, CURLOPT_MAXFILESIZE_LARGE,
(curl_off_t)payload->max_size);
}
if(useragent != NULL) {
curl_easy_setopt(curl, CURLOPT_USERAGENT, useragent);
}
if(!payload->allow_resume && !payload->force && payload->destfile_name &&
stat(payload->destfile_name, &st) == 0) {
/* start from scratch, but only download if our local is out of date. */
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, (long)st.st_mtime);
_alpm_log(handle, ALPM_LOG_DEBUG,
"using time condition: %lu\n", (long)st.st_mtime);
} else if(stat(payload->tempfile_name, &st) == 0 && payload->allow_resume) {
/* a previous partial download exists, resume from end of file. */
payload->tempfile_openmode = "ab";
curl_easy_setopt(curl, CURLOPT_RESUME_FROM_LARGE, (curl_off_t)st.st_size);
_alpm_log(handle, ALPM_LOG_DEBUG,
"tempfile found, attempting continuation from %jd bytes\n",
(intmax_t)st.st_size);
payload->initial_size = st.st_size;
}
}
static void mask_signal(int signal, void (*handler)(int),
struct sigaction *origaction)
{
struct sigaction newaction;
newaction.sa_handler = handler;
sigemptyset(&newaction.sa_mask);
newaction.sa_flags = 0;
sigaction(signal, NULL, origaction);
sigaction(signal, &newaction, NULL);
}
static void unmask_signal(int signal, struct sigaction sa)
{
sigaction(signal, &sa, NULL);
}
static FILE *create_tempfile(struct dload_payload *payload, const char *localpath)
{
int fd;
FILE *fp;
char *randpath;
size_t len;
/* create a random filename, which is opened with O_EXCL */
len = strlen(localpath) + 14 + 1;
MALLOC(randpath, len, RET_ERR(payload->handle, ALPM_ERR_MEMORY, NULL));
snprintf(randpath, len, "%salpmtmp.XXXXXX", localpath);
if((fd = mkstemp(randpath)) == -1 ||
fchmod(fd, ~(_getumask()) & 0666) ||
!(fp = fdopen(fd, payload->tempfile_openmode))) {
unlink(randpath);
if(fd >= 0) {
close(fd);
}
_alpm_log(payload->handle, ALPM_LOG_ERROR,
_("failed to create temporary file for download\n"));
return NULL;
}
/* fp now points to our alpmtmp.XXXXXX */
free(payload->tempfile_name);
payload->tempfile_name = randpath;
free(payload->remote_name);
STRDUP(payload->remote_name, strrchr(randpath, '/') + 1,
RET_ERR(payload->handle, ALPM_ERR_MEMORY, NULL));
return fp;
}
/* RFC1123 states applications should support this length */
#define HOSTNAME_SIZE 256
static int curl_download_internal(struct dload_payload *payload,
const char *localpath, char **final_file)
{
int ret = -1, should_unlink = 0;
int ret = -1;
FILE *localf = NULL;
const char *useragent;
const char *open_mode = "wb";
char *destfile = NULL, *tempfile = NULL, *effective_url;
/* RFC1123 states applications should support this length */
char hostname[256];
char error_buffer[CURL_ERROR_SIZE];
char *effective_url;
char hostname[HOSTNAME_SIZE];
char error_buffer[CURL_ERROR_SIZE] = {0};
struct stat st;
long timecond, remote_time = -1;
long timecond, respcode = 0, remote_time = -1;
double remote_size, bytes_dl;
struct sigaction sig_pipe[2], sig_int[2];
struct sigaction orig_sig_pipe, orig_sig_int;
/* shortcut to our handle within the payload */
alpm_handle_t *handle = payload->handle;
CURL *curl = get_libcurl_handle(handle);
handle->pm_errno = 0;
if(!payload->filename) {
payload->filename = get_filename(payload->fileurl);
payload->tempfile_openmode = "wb";
if(!payload->remote_name) {
STRDUP(payload->remote_name, get_filename(payload->fileurl),
RET_ERR(handle, ALPM_ERR_MEMORY, -1));
}
if(!payload->filename || curl_gethost(payload->fileurl, hostname) != 0) {
if(curl_gethost(payload->fileurl, hostname, sizeof(hostname)) != 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("url '%s' is invalid\n"), payload->fileurl);
RET_ERR(handle, ALPM_ERR_SERVER_BAD_URL, -1);
}
if(strlen(payload->filename) > 0 && strcmp(payload->filename, ".sig") != 0) {
destfile = get_fullpath(localpath, payload->filename, "");
tempfile = get_fullpath(localpath, payload->filename, ".part");
if(!destfile || !tempfile) {
if(strlen(payload->remote_name) > 0 && strcmp(payload->remote_name, ".sig") != 0) {
payload->destfile_name = get_fullpath(localpath, payload->remote_name, "");
payload->tempfile_name = get_fullpath(localpath, payload->remote_name, ".part");
if(!payload->destfile_name || !payload->tempfile_name) {
goto cleanup;
}
} else {
/* URL isn't to a file and ended with a slash */
int fd;
char randpath[PATH_MAX];
/* URL doesn't contain a filename, so make a tempfile. We can't support
* resuming this kind of download; partial transfers will be destroyed */
payload->unlink_on_fail = 1;
/* we can't support resuming this kind of download, so a partial transfer
* will be destroyed */
should_unlink = 1;
/* create a random filename, which is opened with O_EXCL */
snprintf(randpath, PATH_MAX, "%salpmtmp.XXXXXX", localpath);
if((fd = mkstemp(randpath)) == -1 || !(localf = fdopen(fd, open_mode))) {
unlink(randpath);
close(fd);
_alpm_log(handle, ALPM_LOG_ERROR,
_("failed to create temporary file for download\n"));
goto cleanup;
}
/* localf now points to our alpmtmp.XXXXXX */
STRDUP(tempfile, randpath, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
payload->filename = strrchr(randpath, '/') + 1;
}
error_buffer[0] = '\0';
/* the curl_easy handle is initialized with the alpm handle, so we only need
* to reset the curl handle set parameters for each time it's used. */
curl_easy_reset(handle->curl);
curl_easy_setopt(handle->curl, CURLOPT_URL, payload->fileurl);
curl_easy_setopt(handle->curl, CURLOPT_FAILONERROR, 1L);
curl_easy_setopt(handle->curl, CURLOPT_ERRORBUFFER, error_buffer);
curl_easy_setopt(handle->curl, CURLOPT_CONNECTTIMEOUT, 10L);
curl_easy_setopt(handle->curl, CURLOPT_FILETIME, 1L);
curl_easy_setopt(handle->curl, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(handle->curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(handle->curl, CURLOPT_PROGRESSFUNCTION, curl_progress);
curl_easy_setopt(handle->curl, CURLOPT_PROGRESSDATA, (void *)payload);
curl_easy_setopt(handle->curl, CURLOPT_LOW_SPEED_LIMIT, 1024L);
curl_easy_setopt(handle->curl, CURLOPT_LOW_SPEED_TIME, 10L);
curl_easy_setopt(handle->curl, CURLOPT_HEADERFUNCTION, parse_headers);
curl_easy_setopt(handle->curl, CURLOPT_WRITEHEADER, (void *)payload);
if(payload->max_size) {
curl_easy_setopt(handle->curl, CURLOPT_MAXFILESIZE, payload->max_size);
}
useragent = getenv("HTTP_USER_AGENT");
if(useragent != NULL) {
curl_easy_setopt(handle->curl, CURLOPT_USERAGENT, useragent);
}
if(!payload->allow_resume && !payload->force && stat(destfile, &st) == 0) {
/* start from scratch, but only download if our local is out of date. */
curl_easy_setopt(handle->curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
curl_easy_setopt(handle->curl, CURLOPT_TIMEVALUE, (long)st.st_mtime);
} else if(stat(tempfile, &st) == 0 && payload->allow_resume) {
/* a previous partial download exists, resume from end of file. */
open_mode = "ab";
curl_easy_setopt(handle->curl, CURLOPT_RESUME_FROM, (long)st.st_size);
_alpm_log(handle, ALPM_LOG_DEBUG, "tempfile found, attempting continuation\n");
payload->initial_size = (double)st.st_size;
}
if(localf == NULL) {
localf = fopen(tempfile, open_mode);
localf = create_tempfile(payload, localpath);
if(localf == NULL) {
goto cleanup;
}
}
curl_easy_setopt(handle->curl, CURLOPT_WRITEDATA, localf);
curl_set_handle_opts(payload, curl, error_buffer);
if(localf == NULL) {
localf = fopen(payload->tempfile_name, payload->tempfile_openmode);
if(localf == NULL) {
goto cleanup;
}
}
_alpm_log(handle, ALPM_LOG_DEBUG,
"opened tempfile for download: %s (%s)\n", payload->tempfile_name,
payload->tempfile_openmode);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, localf);
/* ignore any SIGPIPE signals- these may occur if our FTP socket dies or
* something along those lines. Store the old signal handler first. */
sig_pipe[NEW].sa_handler = SIG_IGN;
sigemptyset(&sig_pipe[NEW].sa_mask);
sig_pipe[NEW].sa_flags = 0;
sigaction(SIGPIPE, NULL, &sig_pipe[OLD]);
sigaction(SIGPIPE, &sig_pipe[NEW], NULL);
dload_interrupted = 0;
sig_int[NEW].sa_handler = &inthandler;
sigemptyset(&sig_int[NEW].sa_mask);
sig_int[NEW].sa_flags = 0;
sigaction(SIGINT, NULL, &sig_int[OLD]);
sigaction(SIGINT, &sig_int[NEW], NULL);
/* Progress 0 - initialize */
prevprogress = 0;
mask_signal(SIGPIPE, SIG_IGN, &orig_sig_pipe);
mask_signal(SIGINT, &inthandler, &orig_sig_int);
/* perform transfer */
handle->curlerr = curl_easy_perform(handle->curl);
payload->curlerr = curl_easy_perform(curl);
/* immediately unhook the progress callback */
curl_easy_setopt(handle->curl, CURLOPT_NOPROGRESS, 1L);
/* disconnect relationships from the curl handle for things that might go out
* of scope, but could still be touched on connection teardown. This really
* only applies to FTP transfers. See FS#26327 for an example. */
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, (char *)NULL);
/* was it a success? */
if(handle->curlerr == CURLE_ABORTED_BY_CALLBACK) {
goto cleanup;
} else if(handle->curlerr != CURLE_OK) {
if(!payload->errors_ok) {
handle->pm_errno = ALPM_ERR_LIBCURL;
_alpm_log(handle, ALPM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"),
payload->filename, hostname, error_buffer);
} else {
_alpm_log(handle, ALPM_LOG_DEBUG, "failed retrieving file '%s' from %s : %s\n",
payload->filename, hostname, error_buffer);
}
unlink(tempfile);
goto cleanup;
switch(payload->curlerr) {
case CURLE_OK:
/* get http/ftp response code */
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &respcode);
_alpm_log(handle, ALPM_LOG_DEBUG, "response code: %ld\n", respcode);
if(respcode >= 400) {
payload->unlink_on_fail = 1;
/* non-translated message is same as libcurl */
snprintf(error_buffer, sizeof(error_buffer),
"The requested URL returned error: %ld", respcode);
_alpm_log(handle, ALPM_LOG_ERROR,
_("failed retrieving file '%s' from %s : %s\n"),
payload->remote_name, hostname, error_buffer);
goto cleanup;
}
break;
case CURLE_ABORTED_BY_CALLBACK:
/* handle the interrupt accordingly */
if(dload_interrupted == ABORT_OVER_MAXFILESIZE) {
payload->curlerr = CURLE_FILESIZE_EXCEEDED;
handle->pm_errno = ALPM_ERR_LIBCURL;
/* use the 'size exceeded' message from libcurl */
_alpm_log(handle, ALPM_LOG_ERROR,
_("failed retrieving file '%s' from %s : %s\n"),
payload->remote_name, hostname,
curl_easy_strerror(CURLE_FILESIZE_EXCEEDED));
}
goto cleanup;
default:
/* delete zero length downloads */
if(fstat(fileno(localf), &st) == 0 && st.st_size == 0) {
payload->unlink_on_fail = 1;
}
if(!payload->errors_ok) {
handle->pm_errno = ALPM_ERR_LIBCURL;
_alpm_log(handle, ALPM_LOG_ERROR,
_("failed retrieving file '%s' from %s : %s\n"),
payload->remote_name, hostname, error_buffer);
} else {
_alpm_log(handle, ALPM_LOG_DEBUG,
"failed retrieving file '%s' from %s : %s\n",
payload->remote_name, hostname, error_buffer);
}
goto cleanup;
}
/* retrieve info about the state of the transfer */
curl_easy_getinfo(handle->curl, CURLINFO_FILETIME, &remote_time);
curl_easy_getinfo(handle->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &remote_size);
curl_easy_getinfo(handle->curl, CURLINFO_SIZE_DOWNLOAD, &bytes_dl);
curl_easy_getinfo(handle->curl, CURLINFO_CONDITION_UNMET, &timecond);
curl_easy_getinfo(handle->curl, CURLINFO_EFFECTIVE_URL, &effective_url);
curl_easy_getinfo(curl, CURLINFO_FILETIME, &remote_time);
curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &remote_size);
curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &bytes_dl);
curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &timecond);
curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &effective_url);
/* time condition was met and we didn't download anything. we need to
* clean up the 0 byte .part file that's left behind. */
if(timecond == 1 && DOUBLE_EQ(bytes_dl, 0)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "file met time condition\n");
ret = 1;
unlink(tempfile);
unlink(payload->tempfile_name);
goto cleanup;
}
@@ -343,26 +469,27 @@ static int curl_download_internal(struct dload_payload *payload,
!DOUBLE_EQ(bytes_dl, remote_size)) {
handle->pm_errno = ALPM_ERR_RETRIEVE;
_alpm_log(handle, ALPM_LOG_ERROR, _("%s appears to be truncated: %jd/%jd bytes\n"),
payload->filename, (intmax_t)bytes_dl, (intmax_t)remote_size);
payload->remote_name, (intmax_t)bytes_dl, (intmax_t)remote_size);
goto cleanup;
}
if(payload->cd_filename) {
if(payload->content_disp_name) {
/* content-disposition header has a better name for our file */
free(destfile);
destfile = get_fullpath(localpath, payload->cd_filename, "");
free(payload->destfile_name);
payload->destfile_name = get_fullpath(localpath, payload->content_disp_name, "");
} else {
const char *effective_filename = strrchr(effective_url, '/');
if(effective_filename) {
if(effective_filename && strlen(effective_filename) > 2) {
effective_filename++;
/* if destfile was never set, we wrote to a tempfile. even if destfile is
* set, we may have followed some redirects and the effective url may
* have a better suggestion as to what to name our file. in either case,
* refactor destfile to this newly derived name. */
if(!destfile || strcmp(effective_filename, strrchr(destfile, '/') + 1) != 0) {
free(destfile);
destfile = get_fullpath(localpath, effective_filename, "");
if(!payload->destfile_name || strcmp(effective_filename,
strrchr(payload->destfile_name, '/') + 1) != 0) {
free(payload->destfile_name);
payload->destfile_name = get_fullpath(localpath, effective_filename, "");
}
}
}
@@ -372,29 +499,33 @@ static int curl_download_internal(struct dload_payload *payload,
cleanup:
if(localf != NULL) {
fclose(localf);
utimes_long(tempfile, remote_time);
utimes_long(payload->tempfile_name, remote_time);
}
if(ret == 0) {
if(rename(tempfile, destfile)) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
tempfile, destfile, strerror(errno));
ret = -1;
} else if(final_file) {
*final_file = strdup(strrchr(destfile, '/') + 1);
const char *realname = payload->tempfile_name;
if(payload->destfile_name) {
realname = payload->destfile_name;
if(rename(payload->tempfile_name, payload->destfile_name)) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
payload->tempfile_name, payload->destfile_name, strerror(errno));
ret = -1;
}
}
if(ret != -1 && final_file) {
STRDUP(*final_file, strrchr(realname, '/') + 1,
RET_ERR(handle, ALPM_ERR_MEMORY, -1));
}
}
if(dload_interrupted && should_unlink) {
unlink(tempfile);
if((ret == -1 || dload_interrupted) && payload->unlink_on_fail &&
payload->tempfile_name) {
unlink(payload->tempfile_name);
}
FREE(tempfile);
FREE(destfile);
/* restore the old signal handlers */
sigaction(SIGINT, &sig_int[OLD], NULL);
sigaction(SIGPIPE, &sig_pipe[OLD], NULL);
unmask_signal(SIGINT, orig_sig_int);
unmask_signal(SIGPIPE, orig_sig_pipe);
/* if we were interrupted, trip the old handler */
if(dload_interrupted) {
raise(SIGINT);
@@ -437,23 +568,26 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url)
char *filepath;
const char *cachedir;
char *final_file = NULL;
struct dload_payload *payload;
struct dload_payload payload;
int ret;
CHECK_HANDLE(handle, return NULL);
ASSERT(url, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, NULL));
/* find a valid cache dir to download to */
cachedir = _alpm_filecache_setup(handle);
CALLOC(payload, 1, sizeof(*payload), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
payload->handle = handle;
payload->fileurl = strdup(url);
payload->allow_resume = 1;
memset(&payload, 0, sizeof(struct dload_payload));
payload.handle = handle;
STRDUP(payload.fileurl, url, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
payload.allow_resume = 1;
/* download the file */
ret = _alpm_download(payload, cachedir, &final_file);
ret = _alpm_download(&payload, cachedir, &final_file);
_alpm_dload_payload_reset(&payload);
if(ret == -1) {
_alpm_log(handle, ALPM_LOG_WARNING, _("failed to download %s\n"), url);
free(final_file);
return NULL;
}
_alpm_log(handle, ALPM_LOG_DEBUG, "successfully downloaded %s\n", url);
@@ -462,42 +596,44 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url)
if(ret == 0 && (handle->siglevel & ALPM_SIG_PACKAGE)) {
char *sig_final_file = NULL;
size_t len;
struct dload_payload *sig_payload;
CALLOC(sig_payload, 1, sizeof(*sig_payload), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
len = strlen(url) + 5;
CALLOC(sig_payload->fileurl, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
snprintf(sig_payload->fileurl, len, "%s.sig", url);
sig_payload->handle = handle;
sig_payload->force = 1;
sig_payload->errors_ok = (handle->siglevel & ALPM_SIG_PACKAGE_OPTIONAL);
MALLOC(payload.fileurl, len, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
snprintf(payload.fileurl, len, "%s.sig", url);
payload.handle = handle;
payload.force = 1;
payload.errors_ok = (handle->siglevel & ALPM_SIG_PACKAGE_OPTIONAL);
ret = _alpm_download(sig_payload, cachedir, &sig_final_file);
if(ret == -1 && !sig_payload->errors_ok) {
_alpm_log(handle, ALPM_LOG_WARNING, _("failed to download %s\n"), sig_payload->fileurl);
ret = _alpm_download(&payload, cachedir, &sig_final_file);
if(ret == -1 && !payload.errors_ok) {
_alpm_log(handle, ALPM_LOG_WARNING,
_("failed to download %s\n"), payload.fileurl);
/* Warn now, but don't return NULL. We will fail later during package
* load time. */
} else if(ret == 0) {
_alpm_log(handle, ALPM_LOG_DEBUG, "successfully downloaded %s\n", sig_payload->fileurl);
_alpm_log(handle, ALPM_LOG_DEBUG,
"successfully downloaded %s\n", payload.fileurl);
}
FREE(sig_final_file);
_alpm_dload_payload_free(sig_payload);
_alpm_dload_payload_reset(&payload);
}
/* we should be able to find the file the second time around */
filepath = _alpm_filecache_find(handle, final_file);
FREE(final_file);
_alpm_dload_payload_free(payload);
free(final_file);
return filepath;
}
void _alpm_dload_payload_free(struct dload_payload *payload) {
void _alpm_dload_payload_reset(struct dload_payload *payload)
{
ASSERT(payload, return);
FREE(payload->remote_name);
FREE(payload->tempfile_name);
FREE(payload->destfile_name);
FREE(payload->content_disp_name);
FREE(payload->fileurl);
FREE(payload->cd_filename);
FREE(payload);
}
/* vim: set ts=2 sw=2 noet: */

View File

@@ -27,17 +27,25 @@
struct dload_payload {
alpm_handle_t *handle;
const char *filename;
char *cd_filename;
const char *tempfile_openmode;
char *remote_name;
char *tempfile_name;
char *destfile_name;
char *content_disp_name;
char *fileurl;
double initial_size;
long max_size;
off_t initial_size;
off_t max_size;
off_t prevprogress;
int force;
int allow_resume;
int errors_ok;
int unlink_on_fail;
#ifdef HAVE_LIBCURL
CURLcode curlerr; /* last error produced by curl */
#endif
};
void _alpm_dload_payload_free(struct dload_payload *payload);
void _alpm_dload_payload_reset(struct dload_payload *payload);
int _alpm_download(struct dload_payload *payload, const char *localpath,
char **final_file);

View File

@@ -39,17 +39,12 @@
#include "trans.h"
#include "alpm.h"
alpm_handle_t *_alpm_handle_new()
alpm_handle_t *_alpm_handle_new(void)
{
alpm_handle_t *handle;
CALLOC(handle, 1, sizeof(alpm_handle_t), return NULL);
#ifdef HAVE_LIBGPGME
handle->siglevel = ALPM_SIG_PACKAGE | ALPM_SIG_PACKAGE_OPTIONAL |
ALPM_SIG_DATABASE | ALPM_SIG_DATABASE_OPTIONAL;
#endif
return handle;
}
@@ -115,7 +110,7 @@ int _alpm_handle_lock(alpm_handle_t *handle)
do {
fd = open(handle->lockfile, O_WRONLY | O_CREAT | O_EXCL, 0000);
} while(fd == -1 && errno == EINTR);
if(fd > 0) {
if(fd >= 0) {
FILE *f = fdopen(fd, "w");
fprintf(f, "%ld\n", (long)getpid());
fflush(f);
@@ -132,10 +127,9 @@ int _alpm_handle_unlock(alpm_handle_t *handle)
ASSERT(handle->lockfile != NULL, return -1);
ASSERT(handle->lckstream != NULL, return 0);
if(handle->lckstream != NULL) {
fclose(handle->lckstream);
handle->lckstream = NULL;
}
fclose(handle->lckstream);
handle->lckstream = NULL;
if(unlink(handle->lockfile) && errno != ENOENT) {
return -1;
}
@@ -167,6 +161,24 @@ alpm_cb_totaldl SYMEXPORT alpm_option_get_totaldlcb(alpm_handle_t *handle)
return handle->totaldlcb;
}
alpm_cb_event SYMEXPORT alpm_option_get_eventcb(alpm_handle_t *handle)
{
CHECK_HANDLE(handle, return NULL);
return handle->eventcb;
}
alpm_cb_question SYMEXPORT alpm_option_get_questioncb(alpm_handle_t *handle)
{
CHECK_HANDLE(handle, return NULL);
return handle->questioncb;
}
alpm_cb_progress SYMEXPORT alpm_option_get_progresscb(alpm_handle_t *handle)
{
CHECK_HANDLE(handle, return NULL);
return handle->progresscb;
}
const char SYMEXPORT *alpm_option_get_root(alpm_handle_t *handle)
{
CHECK_HANDLE(handle, return NULL);
@@ -291,6 +303,27 @@ int SYMEXPORT alpm_option_set_totaldlcb(alpm_handle_t *handle, alpm_cb_totaldl c
return 0;
}
int SYMEXPORT alpm_option_set_eventcb(alpm_handle_t *handle, alpm_cb_event cb)
{
CHECK_HANDLE(handle, return -1);
handle->eventcb = cb;
return 0;
}
int SYMEXPORT alpm_option_set_questioncb(alpm_handle_t *handle, alpm_cb_question cb)
{
CHECK_HANDLE(handle, return -1);
handle->questioncb = cb;
return 0;
}
int SYMEXPORT alpm_option_set_progresscb(alpm_handle_t *handle, alpm_cb_progress cb)
{
CHECK_HANDLE(handle, return -1);
handle->progresscb = cb;
return 0;
}
static char *canonicalize_path(const char *path) {
char *new_path;
size_t len;

View File

@@ -30,6 +30,25 @@
#include <curl/curl.h>
#endif
#define EVENT(h, e, d1, d2) \
do { \
if((h)->eventcb) { \
(h)->eventcb(e, d1, d2); \
} \
} while(0)
#define QUESTION(h, q, d1, d2, d3, r) \
do { \
if((h)->questioncb) { \
(h)->questioncb(q, d1, d2, d3, r); \
} \
} while(0)
#define PROGRESS(h, e, p, per, n, r) \
do { \
if((h)->progresscb) { \
(h)->progresscb(e, p, per, n, r); \
} \
} while(0)
struct __alpm_handle_t {
/* internal usage */
alpm_db_t *db_local; /* local db pointer */
@@ -41,14 +60,16 @@ struct __alpm_handle_t {
#ifdef HAVE_LIBCURL
/* libcurl handle */
CURL *curl; /* reusable curl_easy handle */
CURLcode curlerr; /* last error produced by curl */
#endif
/* callback functions */
alpm_cb_log logcb; /* Log callback function */
alpm_cb_download dlcb; /* Download callback function */
alpm_cb_totaldl totaldlcb; /* Total download callback function */
alpm_cb_fetch fetchcb; /* Download file callback function */
alpm_cb_fetch fetchcb; /* Download file callback function */
alpm_cb_event eventcb;
alpm_cb_question questioncb;
alpm_cb_progress progresscb;
/* filesystem paths */
char *root; /* Root path, default '/' */

View File

@@ -1,7 +1,12 @@
/*
* RFC 1321 compliant MD5 implementation
*
* Copyright (C) 2006-2007 Christophe Devine
* Copyright (C) 2006-2010, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* 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
@@ -24,29 +29,19 @@
/*
* Pacman Notes:
*
* Taken from the XySSL project at www.xyssl.org under terms of the
* GPL. This is from version 0.9 of the library, and has been modified
* Taken from the PolarSSL project at http://polarssl.org under terms of the
* GPL. This is from version 1.0.0 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"
* * remove "polarssl/config.h" include
* * change include from "polarssl/sha2.h" to "sha2.h"
* * removal of HMAC code
* * removal of SELF_TEST code
* * removal of ipad and opad from the md5_context struct in md5.h
* * change of md5_file prototype from
* int md5_file( char *path, unsigned char *output )
* to
* int md5_file( const char *path, unsigned char *output )
* * use a dynamically-allocated buffer in md5_file, and increase the size
* for performance reasons
* * various static/inline changes
*
* NOTE: XySSL has been renamed to PolarSSL, which is available at
* www.polarssl.org. If we update, we should get it from there.
* * removal of ipad and opad from the md5_context struct in sha2.h
* * increase the size of buffer for performance reasons
* * various static changes
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "md5.h"
@@ -76,7 +71,7 @@
/*
* MD5 context setup
*/
static inline void md5_starts( md5_context *ctx )
static void md5_starts( md5_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -87,7 +82,7 @@ static inline void md5_starts( md5_context *ctx )
ctx->state[3] = 0x10325476;
}
static inline void md5_process( md5_context *ctx, unsigned char data[64] )
static void md5_process( md5_context *ctx, const unsigned char data[64] )
{
unsigned long X[16], A, B, C, D;
@@ -161,7 +156,7 @@ static inline void md5_process( md5_context *ctx, unsigned char data[64] )
P( B, C, D, A, 12, 20, 0x8D2A4C8A );
#undef F
#define F(x,y,z) (x ^ y ^ z)
P( A, B, C, D, 5, 4, 0xFFFA3942 );
@@ -213,9 +208,9 @@ static inline void md5_process( md5_context *ctx, unsigned char data[64] )
/*
* MD5 process buffer
*/
static inline void md5_update( md5_context *ctx, unsigned char *input, int ilen )
static void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen )
{
int fill;
size_t fill;
unsigned long left;
if( ilen <= 0 )
@@ -224,7 +219,7 @@ static inline void md5_update( md5_context *ctx, unsigned char *input, int ilen
left = ctx->total[0] & 0x3F;
fill = 64 - left;
ctx->total[0] += ilen;
ctx->total[0] += (unsigned long) ilen;
ctx->total[0] &= 0xFFFFFFFF;
if( ctx->total[0] < (unsigned long) ilen )
@@ -254,7 +249,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,
@@ -265,7 +260,7 @@ static unsigned char md5_padding[64] =
/*
* MD5 final digest
*/
static inline void md5_finish( md5_context *ctx, unsigned char output[16] )
static void md5_finish( md5_context *ctx, unsigned char output[16] )
{
unsigned long last, padn;
unsigned long high, low;
@@ -293,7 +288,7 @@ static inline void md5_finish( md5_context *ctx, unsigned char output[16] )
/*
* output = MD5( input buffer )
*/
void md5( unsigned char *input, int ilen, unsigned char output[16] )
void md5( const unsigned char *input, size_t ilen, unsigned char output[16] )
{
md5_context ctx;
@@ -312,25 +307,19 @@ int md5_file( const char *path, unsigned char output[16] )
FILE *f;
size_t n;
md5_context ctx;
unsigned char *buf;
unsigned char buf[4096];
if( ( buf = calloc(8192, sizeof(unsigned char)) ) == NULL )
if( ( f = fopen( path, "rb" ) ) == NULL )
return( 1 );
if( ( f = fopen( path, "rb" ) ) == NULL ) {
free( buf );
return( 1 );
}
md5_starts( &ctx );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
md5_update( &ctx, buf, (int) n );
md5_update( &ctx, buf, n );
md5_finish( &ctx, output );
memset( &ctx, 0, sizeof( md5_context ) );
free( buf );
if( ferror( f ) != 0 )
{

View File

@@ -1,7 +1,12 @@
/*
* RFC 1321 compliant MD5 implementation
*
* Copyright (C) 2006-2007 Christophe Devine
* Copyright (C) 2006-2010, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* 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,10 +21,11 @@
* 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
#include <string.h>
/**
* \brief MD5 context structure
*/
@@ -38,7 +44,7 @@ md5_context;
* \param ilen length of the input data
* \param output MD5 checksum result
*/
void md5( unsigned char *input, int ilen, unsigned char output[16] );
void md5( const unsigned char *input, size_t ilen, unsigned char output[16] );
/**
* \brief Output = MD5( file contents )

View File

@@ -67,9 +67,9 @@ int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg)
ASSERT(pkg->origin == PKG_FROM_SYNCDB,
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
fpath = _alpm_filecache_find(pkg->handle, alpm_pkg_get_filename(pkg));
fpath = _alpm_filecache_find(pkg->handle, pkg->filename);
retval = _alpm_test_md5sum(fpath, alpm_pkg_get_md5sum(pkg));
retval = _alpm_test_checksum(fpath, pkg->md5sum, ALPM_CSUM_MD5);
if(retval == 0) {
return 0;
@@ -85,15 +85,12 @@ int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg)
* backend logic that needs lazy access, such as the local database through
* a lazy-load cache. However, the defaults will work just fine for fully-
* populated package structures. */
static const char *_pkg_get_filename(alpm_pkg_t *pkg) { return pkg->filename; }
static const char *_pkg_get_desc(alpm_pkg_t *pkg) { return pkg->desc; }
static const char *_pkg_get_url(alpm_pkg_t *pkg) { return pkg->url; }
static time_t _pkg_get_builddate(alpm_pkg_t *pkg) { return pkg->builddate; }
static time_t _pkg_get_installdate(alpm_pkg_t *pkg) { return pkg->installdate; }
static const char *_pkg_get_packager(alpm_pkg_t *pkg) { return pkg->packager; }
static const char *_pkg_get_md5sum(alpm_pkg_t *pkg) { return pkg->md5sum; }
static const char *_pkg_get_arch(alpm_pkg_t *pkg) { return pkg->arch; }
static off_t _pkg_get_size(alpm_pkg_t *pkg) { return pkg->size; }
static off_t _pkg_get_isize(alpm_pkg_t *pkg) { return pkg->isize; }
static alpm_pkgreason_t _pkg_get_reason(alpm_pkg_t *pkg) { return pkg->reason; }
static int _pkg_has_scriptlet(alpm_pkg_t *pkg) { return pkg->scriptlet; }
@@ -105,7 +102,6 @@ static alpm_list_t *_pkg_get_optdepends(alpm_pkg_t *pkg) { return pkg->optdepend
static alpm_list_t *_pkg_get_conflicts(alpm_pkg_t *pkg) { return pkg->conflicts; }
static alpm_list_t *_pkg_get_provides(alpm_pkg_t *pkg) { return pkg->provides; }
static alpm_list_t *_pkg_get_replaces(alpm_pkg_t *pkg) { return pkg->replaces; }
static alpm_list_t *_pkg_get_deltas(alpm_pkg_t *pkg) { return pkg->deltas; }
static alpm_filelist_t *_pkg_get_files(alpm_pkg_t *pkg) { return &(pkg->files); }
static alpm_list_t *_pkg_get_backup(alpm_pkg_t *pkg) { return pkg->backup; }
@@ -115,7 +111,7 @@ static void *_pkg_changelog_open(alpm_pkg_t UNUSED *pkg)
}
static size_t _pkg_changelog_read(void UNUSED *ptr, size_t UNUSED size,
const alpm_pkg_t UNUSED *pkg, const UNUSED void *fp)
const alpm_pkg_t UNUSED *pkg, UNUSED void *fp)
{
return 0;
}
@@ -132,15 +128,12 @@ static int _pkg_force_load(alpm_pkg_t UNUSED *pkg) { return 0; }
* struct itself with no abstraction layer or any type of lazy loading.
*/
struct pkg_operations default_pkg_ops = {
.get_filename = _pkg_get_filename,
.get_desc = _pkg_get_desc,
.get_url = _pkg_get_url,
.get_builddate = _pkg_get_builddate,
.get_installdate = _pkg_get_installdate,
.get_packager = _pkg_get_packager,
.get_md5sum = _pkg_get_md5sum,
.get_arch = _pkg_get_arch,
.get_size = _pkg_get_size,
.get_isize = _pkg_get_isize,
.get_reason = _pkg_get_reason,
.has_scriptlet = _pkg_has_scriptlet,
@@ -152,7 +145,6 @@ struct pkg_operations default_pkg_ops = {
.get_conflicts = _pkg_get_conflicts,
.get_provides = _pkg_get_provides,
.get_replaces = _pkg_get_replaces,
.get_deltas = _pkg_get_deltas,
.get_files = _pkg_get_files,
.get_backup = _pkg_get_backup,
@@ -170,7 +162,7 @@ const char SYMEXPORT *alpm_pkg_get_filename(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = 0;
return pkg->ops->get_filename(pkg);
return pkg->filename;
}
const char SYMEXPORT *alpm_pkg_get_name(alpm_pkg_t *pkg)
@@ -187,6 +179,13 @@ const char SYMEXPORT *alpm_pkg_get_version(alpm_pkg_t *pkg)
return pkg->version;
}
alpm_pkgfrom_t SYMEXPORT alpm_pkg_get_origin(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return -1);
pkg->handle->pm_errno = 0;
return pkg->origin;
}
const char SYMEXPORT *alpm_pkg_get_desc(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
@@ -226,7 +225,21 @@ const char SYMEXPORT *alpm_pkg_get_md5sum(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = 0;
return pkg->ops->get_md5sum(pkg);
return pkg->md5sum;
}
const char SYMEXPORT *alpm_pkg_get_sha256sum(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = 0;
return pkg->sha256sum;
}
const char SYMEXPORT *alpm_pkg_get_base64_sig(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = 0;
return pkg->base64_sig;
}
const char SYMEXPORT *alpm_pkg_get_arch(alpm_pkg_t *pkg)
@@ -240,7 +253,7 @@ off_t SYMEXPORT alpm_pkg_get_size(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return -1);
pkg->handle->pm_errno = 0;
return pkg->ops->get_size(pkg);
return pkg->size;
}
off_t SYMEXPORT alpm_pkg_get_isize(alpm_pkg_t *pkg)
@@ -310,7 +323,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_deltas(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = 0;
return pkg->ops->get_deltas(pkg);
return pkg->deltas;
}
alpm_filelist_t SYMEXPORT *alpm_pkg_get_files(alpm_pkg_t *pkg)
@@ -347,20 +360,13 @@ void SYMEXPORT *alpm_pkg_changelog_open(alpm_pkg_t *pkg)
/** Read data from an open changelog 'file stream'. */
size_t SYMEXPORT alpm_pkg_changelog_read(void *ptr, size_t size,
const alpm_pkg_t *pkg, const void *fp)
const alpm_pkg_t *pkg, void *fp)
{
ASSERT(pkg != NULL, return 0);
pkg->handle->pm_errno = 0;
return pkg->ops->changelog_read(ptr, size, pkg, fp);
}
/*
int SYMEXPORT alpm_pkg_changelog_feof(const alpm_pkg_t *pkg, void *fp)
{
return pkg->ops->changelog_feof(pkg, fp);
}
*/
/** Close a package changelog for reading. */
int SYMEXPORT alpm_pkg_changelog_close(const alpm_pkg_t *pkg, void *fp)
{
@@ -412,7 +418,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(alpm_pkg_t *pkg)
/* We have a DB package. if it is a local package, then we should
* only search the local DB; else search all known sync databases. */
db = pkg->origin_data.db;
if(db->is_local) {
if(db->status & DB_STATUS_LOCAL) {
find_requiredby(pkg, db, &reqs);
} else {
for(i = pkg->handle->dbs_sync; i; i = i->next) {
@@ -455,13 +461,32 @@ alpm_pkg_t *_alpm_pkg_new(void)
return pkg;
}
alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg)
/**
* Duplicate a package data struct.
* @param pkg the package to duplicate
* @param new_ptr location to store duplicated package pointer
* @return 0 on success, -1 on fatal error, 1 on non-fatal error
*/
int _alpm_pkg_dup(alpm_pkg_t *pkg, alpm_pkg_t **new_ptr)
{
alpm_pkg_t *newpkg;
alpm_list_t *i;
int ret = 0;
if(!pkg || !pkg->handle) {
return -1;
}
if(!new_ptr) {
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1);
}
if(pkg->ops->force_load(pkg)) {
return NULL;
_alpm_log(pkg->handle, ALPM_LOG_WARNING,
_("could not fully load metadata for package %s-%s\n"),
pkg->name, pkg->version);
ret = 1;
pkg->handle->pm_errno = ALPM_ERR_PKG_INVALID;
}
CALLOC(newpkg, 1, sizeof(alpm_pkg_t), goto cleanup);
@@ -476,6 +501,7 @@ alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg)
newpkg->installdate = pkg->installdate;
STRDUP(newpkg->packager, pkg->packager, goto cleanup);
STRDUP(newpkg->md5sum, pkg->md5sum, goto cleanup);
STRDUP(newpkg->sha256sum, pkg->md5sum, goto cleanup);
STRDUP(newpkg->arch, pkg->arch, goto cleanup);
newpkg->size = pkg->size;
newpkg->isize = pkg->isize;
@@ -483,7 +509,9 @@ alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg)
newpkg->reason = pkg->reason;
newpkg->licenses = alpm_list_strdup(pkg->licenses);
newpkg->replaces = alpm_list_strdup(pkg->replaces);
for(i = pkg->replaces; i; i = i->next) {
newpkg->replaces = alpm_list_add(newpkg->replaces, _alpm_dep_dup(i->data));
}
newpkg->groups = alpm_list_strdup(pkg->groups);
if(pkg->files.count) {
size_t filenum;
@@ -497,16 +525,20 @@ alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg)
}
newpkg->files.count = pkg->files.count;
}
for(i = pkg->backup; i; i = alpm_list_next(i)) {
for(i = pkg->backup; i; i = i->next) {
newpkg->backup = alpm_list_add(newpkg->backup, _alpm_backup_dup(i->data));
}
for(i = pkg->depends; i; i = alpm_list_next(i)) {
for(i = pkg->depends; i; i = i->next) {
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);
for(i = pkg->deltas; i; i = alpm_list_next(i)) {
for(i = pkg->conflicts; i; i = i->next) {
newpkg->conflicts = alpm_list_add(newpkg->conflicts, _alpm_dep_dup(i->data));
}
for(i = pkg->provides; i; i = i->next) {
newpkg->provides = alpm_list_add(newpkg->provides, _alpm_dep_dup(i->data));
}
for(i = pkg->deltas; i; i = i->next) {
newpkg->deltas = alpm_list_add(newpkg->deltas, _alpm_delta_dup(i->data));
}
@@ -521,11 +553,12 @@ alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg)
newpkg->ops = pkg->ops;
newpkg->handle = pkg->handle;
return newpkg;
*new_ptr = newpkg;
return ret;
cleanup:
_alpm_pkg_free(newpkg);
return NULL;
RET_ERR(pkg->handle, ALPM_ERR_MEMORY, -1);
}
void _alpm_pkg_free(alpm_pkg_t *pkg)
@@ -541,10 +574,13 @@ void _alpm_pkg_free(alpm_pkg_t *pkg)
FREE(pkg->url);
FREE(pkg->packager);
FREE(pkg->md5sum);
FREE(pkg->sha256sum);
FREE(pkg->base64_sig);
FREE(pkg->arch);
FREELIST(pkg->licenses);
FREELIST(pkg->replaces);
alpm_list_free_inner(pkg->replaces, (alpm_list_fn_free)_alpm_dep_free);
alpm_list_free(pkg->replaces);
FREELIST(pkg->groups);
if(pkg->files.count) {
size_t i;
@@ -558,8 +594,10 @@ void _alpm_pkg_free(alpm_pkg_t *pkg)
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->provides);
alpm_list_free_inner(pkg->conflicts, (alpm_list_fn_free)_alpm_dep_free);
alpm_list_free(pkg->conflicts);
alpm_list_free_inner(pkg->provides, (alpm_list_fn_free)_alpm_dep_free);
alpm_list_free(pkg->provides);
alpm_list_free_inner(pkg->deltas, (alpm_list_fn_free)_alpm_delta_free);
alpm_list_free(pkg->deltas);
alpm_list_free(pkg->delta_path);
@@ -594,8 +632,7 @@ void _alpm_pkg_free_trans(alpm_pkg_t *pkg)
/* Is spkg an upgrade for localpkg? */
int _alpm_pkg_compare_versions(alpm_pkg_t *spkg, alpm_pkg_t *localpkg)
{
return alpm_pkg_vercmp(alpm_pkg_get_version(spkg),
alpm_pkg_get_version(localpkg));
return alpm_pkg_vercmp(spkg->version, localpkg->version);
}
/* Helper function for comparing packages
@@ -604,7 +641,7 @@ int _alpm_pkg_cmp(const void *p1, const void *p2)
{
const alpm_pkg_t *pkg1 = p1;
const alpm_pkg_t *pkg2 = p2;
return strcoll(pkg1->name, pkg2->name);
return strcmp(pkg1->name, pkg2->name);
}
/* Test for existence of a package in a alpm_list_t*
@@ -653,13 +690,13 @@ int _alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg)
alpm_list_t *groups = NULL;
/* first see if the package is ignored */
if(alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(pkg))) {
if(alpm_list_find_str(handle->ignorepkg, pkg->name)) {
return 1;
}
/* next see if the package is in a group that is ignored */
for(groups = handle->ignoregroup; groups; groups = alpm_list_next(groups)) {
char *grp = (char *)alpm_list_getdata(groups);
for(groups = handle->ignoregroup; groups; groups = groups->next) {
char *grp = groups->data;
if(alpm_list_find_str(alpm_pkg_get_groups(pkg), grp)) {
return 1;
}

View File

@@ -34,12 +34,6 @@
#include "db.h"
#include "signing.h"
typedef enum _alpm_pkgfrom_t {
PKG_FROM_FILE = 1,
PKG_FROM_LOCALDB,
PKG_FROM_SYNCDB
} alpm_pkgfrom_t;
/** Package operations struct. This struct contains function pointers to
* all methods used to access data in a package to allow for things such
* as lazy package intialization (such as used by the file backend). Each
@@ -48,15 +42,12 @@ typedef enum _alpm_pkgfrom_t {
* defined default_pkg_ops struct to work just fine for their needs.
*/
struct pkg_operations {
const char *(*get_filename) (alpm_pkg_t *);
const char *(*get_desc) (alpm_pkg_t *);
const char *(*get_url) (alpm_pkg_t *);
time_t (*get_builddate) (alpm_pkg_t *);
time_t (*get_installdate) (alpm_pkg_t *);
const char *(*get_packager) (alpm_pkg_t *);
const char *(*get_md5sum) (alpm_pkg_t *);
const char *(*get_arch) (alpm_pkg_t *);
off_t (*get_size) (alpm_pkg_t *);
off_t (*get_isize) (alpm_pkg_t *);
alpm_pkgreason_t (*get_reason) (alpm_pkg_t *);
int (*has_scriptlet) (alpm_pkg_t *);
@@ -68,20 +59,14 @@ struct pkg_operations {
alpm_list_t *(*get_conflicts) (alpm_pkg_t *);
alpm_list_t *(*get_provides) (alpm_pkg_t *);
alpm_list_t *(*get_replaces) (alpm_pkg_t *);
alpm_list_t *(*get_deltas) (alpm_pkg_t *);
alpm_filelist_t *(*get_files) (alpm_pkg_t *);
alpm_list_t *(*get_backup) (alpm_pkg_t *);
void *(*changelog_open) (alpm_pkg_t *);
size_t (*changelog_read) (void *, size_t, const alpm_pkg_t *, const void *);
size_t (*changelog_read) (void *, size_t, const alpm_pkg_t *, void *);
int (*changelog_close) (const alpm_pkg_t *, void *);
int (*force_load) (alpm_pkg_t *);
/* still to add:
* checkmd5sum() ?
* compute_requiredby()
*/
};
/** The standard package operations struct. get fields directly from the
@@ -100,6 +85,7 @@ struct __alpm_pkg_t {
char *url;
char *packager;
char *md5sum;
char *sha256sum;
char *base64_sig;
char *arch;
@@ -144,14 +130,15 @@ alpm_file_t *_alpm_file_copy(alpm_file_t *dest, const alpm_file_t *src);
int _alpm_files_cmp(const void *f1, const void *f2);
alpm_pkg_t* _alpm_pkg_new(void);
alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg);
int _alpm_pkg_dup(alpm_pkg_t *pkg, alpm_pkg_t **new_ptr);
void _alpm_pkg_free(alpm_pkg_t *pkg);
void _alpm_pkg_free_trans(alpm_pkg_t *pkg);
alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile,
int full, const char *md5sum, const char *base64_sig,
alpm_siglevel_t level);
int _alpm_pkg_validate_internal(alpm_handle_t *handle,
const char *pkgfile, alpm_pkg_t *syncpkg, alpm_siglevel_t level,
alpm_siglist_t **sigdata);
alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
const char *pkgfile, int full);
int _alpm_pkg_cmp(const void *p1, const void *p2);
int _alpm_pkg_compare_versions(alpm_pkg_t *local_pkg, alpm_pkg_t *pkg);

View File

@@ -159,19 +159,19 @@ static alpm_pkghash_t *pkghash_add_pkg(alpm_pkghash_t *hash, alpm_pkg_t *pkg, in
position = get_hash_position(pkg->name_hash, hash);
ptr = calloc(1, sizeof(alpm_list_t));
ptr = malloc(sizeof(alpm_list_t));
if(ptr == NULL) {
return hash;
}
ptr->data = pkg;
ptr->next = NULL;
ptr->prev = ptr;
ptr->next = NULL;
hash->hash_table[position] = ptr;
if(!sorted){
if(!sorted) {
hash->list = alpm_list_join(hash->list, ptr);
}else{
} else {
hash->list = alpm_list_mmerge(hash->list, ptr, _alpm_pkg_cmp);
}

View File

@@ -11,6 +11,7 @@ fr
hu
it
kk
lt
nb
pl
pt
@@ -24,3 +25,4 @@ sv
tr
uk
zh_CN
zh_TW

View File

@@ -2,14 +2,16 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Hector Mtz-Seara <hseara@gmail.com>, 2011.
# Translators:
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Hector Mtz-Seara <hseara@gmail.com>, 2011.
# <jpreales@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-11 14:03+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: Catalan (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/ca/)\n"
@@ -83,6 +85,10 @@ msgstr "no es pot obtenir el directori de treball actual\n"
msgid "could not change directory to %s (%s)\n"
msgstr "no s'ha pogut canviar el directori a %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "no s'ha pogut restaurar el directori de treball (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "ha ocorregut un problema en actualitzar %s\n"
@@ -133,7 +139,7 @@ msgstr "no s'ha pogut crear el directori %s: %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "no s'ha pogut analitzar el fitxers de descripció de paquet en %s\n"
msgstr "no s'ha pogut analitzar el fitxer de descripció de paquet en %s\n"
#, c-format
msgid "missing package name in %s\n"
@@ -162,6 +168,8 @@ msgstr "no s'ha pogut eliminar el fitxer de bloqueig %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
"no s'ha pogut analitzar el fitxer de descripció de paquet '%s' de la base de "
"dades '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -212,22 +220,22 @@ msgid "Partition %s is mounted read only\n"
msgstr "La partició %s està muntat només en mode lectura\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
"La partició %s està molt plena: nombre de blocs requerits %ld, nombre de "
"blocs lliures %ld\n"
"La partició %s està molt plena: nombre de blocs requerits %jd, nombre de "
"blocs lliures %jd\n"
#, c-format
msgid "disk"
msgstr "disc"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "l'url '%s' és invàlid\n"
msgid "failed to create temporary file for download\n"
msgstr "ha fallat en crear un arxiu temporal per la baixada\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "l'url '%s' és invàlid\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -303,11 +311,11 @@ msgstr "no s'ha pogut trobar la base de dades"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "base de dades invàlida o corrupta"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "base de dades invàlida o corrupta (signatura PGP)"
#, c-format
msgid "database is incorrect version"
@@ -366,17 +374,17 @@ msgstr "no s'ha pogut trobar o llegir el paquet"
msgid "operation cancelled due to ignorepkg"
msgstr "operació cancel·lada degut a ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "delta invàlid o corrupte"
msgstr "paquet invàlid o corrupte"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "base de dades invàlida o corrupta (checksum)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "paquet invàlid o corrupte (signatura PGP)"
#, c-format
msgid "cannot open package file"
@@ -400,11 +408,11 @@ msgstr "no s'ha pogut trobar el repositori per l'objectiu"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "falta signatura PGP"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "signatura PGP invàlida"
#, c-format
msgid "invalid or corrupted delta"
@@ -444,7 +452,7 @@ msgstr "error de la llibreria de baixades"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "error de gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -454,6 +462,10 @@ msgstr "error en invocar el baixador extern"
msgid "unexpected error"
msgstr "error inesperat"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "no s'ha pogut carregar completament les metadades pel paquet %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "no s'ha pogut trobar %s en la base de dades -- s'està ometent\n"
@@ -468,7 +480,7 @@ msgstr "no s'ha pogut eliminar el fitxer '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "no es pot eliminar %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -532,6 +544,10 @@ msgstr "no s'ha pogut crear el directori temporal\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "no s'ha pogut copiar el fitxer temporal a %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "no s'ha pogut eliminar %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "no s'ha pogut eliminar el directori temporal %s\n"
@@ -550,7 +566,7 @@ msgstr "no s'ha pogut canviar el directori arrel (%s)\n"
#, c-format
msgid "call to execv failed (%s)\n"
msgstr "la crida a execve ha fallat (%s)\n"
msgstr "la crida a execv ha fallat (%s)\n"
#, c-format
msgid "call to waitpid failed (%s)\n"
@@ -569,5 +585,6 @@ msgid "no %s cache exists, creating...\n"
msgstr "no existeix memòria cau %s, s'està creant...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "no s'ha pogut crear la memòria cau del paquet, s'usarà /tmp\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"no s'ha trobat o creat packet de memòria cau, usant alternativaent %s\n"

View File

@@ -2,16 +2,18 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Vojtěch Gondžala <vojtech.gondzala@gmail.com>, 2011.
# David Kolibáč <david@kolibac.cz>, 2011.
# Translators:
# Dan McGee <dpmcgee@gmail.com>, 2011.
# David Kolibáč <david@kolibac.cz>, 2011.
# <markotahal@gmail.com>, 2011.
# Vojtěch Gondžala <vojtech.gondzala@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-15 08:43+0000\n"
"Last-Translator: vogo <vojtech.gondzala@gmail.com>\n"
"Language-Team: Czech (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/cs/)\n"
"Language: cs\n"
@@ -84,6 +86,10 @@ msgstr "nelze určit aktuální pracovní adresář\n"
msgid "could not change directory to %s (%s)\n"
msgstr "nelze změnit adresář na %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "nelze obnovit pracovní adresář (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "nastal problém při aktualizaci %s\n"
@@ -162,7 +168,7 @@ msgstr "nelze odstranit zamykací soubor %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "nelze načíst soubor s popisem balíčku '%s' z databáze '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -213,21 +219,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "Diskový oddíl %s je připojen jen pro čtení\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
"Diskový oddíl %s je příliš plný: je potřeba %ld bloků, %ld bloků je volných\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Oddíl %s je plný: je potřeba %jd bloků, ale k dispozici je jen %jd\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "URL '%s' je chybná\n"
msgid "failed to create temporary file for download\n"
msgstr "nepodařilo se vytvořit dočasný soubor pro stahování\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "URL '%s' je chybná\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -303,11 +308,11 @@ msgstr "nelze nalézt databázi"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "neplatná nebo poškozená databáze"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "neplatná nebo poškozená databáze (PGP podpisy)"
#, c-format
msgid "database is incorrect version"
@@ -365,17 +370,17 @@ msgstr "nelze nalézt nebo přečíst balíček"
msgid "operation cancelled due to ignorepkg"
msgstr "operace byla zrušena kvůli ignorovanému balíčku"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "neplatný nebo poškozený delta rozdíl"
msgstr "neplatný nebo poškozený balíček"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "neplatná nebo poškozená databáze (kontrolní součty)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "neplatný nebo poškozený balíček (PGP podpis)"
#, c-format
msgid "cannot open package file"
@@ -399,11 +404,11 @@ msgstr "nelze nalézt repositář cíle"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "chybějící podpis PGP"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "neplatný podpis PGP"
#, c-format
msgid "invalid or corrupted delta"
@@ -443,7 +448,7 @@ msgstr "chyba knihovny pro stahování souborů"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "chyba v gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -453,6 +458,10 @@ msgstr "chyba volání externího programu pro stahování souborů"
msgid "unexpected error"
msgstr "neočekávaná chyba"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "nelze zcela načíst metadata pro balíček %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "nelze nalézt %s v databázi -- vynechat\n"
@@ -467,7 +476,7 @@ msgstr "nelze odstranit soubor '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "nelze odstranit %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -529,6 +538,10 @@ msgstr "nelze vytvořit dočasný adresář\n"
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 remove %s\n"
msgstr "nelze odstranit %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "nelze odstranit dočasný adresář %s\n"
@@ -566,5 +579,7 @@ msgid "no %s cache exists, creating...\n"
msgstr "neexistuje mezipaměť %s, vytváří se...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "nelze vytvořit mezipaměť balíčků, používá se /tmp\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"nepodařilo se najít nebo vytvořit mezipaměť pro balíčky, používám místo toho "
"%s\n"

View File

@@ -2,13 +2,14 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Joe Hansen <joedalton2@yahoo.dk>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 03:39+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: Danish (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/da/)\n"
@@ -82,6 +83,10 @@ msgstr "kunne ikke hente aktuelt arbejdsmappe\n"
msgid "could not change directory to %s (%s)\n"
msgstr "kunne ikke ændre mappe til %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr ""
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "der opstod et problem under opgradering %s\n"
@@ -211,21 +216,21 @@ msgid "Partition %s is mounted read only\n"
msgstr ""
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "adressen »%s« er ugyldig\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
#, c-format
msgid "url '%s' is invalid\n"
msgstr "adressen »%s« er ugyldig\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "fejlede i indhentning af fil »%s« fra %s: %s\n"
@@ -362,9 +367,9 @@ msgstr "kunne ikke finde eller læse pakke"
msgid "operation cancelled due to ignorepkg"
msgstr "handling afbrudt på grund af igonrepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "ugyldig eller ødelagt delta"
msgstr ""
#, c-format
msgid "invalid or corrupted package (checksum)"
@@ -450,6 +455,10 @@ msgstr "fejl under opstart af ekstern hentningsprogram"
msgid "unexpected error"
msgstr "uventet fejl"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr ""
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "kunne ikke finde %s i database - springer over\n"
@@ -526,6 +535,10 @@ msgstr "kunne ikke oprette midlertidig mappe\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "kunne ikke kopier midlertidig fil til %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr ""
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "kunne ikke fjerne tmpdir %s\n"
@@ -563,5 +576,5 @@ msgid "no %s cache exists, creating...\n"
msgstr "intet %s-mellemlager findes, opretter...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "kunne ikke oprette pakkemellemlager, bruger /tmp i steden for\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""

View File

@@ -2,15 +2,16 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Matthias Gorissen <matthias@archlinux.de>, 2011.
# Translators:
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Matthias Gorissen <matthias@archlinux.de>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-07 09:26+0000\n"
"Last-Translator: tlaloc <matthias@archlinux.de>\n"
"Language-Team: German (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/de/)\n"
"Language: de\n"
@@ -83,6 +84,10 @@ msgstr "Konnte aktuelles Arbeitsverzeichnis nicht ermitteln\n"
msgid "could not change directory to %s (%s)\n"
msgstr "Konnte nicht zu Verzeichnis %s wechseln (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "Konnte das Arbeitsverzeichnis (%s) nicht wiederherstellen\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "Fehler traten auf, während %s aktualisiert wurde\n"
@@ -166,6 +171,7 @@ msgstr "Konnte Sperrdatei %s nicht entfernen\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
"Konnte Paket-Beschreibungsdatei '%s' der Datenbank '%s' nicht analysieren\n"
#, c-format
msgid "database path is undefined\n"
@@ -216,21 +222,22 @@ msgid "Partition %s is mounted read only\n"
msgstr "Die Partition %s ist so eingehängt, daß sie nur gelesen werden kann\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
"Partition %s überfüllt: %ld Blöcke werden benötigt, %ld Blöcke sind frei\n"
"Partition %s ist überfüllt: %jd Blöcke werden benötigt, %jd Blöcke sind "
"frei\n"
#, c-format
msgid "disk"
msgstr "Platte"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "URL '%s' ist ungültig\n"
msgid "failed to create temporary file for download\n"
msgstr "Konnte temporäre Datei für den Download nicht anlegen\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "URL '%s' ist ungültig\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -306,11 +313,11 @@ msgstr "Konnte Datenbank nicht finden"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "Ungültige oder beschädigte Datenbank"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "Ungültige oder beschädigte Datenbank (PGP-Signatur)"
#, c-format
msgid "database is incorrect version"
@@ -369,17 +376,17 @@ msgstr "Konnte Paket nicht finden oder lesen"
msgid "operation cancelled due to ignorepkg"
msgstr "Vorgang abgebrochen auf Grund von IgnorePkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "Ungültiges oder beschädigtes Delta"
msgstr "Ungültiges oder beschädigtes Paket"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "Ungültiges oder beschädigtes Paket (Prüfsumme)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "Ungültiges oder beschädigtes Paket (PGP-Signatur)"
#, c-format
msgid "cannot open package file"
@@ -403,11 +410,11 @@ msgstr "Konnte kein Repositorium für das Ziel finden"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "Fehlende PGP-Signatur"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "Ungültige PGP-Signatur"
#, c-format
msgid "invalid or corrupted delta"
@@ -447,7 +454,7 @@ msgstr "Fehler in der Bibliothek für Downloads"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "gpgme-Fehler"
#, c-format
msgid "error invoking external downloader"
@@ -457,6 +464,10 @@ msgstr "Fehler beim Aufruf eines externen Downloaders"
msgid "unexpected error"
msgstr "Unerwarteter Fehler"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "Konnte die Metadaten für Paket %s-%s nicht vollständig laden\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "Konnte %s nicht in Datenbank finden -- Überspringe\n"
@@ -471,7 +482,7 @@ msgstr "Kann Datei '%s' nicht entfernen: %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "Konnte %s nicht entfernen (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -533,6 +544,10 @@ msgstr "Konnte temporäres Verzeichnis nicht erstellen\n"
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 remove %s\n"
msgstr "Konnte %s nicht entfernen\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "Konnte temporäres Verzeichnis %s nicht entfernen\n"
@@ -570,5 +585,6 @@ msgid "no %s cache exists, creating...\n"
msgstr "Es existiert kein %s-Puffer. Erstelle... \n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "Konnte Paketpuffer nicht erstellen, benutze stattdessen /tmp\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"Konnte den Paket-Puffer nicht finden oder erstellen, benutze stattdessen %s\n"

View File

@@ -2,15 +2,17 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# nous <nous@archlinux.us>, 2011.
# Translators:
# Christos Nouskas <nous@archlinux.us>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
# nous <nous@archlinux.us>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 10:43+0000\n"
"Last-Translator: nous <nous@archlinux.us>\n"
"Language-Team: Greek (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/el/)\n"
"Language: el\n"
@@ -83,6 +85,10 @@ msgstr "αδυναμία χρήσης τρέχοντος καταλόγου\n"
msgid "could not change directory to %s (%s)\n"
msgstr "αδυναμία μετάβασης στον κατάλογο %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "αδυναμία επαναφοράς καταλόγου εργασίας (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "πρόβλημα κατά την αναβάθμιση του %s\n"
@@ -161,7 +167,7 @@ msgstr "αδυναμία διαγραφής αρχείου κλειδώματο
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "αδυναμία ανάλυσης αρχείου περιγραφής πακέτου '%s' βάσης '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -212,20 +218,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "Kατάτμηση %s: προσαρτημένη μόνο για ανάγνωση\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr "Kατάτμηση %s πλήρης: %ld blocks απαιτούνται, %ld ελεύθερα\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Κατάτμηση %s πλήρης: %jd ελεύθερα μπλοκ, %jd απαιτούνται\n"
#, c-format
msgid "disk"
msgstr "δίσκο"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "άκυρη διεύθυνση '%s'\n"
msgid "failed to create temporary file for download\n"
msgstr "αποτυχία δημιουργίας προσωρινού αρχείου λήψης\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "άκυρη διεύθυνση '%s'\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -301,11 +307,11 @@ msgstr "αδυναμία εύρεσης βάσης"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "άκυρη ή κατεστραμμένη βάση"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "άκυρη ή κατεστραμμένη βάση (υπογραφή PGP)"
#, c-format
msgid "database is incorrect version"
@@ -363,17 +369,17 @@ msgstr "αδυναμία εύρεσης ή ανάγνωσης πακέτου"
msgid "operation cancelled due to ignorepkg"
msgstr "ακύρωση λειτουργίας λόγω ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "άκυρο ή κατεστραμμένο delta"
msgstr "άκυρο ή κατεστραμμένο πακέτο"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "άκυρο ή κατεστραμμένο πακέτο (άθροισμα ελέγχου)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "άκυρο ή κατεστραμμένο πακέτο (υπογραφή PGP)"
#, c-format
msgid "cannot open package file"
@@ -397,11 +403,11 @@ msgstr "αδυναμία εύρεσης αποθήκης για διεκπερα
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "απούσα υπογραφή PGP"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "άκυρη υπογραφή PGP"
#, c-format
msgid "invalid or corrupted delta"
@@ -441,7 +447,7 @@ msgstr "σφάλμα βιβλιοθήκης λήψης"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "σφάλμα gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -451,6 +457,10 @@ msgstr "σφάλμα κλήσης προγράμματος λήψης"
msgid "unexpected error"
msgstr "απροσδόκητο σφάλμα"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "αδυναμία πλήρους φόρτωσης μεταδεδομένων πακέτου %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "δεν βρέθηκε το %s στη βάση -- παράλειψη\n"
@@ -465,11 +475,11 @@ msgstr "αδυναμία διαγραφής αρχείου '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
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"
@@ -528,6 +538,10 @@ msgstr "αδυναμία δημιουργίας προσωρινού καταλ
msgid "could not copy tempfile to %s (%s)\n"
msgstr "αδυναμία αντιγραφής προσωρινού αρχείου στο %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "αδυναμία διαγραφής %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "αδυναμία διαγραφής προσωρινού καταλόγου %s\n"
@@ -565,5 +579,5 @@ 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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr "αδυναμία εύρεσης ή δημιουργίας κρύπτης πακέτων, χρήση %s\n"

View File

@@ -2,13 +2,14 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Dan McGee <dpmcgee@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-09 01:00+0000\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 03:57+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: en_GB\n"
@@ -81,6 +82,10 @@ msgstr "could not get current working directory\n"
msgid "could not change directory to %s (%s)\n"
msgstr "could not change directory to %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "could not restore working directory (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "problem occurred while upgrading %s\n"
@@ -210,21 +215,21 @@ msgid "Partition %s is mounted read only\n"
msgstr "Partition %s is mounted read only\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Partition %s too full: %jd blocks needed, %jd blocks free\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "URL '%s' is invalid\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr "failed to create temporary file for download\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "URL '%s' is invalid\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "failed retrieving file '%s' from %s : %s\n"
@@ -361,9 +366,9 @@ msgstr "could not find or read package"
msgid "operation cancelled due to ignorepkg"
msgstr "operation cancelled due to ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "invalid or corrupted database"
msgstr "invalid or corrupted package"
#, c-format
msgid "invalid or corrupted package (checksum)"
@@ -449,6 +454,10 @@ msgstr "error invoking external downloader"
msgid "unexpected error"
msgstr "unexpected error"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "could not fully load metadata for package %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "could not find %s in database -- skipping\n"
@@ -525,6 +534,10 @@ msgstr "could not create temp directory\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "could not copy tempfile to %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "could not remove %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "could not remove tmpdir %s\n"
@@ -562,5 +575,5 @@ msgid "no %s cache exists, creating...\n"
msgstr "no %s cache exists, creating...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "couldn't create package cache, using /tmp instead\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr "couldn't find or create package cache, using %s instead\n"

View File

@@ -2,17 +2,19 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# neiko <neikokz+tsfx@gmail.com>, 2011.
# Juan Antonio Cánovas Pérez <traumness@gmail.com>, 2011.
# Translators:
# Angel Velasquez <angvp@archlinux.org>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Juan Antonio Cánovas Pérez <traumness@gmail.com>, 2011.
# <juantascon@gmail.com>, 2011.
# neiko <neikokz+tsfx@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 16:10+0000\n"
"Last-Translator: juantascon <juantascon@gmail.com>\n"
"Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/"
"archlinux-pacman/team/es/)\n"
"Language: es\n"
@@ -85,6 +87,10 @@ msgstr "no se pudo obtener el directorio de trabajo actual\n"
msgid "could not change directory to %s (%s)\n"
msgstr "no se pudo cambiar el directorio a %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "no se pudo restaurar el directorio de trabajo (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "ocurrió un error durante la actualización de %s\n"
@@ -139,7 +145,7 @@ msgstr "no se pudo crear el directorio %s: %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"
msgstr "no se pudo leer el archivo de descripción en %s\n"
#, c-format
msgid "missing package name in %s\n"
@@ -168,6 +174,8 @@ msgstr "no se pudo eliminar el archivo de bloqueo %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
"error al leer el archivo de descripción '%s' del paquete de la base de datos "
"'%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -175,7 +183,7 @@ msgstr "la ruta de la base de datos no está definida\n"
#, c-format
msgid "dependency cycle detected:\n"
msgstr "ciclo de dependencias detectado:\n"
msgstr "bucle de dependencias detectado:\n"
#, c-format
msgid "%s will be removed after its %s dependency\n"
@@ -183,7 +191,7 @@ msgstr "%s será eliminado después de su dependencia %s\n"
#, c-format
msgid "%s will be installed before its %s dependency\n"
msgstr "%s será instalado antes de su dependencia %s\n"
msgstr "%s será instalado antes que su dependencia %s\n"
#, c-format
msgid "ignoring package %s-%s\n"
@@ -220,26 +228,26 @@ msgid "Partition %s is mounted read only\n"
msgstr "La partición %s está montada como sólo lectura\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
"La partición %s está muy llena: %ld bloques necesarios, %ld bloques "
"disponibles\n"
"Partición %s demasiado llena: %jd bloques son necesarios, %jd bloques "
"libres\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr "error al crear un archivo temporal para la descarga\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "la dirección %s no es válida\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "fallo al obtener archivo '%s' desde %s: %s\n"
msgstr "error al obtener archivo '%s' desde %s: %s\n"
#, c-format
msgid "%s appears to be truncated: %jd/%jd bytes\n"
@@ -311,11 +319,11 @@ msgstr "no se pudo encontrar la base de datos"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "base de datos no válida o dañada"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "base de datos no válida o dañada (firma PGP)"
#, c-format
msgid "database is incorrect version"
@@ -374,17 +382,17 @@ msgstr "no se pudo encontrar o leer el paquete"
msgid "operation cancelled due to ignorepkg"
msgstr "operación cancelada debido a ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "no válido o diferencial dañado"
msgstr "paquete no válido o dañado"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "paquete no válido o dañado (suma de verificación)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "paquete no válido o dañado (firma PGP)"
#, c-format
msgid "cannot open package file"
@@ -408,11 +416,11 @@ msgstr "no pudo encontrarse un repositorio para el objetivo"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "falta la firma PGP"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "firma PGP no válida"
#, c-format
msgid "invalid or corrupted delta"
@@ -452,7 +460,7 @@ msgstr "error de descarga de biblioteca"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "error de gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -462,6 +470,10 @@ msgstr "error invocando el descargador externo"
msgid "unexpected error"
msgstr "error inesperado"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "no se pudo cargar completamente los metadatos para el paquete %s-%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"
@@ -476,7 +488,7 @@ msgstr "no se pudo quitar el archivo '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "error al eliminar %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -540,6 +552,10 @@ msgstr "no se puede crear el directorio temporal\n"
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 remove %s\n"
msgstr "no se pudo eliminar %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "no se pudo eliminar el directorio temporal %s\n"
@@ -577,5 +593,6 @@ msgid "no %s cache exists, creating...\n"
msgstr "no existe la caché %s, creando...\n"
#, c-format
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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"no se pudo encontrar o crear la caché del paquete, en lugar se utilizará %s\n"

View File

@@ -2,17 +2,19 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# <larso@gmx.com>, 2011.
# Larso <larso@gmx.com>, 2011.
# Jesse Jaara <jesse.jaara@gmail.com>, 2011.
# Translators:
# apuasi <kaannokset.hellberg@gmail.com>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Jesse Jaara <jesse.jaara@gmail.com>, 2011.
# <larso@gmx.com>, 2011.
# Larso <larso@gmx.com>, 2011.
# Lasse Liehu <lasse.liehu@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-07 18:48+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: Finnish (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/fi/)\n"
@@ -52,7 +54,7 @@ msgstr ""
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "purku: kansiota ei ylikirjoiteta tiedostolla %s\n"
msgstr "purku: kansiota ei korvata tiedostolla %s\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
@@ -86,6 +88,10 @@ msgstr "nykyisen kansion sijaintia ei voitu määrittää\n"
msgid "could not change directory to %s (%s)\n"
msgstr "ei voitu vaihtaa kansioon %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "työhakemistoa ei voitu palauttaa (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "pakettia %s päivitettäessä tapahtui virhe\n"
@@ -124,11 +130,11 @@ msgstr "tiedostoa %s ei voitu avata: %s\n"
#, c-format
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr ""
msgstr "tietokanta %s on epäyhtenäinen: paketin %s nimi ei täsmää\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr ""
msgstr "tietokanta %s on epäyhtenäinen: paketin %s versio ei täsmää\n"
#, c-format
msgid "could not create directory %s: %s\n"
@@ -136,7 +142,7 @@ msgstr "kansiota %s ei voitu luoda: %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "paketin kuvausta tiedostossa %s ei voitu jäsentää\n"
msgstr "paketin kuvaustiedostoa %s ei voitu jäsentää\n"
#, c-format
msgid "missing package name in %s\n"
@@ -164,7 +170,7 @@ msgstr "lukkotiedostoa %s ei voitu poistaa\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "paketin kuvaustiedostoa '%s' ei voitu jäsentää tietokannassa '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -188,7 +194,7 @@ msgstr "ohitetaan paketti %s-%s\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "ei voida selvittää paketin \"%s\", riippuvuutta \"%s\"\n"
msgstr "pakettia '%s' ei voida selvittää, paketin '%s' riippuvuus\n"
#, c-format
msgid "could not get filesystem information\n"
@@ -215,20 +221,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "Osio %s on liitetty vain lukutilassa\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr "osio %s on liian täynnä: %ld lohkoa tarvitaan, %ld lohkoa vapaana\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Osio %s on liian täynnä: %jd lohkoa tarvitaan, %jd lohkoa vapaana\n"
#, c-format
msgid "disk"
msgstr "levy"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "osoite '%s' on virheellinen\n"
msgid "failed to create temporary file for download\n"
msgstr "väliaikaistiedoston luonti lataamista varten epäonnistui\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "osoite '%s' on virheellinen\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -304,11 +310,11 @@ msgstr "tietokantaa ei löytynyt"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "virheellinen tai vahingoittunut tietokanta"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "virheellinen tai vahingoittunut tietokanta (PGP-allekirjoitus)"
#, c-format
msgid "database is incorrect version"
@@ -366,17 +372,17 @@ msgstr "pakettia ei löytynyt tai voitu lukea"
msgid "operation cancelled due to ignorepkg"
msgstr "operaatio peruutettiin ignorepkg:n takia"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "delta ei kelvollinen tai vahingoittunut"
msgstr "virheellinen tai vahingoittunut paketti"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "virheellinen tai vahingoittunut paketti (tarkistussumma)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "virheellinen tai vahingoittunut paketti (PGP-allekirjoitus)"
#, c-format
msgid "cannot open package file"
@@ -400,15 +406,15 @@ msgstr "kohteen varastoa ei löytynyt"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "puuttuva PGP-allekirjoitus"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "virheellinen PGP-allekirjoitus"
#, c-format
msgid "invalid or corrupted delta"
msgstr "delta ei kelvollinen tai vahingoittunut"
msgstr "virheellinen tai vahingoittunut delta"
#, c-format
msgid "delta patch failed"
@@ -444,7 +450,7 @@ msgstr "latauskirjaston virhe"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "gpgme-virhe"
#, c-format
msgid "error invoking external downloader"
@@ -454,6 +460,10 @@ msgstr "virhe kutsuttaessa ulkoista latausohjelmaa"
msgid "unexpected error"
msgstr "odottamaton virhe"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "paketin %s-%s metadataa ei voitu ladata täysin\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "%s ei löytynyt tietokannasta -- ohitetaan\n"
@@ -468,7 +478,7 @@ msgstr "tiedostoa '%s' ei voitu poistaa: %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "tiedostoa %s ei voida poistaa (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -532,6 +542,10 @@ msgstr "väliaikaiskansiota ei voitu luoda\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "väliaikaistiedostoa ei voitu kopioida kansioon %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "%s ei voitu poistaa\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "väliaikaiskansiota %s ei voitu poistaa\n"
@@ -569,5 +583,7 @@ msgid "no %s cache exists, creating...\n"
msgstr "välimuistia %s ei ole olemassa, luodaan...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "pakettivälimuistia ei voitu luoda, käytetään /tmp:tä sen sijasta\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"pakettivälimuistia ei ollut olemassa eikä sitä voitu luoda. Käytetään %s sen "
"sijaan\n"

View File

@@ -2,15 +2,18 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# shining <chantry.xavier@gmail.com>, 2011.
# Translators:
# Dan McGee <dpmcgee@gmail.com>, 2011.
# <ma.jiehong@gmail.com>, 2011.
# shining <chantry.xavier@gmail.com>, 2011.
# Xavier Devlamynck <magicrhesus@ouranos.be>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 12:57+0000\n"
"Last-Translator: magicrhesus <magicrhesus@ouranos.be>\n"
"Language-Team: French (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/fr/)\n"
"Language: fr\n"
@@ -45,15 +48,15 @@ msgid ""
"filesystem: %o package: %o\n"
msgstr ""
"Les permissions pour le répertoire %s sont différentes\n"
"système de fichier: %o paquet : %o\n"
"système de fichier : %o paquet : %o\n"
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "extraction: n'écrase pas le répertoire par le fichier %s\n"
msgstr "extraction : n'écrase pas le répertoire par le fichier %s\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
msgstr "extraction: le lien %s ne pointe pas vers un répertoire\n"
msgstr "extraction : le lien %s ne pointe pas vers un répertoire\n"
#, c-format
msgid "could not rename %s to %s (%s)\n"
@@ -83,6 +86,10 @@ msgstr "déterminer le répertoire courant a échoué\n"
msgid "could not change directory to %s (%s)\n"
msgstr "changer de répertoire vers %s a échoué (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "Impossible de restaurer le répertoire de travail (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "des erreurs sont survenues pendant la mise à jour de %s\n"
@@ -101,7 +108,7 @@ msgstr "l'ajout au cache de l'entrée '%s' a échoué\n"
#, c-format
msgid "removing invalid database: %s\n"
msgstr "suppression d'une base de données invalide: %s\n"
msgstr "suppression d'une base de données invalide : %s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
@@ -117,19 +124,20 @@ 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"
msgstr "l'ouverture du fichier %s a échoué : %s\n"
#, c-format
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"
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"
msgstr ""
"Le dépôt %s est inconsistant : versions différentes pour le paquet %s\n"
#, c-format
msgid "could not create directory %s: %s\n"
msgstr "la création du répertoire %s a échoué: %s\n"
msgstr "la création du répertoire %s a échoué : %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
@@ -145,7 +153,7 @@ 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"
msgstr "erreur lors de la lecture du paquet %s : %s\n"
#, c-format
msgid "missing package metadata in %s\n"
@@ -153,7 +161,7 @@ msgstr "méta-données du paquet manquantes dans %s\n"
#, c-format
msgid "removing invalid file: %s\n"
msgstr "suppression du fichier invalide: %s\n"
msgstr "suppression du fichier invalide : %s\n"
#, c-format
msgid "could not remove lock file %s\n"
@@ -162,6 +170,8 @@ msgstr "la suppression du fichier de verrouillage %s a échoué\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
"impossible d'analyser le fichier '%s' de description du paquet depuis la "
"base de données '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -169,7 +179,7 @@ msgstr "base de données non initialisée\n"
#, c-format
msgid "dependency cycle detected:\n"
msgstr "cycle de dépendances détecté:\n"
msgstr "cycle de dépendances détecté :\n"
#, c-format
msgid "%s will be removed after its %s dependency\n"
@@ -194,7 +204,7 @@ msgstr "impossible de récupérer les informations du système de fichier\n"
#, c-format
msgid "could not get filesystem information for %s: %s\n"
msgstr ""
"impossible de récupérer les informations du système de fichier pour %s: %s\n"
"impossible de récupérer les informations du système de fichier pour %s : %s\n"
#, c-format
msgid "could not determine mount point for file %s\n"
@@ -213,22 +223,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "La partition %s est en lecture seule\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
"La partition %s n'a pas assez d'espace libre : besoin de %ld blocs mais "
"seulement %ld libres\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "La partition %s est pleine : %jd blocs nécessaires, %jd blocs libres\n"
#, c-format
msgid "disk"
msgstr "disque"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "l'url '%s' est invalide\n"
msgid "failed to create temporary file for download\n"
msgstr "échec de création d'un fichier temporaire pour le téléchargement\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "l'url '%s' est invalide\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -236,7 +244,7 @@ msgstr "échec de récupération du fichier '%s' depuis %s : %s\n"
#, c-format
msgid "%s appears to be truncated: %jd/%jd bytes\n"
msgstr "%s est apparemment tronqué: %jd/%jd bytes\n"
msgstr "%s est apparemment tronqué : %jd/%jd bytes\n"
#, c-format
msgid "failed to download %s\n"
@@ -244,7 +252,7 @@ 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!"
msgstr "dépassement de mémoire !"
#, c-format
msgid "unexpected system error"
@@ -304,11 +312,11 @@ msgstr "trouver la base de données a échoué"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "base de données invalide ou corrompue"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "base de données invalide ou corrompue (Signature PGP)"
#, c-format
msgid "database is incorrect version"
@@ -368,17 +376,17 @@ msgstr "impossible de trouver ou de lire le paquet"
msgid "operation cancelled due to ignorepkg"
msgstr "opération annulée à cause d'un paquet à ignorer (IgnorePkg)"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "delta invalide ou corrompu"
msgstr "paquet invalide ou corrompu"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "paquet invalide ou corrompu (somme de contrôle)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "paquet invalide ou corrompu (signature PGP)"
#, c-format
msgid "cannot open package file"
@@ -402,11 +410,11 @@ msgstr "impossible de trouver le dépôt pour la cible"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "signature PGP manquante"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "siganture PGP invalide"
#, c-format
msgid "invalid or corrupted delta"
@@ -446,7 +454,7 @@ msgstr "erreur de la bibliothèque de téléchargement"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "erreur de gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -456,6 +464,12 @@ msgstr "erreur en invoquant le client externe de téléchargement"
msgid "unexpected error"
msgstr "erreur non prévue"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr ""
"Les métadonnées pour le paquet %s-%s n'ont pas pu êtres totalement "
"chargées.\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"
@@ -466,11 +480,11 @@ msgstr "supprime %s de la liste de cible\n"
#, c-format
msgid "cannot remove file '%s': %s\n"
msgstr "suppression du fichier '%s' impossible: %s\n"
msgstr "suppression du fichier '%s' impossible : %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "impossible de supprimer %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -482,19 +496,19 @@ msgstr "la suppression du cache de l'entrée '%s' a échoué\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ignore la mise à jour du paquet (%s => %s)\n"
msgstr "%s : ignore la mise à jour du paquet (%s => %s)\n"
#, c-format
msgid "%s: ignoring package downgrade (%s => %s)\n"
msgstr "%s: ignore le retour à la version antérieure (%s => %s)\n"
msgstr "%s : ignore le retour à la version antérieure (%s => %s)\n"
#, c-format
msgid "%s: downgrading from version %s to version %s\n"
msgstr "%s: retourne à la version antérieure (%s => %s)\n"
msgstr "%s : retourne à la version antérieure (%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"
msgstr "%s : la version locale (%s) est plus récente que %s (%s)\n"
#, c-format
msgid "ignoring package replacement (%s-%s => %s-%s)\n"
@@ -532,6 +546,10 @@ msgstr "la création du répertoire temporaire a échoué\n"
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 remove %s\n"
msgstr "la suppression de %s a échoué\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "la suppression du répertoire temporaire %s a échoué\n"
@@ -566,8 +584,10 @@ msgstr "la commande n'a pas pu être exécutée correctement\n"
#, c-format
msgid "no %s cache exists, creating...\n"
msgstr "le cache %s n'existe pas, création...\n"
msgstr "le cache %s n'existe pas, création\n"
#, c-format
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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"Impossible de trouver ou de créer le cache des paquets, utilisation de %s à "
"la place\n"

View File

@@ -2,14 +2,16 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# György Balló <ballogy@freestart.hu>, 2011.
# ngaba <ngaba@bibl.u-szeged.hu>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-08 10:04+0000\n"
"Last-Translator: Citybusz <ballogy@freestart.hu>\n"
"Language-Team: Hungarian (http://www.transifex.net/projects/p/archlinux-"
"pacman/team/hu/)\n"
"Language: hu\n"
@@ -32,27 +34,27 @@ msgstr "visszatérés egy régebbi %s verzióhoz (%s => %s)\n"
#, c-format
msgid "warning given when extracting %s (%s)\n"
msgstr "figyelmeztetés a %s kicsomagolása közben (%s)\n"
msgstr "figyelmeztetés a(z) %s kibontása közben (%s)\n"
#, c-format
msgid "could not extract %s (%s)\n"
msgstr "nem sikerült kicsomagolni: %s (%s)\n"
msgstr "nem sikerült kibontani: %s (%s)\n"
#, c-format
msgid ""
"directory permissions differ on %s\n"
"filesystem: %o package: %o\n"
msgstr ""
"eltérő könyvtár-jogosultságok: %s\n"
"eltérő könyvtárjogosultságok: %s\n"
"fájlrendszer: %o csomag: %o\n"
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "kicsomagolás: nem írok felül könyvtárat a %s fájllal\n"
msgstr "kibontás: nem írok felül könyvtárat a %s fájllal\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
msgstr "kicsomagolás: %s szimbolikus link nem könyvtárra mutat\n"
msgstr "kibontás: %s szimbolikus link nem könyvtárra mutat\n"
#, c-format
msgid "could not rename %s to %s (%s)\n"
@@ -72,7 +74,7 @@ msgstr "%s %s néven lett telepítve\n"
#, c-format
msgid "extracting %s as %s.pacnew\n"
msgstr "%s kicsomagolása %s.pacnew néven\n"
msgstr "%s kibontása %s.pacnew néven\n"
#, c-format
msgid "could not get current working directory\n"
@@ -82,6 +84,10 @@ msgstr "a jelenlegi munkakönyvtár nem kapható meg\n"
msgid "could not change directory to %s (%s)\n"
msgstr "nem sikerült a könyvtárváltás ide: %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "nem sikerült visszalépni a munkakönyvárba (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "hiba történt a(z) %s frissítése közben\n"
@@ -92,11 +98,11 @@ msgstr "hiba történt a(z) %s telepítése közben\n"
#, c-format
msgid "could not update database entry %s-%s\n"
msgstr "nem sikerült a(z) %s-%s adatbázisbejegyzés frissítése\n"
msgstr "nem sikerült a(z) %s-%s adatbázis-bejegyzés frissítése\n"
#, c-format
msgid "could not add entry '%s' in cache\n"
msgstr "sikertelen a '%s' bejegyzés hozzáadása a gyorsítótárhoz\n"
msgstr "nem sikerült a(z) '%s' bejegyzés hozzáadása a gyorsítótárhoz\n"
#, c-format
msgid "removing invalid database: %s\n"
@@ -104,7 +110,7 @@ msgstr "hibás adatbázis eltávolítása: %s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "hibás név a '%s' adatbázis-bejegyzés számára\n"
msgstr "hibás név a(z) '%s' adatbázis-bejegyzés számára\n"
#, c-format
msgid "duplicated database entry '%s'\n"
@@ -156,11 +162,13 @@ msgstr "hibás fájl eltávolítása: %s\n"
#, c-format
msgid "could not remove lock file %s\n"
msgstr "nem sikerült a zároló fájl (%s) eltávolítása\n"
msgstr "nem sikerült a zárolófájl (%s) eltávolítása\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
"nem sikerült értelmezni a(z) '%s' csomagleíró fájlját a(z) '%s' "
"adatbázisból\n"
#, c-format
msgid "database path is undefined\n"
@@ -211,23 +219,22 @@ msgid "Partition %s is mounted read only\n"
msgstr "A %s partíció csak olvashatóként van csatolva\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
"Nincs elég szabad hely a %s partíción: %ld blokk szükséges, %ld blokk "
"szabad\n"
"A %s partíció túlságosan tele van: %jd blokk szükséges, %jd blokk szabad\n"
#, c-format
msgid "disk"
msgstr "diszk"
msgstr "lemez"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr "nem sikerült létrehozni ideiglenes fájlt a letöltéshez\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "a '%s' URL hibás\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
#, 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"
@@ -246,7 +253,7 @@ msgstr "elfogyott a memória!"
#, c-format
msgid "unexpected system error"
msgstr "nemvárt hiba"
msgstr "nem várt hiba"
#, c-format
msgid "insufficient privileges"
@@ -270,11 +277,11 @@ msgstr "nincs elég szabad lemezterület"
#, c-format
msgid "library not initialized"
msgstr "a nyvtár nem inicializált"
msgstr "a függvénytár nem inicializált"
#, c-format
msgid "library already initialized"
msgstr "a nyvtár már inicializált"
msgstr "a függvénytár már inicializált"
#, c-format
msgid "unable to lock database"
@@ -302,11 +309,11 @@ msgstr "nem található az adatbázis"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "érvénytelen vagy sérült adatbázis"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "hibás vagy sérült adatbázis (PGP aláírás)"
#, c-format
msgid "database is incorrect version"
@@ -314,7 +321,7 @@ msgstr "hibás verziójú az adatbázis"
#, c-format
msgid "could not update database"
msgstr "nem sikerült megnyitni az adatbázist"
msgstr "nem sikerült frissíteni az adatbázist"
#, c-format
msgid "could not remove database entry"
@@ -326,7 +333,7 @@ msgstr "hibás szerver-URL"
#, c-format
msgid "no servers configured for repository"
msgstr "a repóhoz nincs szerver beállítva"
msgstr "a tárolóhoz nincs szerver beállítva"
#, c-format
msgid "transaction already initialized"
@@ -354,7 +361,7 @@ msgstr "a művelet nem egyeztethető össze a jelenlegi tranzakciótípussal"
#, c-format
msgid "transaction commit attempt when database is not locked"
msgstr "tranzakció végrehajtási kísérlet nem zárolt adatbázis mellett"
msgstr "tranzakció-végrehajtási kísérlet nem zárolt adatbázis mellett"
#, c-format
msgid "could not find or read package"
@@ -362,19 +369,19 @@ msgstr "nem található vagy nem olvasható a csomag"
#, c-format
msgid "operation cancelled due to ignorepkg"
msgstr "művelet megszakítva ignorepkg miatt"
msgstr "a művelet megszakítva ignorepkg miatt"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "hibás vagy sérült delta"
msgstr "hibás vagy sérült csomag"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "hibás vagy sérült csomag (ellenőrzőösszeg)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "hibás vagy sérült csomag (PGP aláírás)"
#, c-format
msgid "cannot open package file"
@@ -382,7 +389,7 @@ msgstr "nem sikerült megnyitni a csomagfájlt"
#, c-format
msgid "cannot remove all files for package"
msgstr "nem sikerült eltávolítani a csomag összes fájlját"
msgstr "nem távolítható el a csomag összes fájlja"
#, c-format
msgid "package filename is not valid"
@@ -390,19 +397,19 @@ msgstr "érvénytelen csomagnév"
#, c-format
msgid "package architecture is not valid"
msgstr "érvénytelen csomag-architektúra"
msgstr "érvénytelen csomagarchitektúra"
#, c-format
msgid "could not find repository for target"
msgstr "nem található repó a célcsomaghoz"
msgstr "nem található tároló a célcsomaghoz"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "hiányzó PGP aláírás"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "érvénytelen PGP aláírás"
#, c-format
msgid "invalid or corrupted delta"
@@ -410,7 +417,7 @@ msgstr "hibás vagy sérült delta"
#, c-format
msgid "delta patch failed"
msgstr "delta patchelés sikertelen"
msgstr "delta foltozás sikertelen"
#, c-format
msgid "could not satisfy dependencies"
@@ -438,11 +445,11 @@ msgstr "libarchive hiba"
#, c-format
msgid "download library error"
msgstr "letöltőnyvtár hiba"
msgstr "letöltőfüggvénytár hiba"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "gpgme hiba"
#, c-format
msgid "error invoking external downloader"
@@ -450,15 +457,20 @@ msgstr "hiba a külső letöltő meghívásakor"
#, c-format
msgid "unexpected error"
msgstr "nemvárt hiba"
msgstr "nem várt hiba"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr ""
"nem sikerült teljesen betölteni az információs fájlt a(z) %s-%s csomaghoz\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"
msgstr "nem található %s az adatbázisban -- kihagyás\n"
#, c-format
msgid "removing %s from target list\n"
msgstr "%s eltávolítása a cél listából\n"
msgstr "%s eltávolítása a céllistából\n"
#, c-format
msgid "cannot remove file '%s': %s\n"
@@ -466,7 +478,7 @@ msgstr "nem sikerült eltávolítani a '%s' fájlt : %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "%s nem távolítható el (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -482,19 +494,19 @@ msgstr "%s: csomagfrissítés kihagyása (%s => %s)\n"
#, c-format
msgid "%s: ignoring package downgrade (%s => %s)\n"
msgstr "%s: csomag downgrade kihagyása (%s => %s)\n"
msgstr "%s: csomag visszafejlesztésének kihagyása (%s => %s)\n"
#, c-format
msgid "%s: downgrading from version %s to version %s\n"
msgstr "%s: visszatérés a %s verióról a régebbi %s verzióhoz\n"
msgstr "%s: visszatérés a(z) %s verzióról a régebbi %s verzióhoz\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: a helyi (%s) újabb, mint %s (%s)\n"
msgstr "%s: a helyi (%s) újabb, mint a(z) %s (%s)\n"
#, c-format
msgid "ignoring package replacement (%s-%s => %s-%s)\n"
msgstr "csomag-lecserélés kihagyása (%s-%s => %s-%s)\n"
msgstr "csomaglecserélés kihagyása (%s-%s => %s-%s)\n"
#, c-format
msgid "cannot replace %s by %s\n"
@@ -528,21 +540,25 @@ msgstr "nem sikerült létrehozni az ideiglenes könyvtárat\n"
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 remove %s\n"
msgstr "%s nem távolítható el\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "nem sikerült eltávolítani a %s ideiglenes könyvtárat\n"
#, c-format
msgid "could not create pipe (%s)\n"
msgstr "nem sikerült a pipe létrehozása (%s)\n"
msgstr "nem sikerült az adatcsatorna létrehozása (%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
msgstr "nem sikerült forkolni egy új folyamatot (%s)\n"
msgstr "nem sikerült indítani egy új folyamatot (%s)\n"
#, c-format
msgid "could not change the root directory (%s)\n"
msgstr "nem sikerült a chroot (%s)\n"
msgstr "nem sikerült gyökérkönyvtárat váltani (%s)\n"
#, c-format
msgid "call to execv failed (%s)\n"
@@ -550,20 +566,22 @@ msgstr "sikertelen execv hívás (%s)\n"
#, c-format
msgid "call to waitpid failed (%s)\n"
msgstr "waitpid hívás sikertelen (%s)\n"
msgstr "sikertelen waitpid hívás (%s)\n"
#, c-format
msgid "could not open pipe (%s)\n"
msgstr "nem sikerült a pipe megnyitása (%s)\n"
msgstr "nem sikerült az adatcsatorna megnyitása (%s)\n"
#, c-format
msgid "command failed to execute correctly\n"
msgstr "a parancs nem futott le sikeresen\n"
msgstr "a parancs nem futott le helyesen\n"
#, c-format
msgid "no %s cache exists, creating...\n"
msgstr "nem létezik a(z) %s gyorsítótár. létrehozás...\n"
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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"nem található vagy nem hozható létre a csomaggyorsítótár, a %s könyvtárat "
"használom helyette\n"

View File

@@ -2,15 +2,16 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Giovanni Scafora <giovanni@archlinux.org>, 2011.
# Translators:
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Giovanni Scafora <giovanni@archlinux.org>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 15:43+0000\n"
"Last-Translator: giovanni <giovanni@archlinux.org>\n"
"Language-Team: Italian (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/it/)\n"
"Language: it\n"
@@ -85,6 +86,10 @@ msgstr "impossibile determinare la directory corrente\n"
msgid "could not change directory to %s (%s)\n"
msgstr "impossibile spostarsi nella directory %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "impossibile ripristinare la directory di lavoro (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "si sono verificati degli errori durante l'aggiornamento di %s\n"
@@ -166,7 +171,7 @@ msgstr "impossibile rimuovere il file di lock %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "impossibile analizzare il file di descrizione '%s' del database '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -218,22 +223,21 @@ msgid "Partition %s is mounted read only\n"
msgstr "La partizione %s è montata in sola lettura\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
"La partizione %s è troppo piena: sono necessari %ld blocchi e ci sono solo "
"%ld blocchi liberi\n"
"La partizione %s è troppo piena: %jd blocchi necessari, %jd blocchi liberi\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "l'url '%s' non è esatto\n"
msgid "failed to create temporary file for download\n"
msgstr "impossibile creare la directory temporanea\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "l'url '%s' non è esatto\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -309,11 +313,11 @@ msgstr "impossibile trovare il database"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "il database non è valido oppure è corrotto"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "il database non è valido oppure è corrotto (firma PGP)"
#, c-format
msgid "database is incorrect version"
@@ -371,17 +375,17 @@ msgstr "impossibile trovare o leggere il pacchetto"
msgid "operation cancelled due to ignorepkg"
msgstr "l'operazione è stata ignorata a causa di ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "il delta non è valido oppure è corrotto"
msgstr "il pacchetto non è valido oppure è corrotto"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "il pacchetto non è valido oppure è corrotto (controllo integrità)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "il pacchetto non è valido oppure è corrotto (firma PGP)"
#, c-format
msgid "cannot open package file"
@@ -405,15 +409,15 @@ msgstr "impossibile trovare un repository contenente questo pacchetto"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "firma PGP mancante"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "firma PGP non valida"
#, c-format
msgid "invalid or corrupted delta"
msgstr "il delta non è valido oppure è corrotto"
msgstr "file delta non valido oppure corrotto"
#, c-format
msgid "delta patch failed"
@@ -449,7 +453,7 @@ msgstr "si è verificato un errore della libreria di download"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "errore di gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -459,6 +463,10 @@ msgstr "si è verificato un errore lanciando il downloader esterno"
msgid "unexpected error"
msgstr "errore inaspettato"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "impossibile caricare tutti i metadata del pacchetto %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "impossibile trovare %s nel database, sarà ignorato\n"
@@ -473,7 +481,7 @@ msgstr "impossibile rimuovere il file '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "impossibile rimuovere %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -537,6 +545,10 @@ msgstr "impossibile creare la directory temporanea\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "impossibile copiare il file temporaneo in %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "impossibile rimuovere %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "impossibile rimuovere la directory temporanea %s\n"
@@ -574,6 +586,7 @@ msgid "no %s cache exists, creating...\n"
msgstr "la cache di %s non esiste, creazione in corso...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"impossibile creare la cache del pacchetto, al suo posto sarà usata /tmp\n"
"impossibile trovare o creare la cache del pacchetto, al suo posto sto usando "
"%s\n"

View File

@@ -2,14 +2,15 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Translators:
# Baurzhan Muftakhidinov <baurthefirst@gmail.com>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 03:39+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: Kazakh (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/kk/)\n"
@@ -83,6 +84,10 @@ msgstr "ағымдағы жұмыс бумасын анықтау мүмкін
msgid "could not change directory to %s (%s)\n"
msgstr "%s бумасына ауысу мүмкін емес (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr ""
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "%s жаңарту кезінде қате кетті\n"
@@ -212,21 +217,21 @@ msgid "Partition %s is mounted read only\n"
msgstr "%s бөлімі тек оқу үшін тіркелген\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr "%s бөлімі тым толық: %ld блок керек, %ld блок бос\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
#, c-format
msgid "disk"
msgstr "дискі"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "'%s' сілтемесі қате\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
#, c-format
msgid "url '%s' is invalid\n"
msgstr "'%s' сілтемесі қате\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "'%s' файлын %s адресінен алу қатемен аяқталды : %s\n"
@@ -363,9 +368,9 @@ msgstr "дестені табу не оқу мүмкін емес"
msgid "operation cancelled due to ignorepkg"
msgstr "әрекет ignorepkg салдарынан тоқтатылды"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "дельта файлы қате не зақымдалған"
msgstr ""
#, c-format
msgid "invalid or corrupted package (checksum)"
@@ -451,6 +456,10 @@ msgstr "сыртқы жүктемелер менеджерін шақыру қа
msgid "unexpected error"
msgstr "күтпеген қате кетті"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr ""
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "дерекқор ішінде %s табылмады -- өткізіп жібереміз\n"
@@ -528,6 +537,10 @@ msgstr "уақытша буманы құру мүмкін емес\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "уақытша файлды %s ішіне көшіру мүмкін емес (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr ""
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "%s уақытша бумасын өшіру мүмкін емес\n"
@@ -565,5 +578,5 @@ 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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""

View File

@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pacman 3.5.3\n"
"Project-Id-Version: pacman 4.0.1\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\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"
@@ -79,6 +79,10 @@ msgstr ""
msgid "could not change directory to %s (%s)\n"
msgstr ""
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr ""
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr ""
@@ -208,7 +212,7 @@ msgid "Partition %s is mounted read only\n"
msgstr ""
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
#, c-format
@@ -216,11 +220,11 @@ msgid "disk"
msgstr ""
#, c-format
msgid "url '%s' is invalid\n"
msgid "failed to create temporary file for download\n"
msgstr ""
#, c-format
msgid "failed to create temporary file for download\n"
msgid "url '%s' is invalid\n"
msgstr ""
#, c-format
@@ -447,6 +451,10 @@ msgstr ""
msgid "unexpected error"
msgstr ""
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr ""
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr ""
@@ -523,6 +531,10 @@ msgstr ""
msgid "could not copy tempfile to %s (%s)\n"
msgstr ""
#, c-format
msgid "could not remove %s\n"
msgstr ""
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr ""
@@ -560,5 +572,5 @@ msgid "no %s cache exists, creating...\n"
msgstr ""
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""

584
lib/libalpm/po/lt.po Normal file
View File

@@ -0,0 +1,584 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Algimantas Margevičius <gymka@mail.ru>, 2011.
# toofishes <dpmcgee@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-07 06:12+0000\n"
"Last-Translator: gymka_ltu <margevicius.algimantas@gmail.com>\n"
"Language-Team: Lithuanian (http://www.transifex.net/projects/p/archlinux-"
"pacman/team/lt/)\n"
"Language: lt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n"
"%100<10 || n%100>=20) ? 1 : 2)\n"
#, c-format
msgid "%s-%s is up to date -- skipping\n"
msgstr "%s-%s yra naujausias -- praleidžiama\n"
#, c-format
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%s-%s yra naujausias -- perrašoma\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "pasendinamas paketas %s (%s => %s)\n"
#, c-format
msgid "warning given when extracting %s (%s)\n"
msgstr "bandant išskleisti gautas įspėjimas %s (%s)\n"
#, c-format
msgid "could not extract %s (%s)\n"
msgstr "nepavyko išskleisti %s (%s)\n"
#, c-format
msgid ""
"directory permissions differ on %s\n"
"filesystem: %o package: %o\n"
msgstr ""
"%s aplanko leidimai skiriasi\n"
"failų sistema: %o paketas: %o\n"
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "išskleidimas: nepakeistas aplankas failu %s\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
msgstr "išskleidimas: nuoroda %s neveda į aplanką\n"
#, c-format
msgid "could not rename %s to %s (%s)\n"
msgstr "nepavyko pervadint %s į %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%s išsaugota kaip %s\n"
#, c-format
msgid "could not install %s as %s (%s)\n"
msgstr "nepavyko įdiegti %s kaip %s (%s)\n"
#, c-format
msgid "%s installed as %s\n"
msgstr "%s įdiegtas kaip %s\n"
#, c-format
msgid "extracting %s as %s.pacnew\n"
msgstr "%s išskleidžiamas kaip %s.pacnew\n"
#, c-format
msgid "could not get current working directory\n"
msgstr "nepavyko nustatyt dabartinio aplanko\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "nepavyko pakeist aplanko į %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "nepavyko atstatyt darbinio aplanko (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "kilo bėdų atnaujinant %s\n"
#, c-format
msgid "problem occurred while installing %s\n"
msgstr "kilo bėdų diegiant %s\n"
#, c-format
msgid "could not update database entry %s-%s\n"
msgstr "nepavyko atnaujint duomenų bazės įrašo %s-%s\n"
#, c-format
msgid "could not add entry '%s' in cache\n"
msgstr "nepavyko pridėti '%s' podėlin\n"
#, c-format
msgid "removing invalid database: %s\n"
msgstr "šalinama neteisinga duomenų bazė: %s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "neteisingas duomenų bazės įrašo pavadinimas '%s'\n"
#, c-format
msgid "duplicated database entry '%s'\n"
msgstr "toks pavadinimas jau yra '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "duomenų bazės įrašas sugadintas '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
msgstr "nepavyko atverti failo %s: %s\n"
#, c-format
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr ""
"%s duomenų bazės nesuderinamumas: pavadinimas neatitinka nurodyto pakete %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr ""
"%s duomenų bazės nesuderinamumas: versija neatitinka nurodytos pakete %s\n"
#, c-format
msgid "could not create directory %s: %s\n"
msgstr "nepavyko sukurti aplanko %s: %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "nepavyko perskaityt aprašymo failo %s\n"
#, c-format
msgid "missing package name in %s\n"
msgstr "trūksta paketo pavadinimo %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "trūksta paketo versijos %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "klaida skaitant paketą %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "trūksta paketo meta duomenų %s\n"
#, c-format
msgid "removing invalid file: %s\n"
msgstr "šalinamas neteisingas failas: %s\n"
#, c-format
msgid "could not remove lock file %s\n"
msgstr "nepavyko pašalinti užrakinto failo %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr "nepavyko perskaityt paketo aprašymo failo %s iš duomenų bazės '%s'\n"
#, c-format
msgid "database path is undefined\n"
msgstr "nenurodytas duomenų bazės kelias\n"
#, c-format
msgid "dependency cycle detected:\n"
msgstr "rastas priklausomybių ciklas:\n"
#, c-format
msgid "%s will be removed after its %s dependency\n"
msgstr "%s bus pašalintas kai bus pašalinta jo priklausomybė %s\n"
#, c-format
msgid "%s will be installed before its %s dependency\n"
msgstr "%s bus įdiegta prieš jo priklausomybę %s\n"
#, c-format
msgid "ignoring package %s-%s\n"
msgstr "ignoruojamas paketas %s-%s\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "negaliu išspręsti \"%s\", \"%s\" priklausomybė\n"
#, c-format
msgid "could not get filesystem information\n"
msgstr "nepavyko gauti failų sistemos informacijos\n"
#, c-format
msgid "could not get filesystem information for %s: %s\n"
msgstr "nepavyko gauti failų sistemos informacijos %s: %s\n"
#, c-format
msgid "could not determine mount point for file %s\n"
msgstr "nepavyko nustatyti prijungimo taško failui %s\n"
#, c-format
msgid "could not determine filesystem mount points\n"
msgstr "nepavyko nustatyt failų sistemos prijungimo taškų\n"
#, c-format
msgid "could not determine root mount point %s\n"
msgstr "nepavyko nustatyt šakninio prijungimo taško %s\n"
#, c-format
msgid "Partition %s is mounted read only\n"
msgstr "Skirsnis %s prijungtas tik skaitymui\n"
#, c-format
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Skirsnis %s perpildytas: reikia %jd blokų, laisvi %jd\n"
#, c-format
msgid "disk"
msgstr "diskas"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr "nepavyko sukurti laikino failo parsiuntimui\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "neteisingas url '%s'\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "nepavyko gauti failo '%s' iš %s : %s\n"
#, c-format
msgid "%s appears to be truncated: %jd/%jd bytes\n"
msgstr "%s atrodo apkarpyta: %jd/%jd baitai\n"
#, c-format
msgid "failed to download %s\n"
msgstr "nepavyko parsiųsti %s\n"
#, c-format
msgid "out of memory!"
msgstr "nebėra atminties!"
#, c-format
msgid "unexpected system error"
msgstr "netikėta sistemos klaida"
#, c-format
msgid "insufficient privileges"
msgstr "nepakankamos teisės"
#, c-format
msgid "could not find or read file"
msgstr "nepavyko rasti ar perskaityti failo"
#, c-format
msgid "could not find or read directory"
msgstr "nepavyko rasti ar perskaityti aplanko"
#, c-format
msgid "wrong or NULL argument passed"
msgstr "neteisingi arba nepateikti argumentai"
#, c-format
msgid "not enough free disk space"
msgstr "nepakanka laisvos vietos"
#, c-format
msgid "library not initialized"
msgstr "biblioteka neprijungta"
#, c-format
msgid "library already initialized"
msgstr "biblioteka jau prijungta"
#, c-format
msgid "unable to lock database"
msgstr "nepavyko užrakinti duomenų bazės"
#, c-format
msgid "could not open database"
msgstr "nepavyko atverti duomenų bazės"
#, c-format
msgid "could not create database"
msgstr "nepavyko sukurti duomenų bazės"
#, c-format
msgid "database not initialized"
msgstr "duomenų bazė neprijungta"
#, c-format
msgid "database already registered"
msgstr "duomenų bazė jau užregistruota"
#, c-format
msgid "could not find database"
msgstr "nepavyko rasti duomenų bazės"
#, c-format
msgid "invalid or corrupted database"
msgstr "neteisinga arba sugadinta duomenų bazė"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr "neteisinga arba sugadinta duomenų bazė (PGP parašas)"
#, c-format
msgid "database is incorrect version"
msgstr "neteisinga duomenų bazės versija"
#, c-format
msgid "could not update database"
msgstr "nepavyko atnaujinti duomenų bazės"
#, c-format
msgid "could not remove database entry"
msgstr "nepavyko pašalinti duomenų bazės įrašo"
#, c-format
msgid "invalid url for server"
msgstr "neteisingas serverio url"
#, c-format
msgid "no servers configured for repository"
msgstr "saugyklai nenurodytas joks serveris "
#, c-format
msgid "transaction already initialized"
msgstr "perdavimas jau pradėtas"
#, c-format
msgid "transaction not initialized"
msgstr "perdavimas nepradėtas"
#, c-format
msgid "duplicate target"
msgstr "objektas jau yra"
#, c-format
msgid "transaction not prepared"
msgstr "perdavimas neparuoštas"
#, c-format
msgid "transaction aborted"
msgstr "perdavimas atšauktas"
#, c-format
msgid "operation not compatible with the transaction type"
msgstr "operacija nesuderinama su perdavimo tipu"
#, c-format
msgid "transaction commit attempt when database is not locked"
msgstr "bandoma perduoti kol duomenų bazė neužrakinta"
#, c-format
msgid "could not find or read package"
msgstr "nepavyko rasti ar perskaityti paketo"
#, c-format
msgid "operation cancelled due to ignorepkg"
msgstr "veiksmas atšauktas dėl ignorepkg"
#, c-format
msgid "invalid or corrupted package"
msgstr "neteisingas arba sugadintas paketas"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr "neteisingas arba sugadintas paketas (kontrolinė suma)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr "neteisingas arba sugadintas paketas (PGP parašas)"
#, c-format
msgid "cannot open package file"
msgstr "nepavyko atverti paketo failo"
#, c-format
msgid "cannot remove all files for package"
msgstr "negalima pašalinti visų paketo failų"
#, c-format
msgid "package filename is not valid"
msgstr "paketo vardas neteisingas"
#, c-format
msgid "package architecture is not valid"
msgstr "paketo architektūra neteisinga"
#, c-format
msgid "could not find repository for target"
msgstr "nepavyko rasti saugyklos objektui"
#, c-format
msgid "missing PGP signature"
msgstr "trūksta PGP parašo"
#, c-format
msgid "invalid PGP signature"
msgstr "neteisingas PGP parašas"
#, c-format
msgid "invalid or corrupted delta"
msgstr "neteisinga arba sugadinta delta"
#, c-format
msgid "delta patch failed"
msgstr "nepavyko ištaisyti delta"
#, c-format
msgid "could not satisfy dependencies"
msgstr "nepavyko patenkinti priklausomybių"
#, c-format
msgid "conflicting dependencies"
msgstr "nesuderinamos priklausomybės"
#, c-format
msgid "conflicting files"
msgstr "nesuderinami failai"
#, c-format
msgid "failed to retrieve some files"
msgstr "nepavyko gauti kai kurių failų"
#, c-format
msgid "invalid regular expression"
msgstr "neteisinga regular expression"
#, c-format
msgid "libarchive error"
msgstr "libarchive klaida"
#, c-format
msgid "download library error"
msgstr "parsiuntimo bibliotekos klaida"
#, c-format
msgid "gpgme error"
msgstr "gpgme klaida"
#, c-format
msgid "error invoking external downloader"
msgstr "klaida iškviečiant išorinį parsiuntėją"
#, c-format
msgid "unexpected error"
msgstr "netikėta klaida"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "paketui %s-%s nepavyko įkrauti visų meta duomenų\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "duomenų bazėj nepavyko rasti %s -- praleidžiama\n"
#, c-format
msgid "removing %s from target list\n"
msgstr "šalinamas %s iš objektų sąrašo\n"
#, c-format
msgid "cannot remove file '%s': %s\n"
msgstr "nepavyko pašalinti failo '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr "nepavyko pašalinti %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
msgstr "nepavyko pašalinti duomenų bazės įrašo %s-%s\n"
#, c-format
msgid "could not remove entry '%s' from cache\n"
msgstr "iš podėlio nepavyko pašalinti įrašo '%s'\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%s: ignoruojamas paketo atnaujinimas (%s => %s)\n"
#, c-format
msgid "%s: ignoring package downgrade (%s => %s)\n"
msgstr "%s: ignoruojamas paketo sendinimas (%s => %s)\n"
#, c-format
msgid "%s: downgrading from version %s to version %s\n"
msgstr "%s: sendinama iš versijos %s į versiją %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%s: vietinis (%s) yra naujesnis nei %s (%s)\n"
#, c-format
msgid "ignoring package replacement (%s-%s => %s-%s)\n"
msgstr "ignoruojamas paketų keitimas (%s-%s => %s-%s)\n"
#, c-format
msgid "cannot replace %s by %s\n"
msgstr "negalima pakeisti %s failu %s\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "aptikti neišsprendžiami paketų nesuderinamumai\n"
#, c-format
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "iš objektų sąrašo šalinamas '%s' dėl konfliktų su '%s'\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "nepavyko gauti kai kurių failų iš %s\n"
#, c-format
msgid "could not commit removal transaction\n"
msgstr "nepavyko įvykdyt šalinimo perdavimo\n"
#, c-format
msgid "could not commit transaction\n"
msgstr "nepavyko įvykdyt perdavimo\n"
#, c-format
msgid "could not create temp directory\n"
msgstr "nepavyko sukurti lakino aplanko\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "negaliu nukopijuoti laikiną failą į %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "nepavyko pašalinti %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "nepavyko pašalinti tmpdir %s\n"
#, c-format
msgid "could not create pipe (%s)\n"
msgstr "nepavyko sukurti pipe (%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
msgstr "nepavyko iššakoti naujo proceso (%s)\n"
#, c-format
msgid "could not change the root directory (%s)\n"
msgstr "nepavyko pakeisti šakninio aplanko (%s)\n"
#, c-format
msgid "call to execv failed (%s)\n"
msgstr "nepavyko iškviesti execv (%s)\n"
#, c-format
msgid "call to waitpid failed (%s)\n"
msgstr "nepavyko iškviesti waitpid (%s)\n"
#, c-format
msgid "could not open pipe (%s)\n"
msgstr "nepavyko atverti pipe (%s)\n"
#, c-format
msgid "command failed to execute correctly\n"
msgstr "nepavyko teisingai įvykdyti komandos\n"
#, c-format
msgid "no %s cache exists, creating...\n"
msgstr "%s podėlis neegzistuoja, kuriamas...\n"
#, c-format
msgid "couldn't find or create package cache, using %s instead\n"
msgstr "nepavyko rasti ar sukurti podėlio paketui, vietoj jo naudojama %s\n"

View File

@@ -2,14 +2,16 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Alexander Rødseth <rodseth@gmail.com>, 2011.
# Jon Gjengset <jon@thesquareplanet.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-14 16:36+0000\n"
"Last-Translator: xyproto <rodseth@gmail.com>\n"
"Language-Team: Norwegian Bokmål (http://www.transifex.net/projects/p/"
"archlinux-pacman/team/nb/)\n"
"Language: nb\n"
@@ -32,7 +34,7 @@ msgstr "nedgraderer pakke %s (%s => %s)\n"
#, c-format
msgid "warning given when extracting %s (%s)\n"
msgstr "feilmelding gitt under utpakkingen av %s (%s)\n"
msgstr "fikk advarsel under utpakkingen av %s (%s)\n"
#, c-format
msgid "could not extract %s (%s)\n"
@@ -48,15 +50,15 @@ msgstr ""
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "utpakking: skriver ikke over mappe med fil %s\n"
msgstr "utpakking: overskriver ikke mappe med fil %s\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
msgstr "utpakking: symlink %s viser ikke til mappe\n"
msgstr "utpakking: symbolsk lenke %s peker ikke til mappe\n"
#, c-format
msgid "could not rename %s to %s (%s)\n"
msgstr "kunne ikke døpe om %s til %s (%s)\n"
msgstr "kunne ikke omdøpe %s til %s (%s)\n"
#, c-format
msgid "%s saved as %s\n"
@@ -76,12 +78,16 @@ msgstr "pakker ut %s som %s.pacnew\n"
#, c-format
msgid "could not get current working directory\n"
msgstr "kunne ikke motta nåværende mappe\n"
msgstr "kunne ikke finne gjeldende mappe\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "kunne ikke endre mappe til %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "kunne ikke gjenopprette gjeldende mappe (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "problem oppstod under oppgradering av %s\n"
@@ -92,11 +98,11 @@ msgstr "problem oppstod under installasjon av %s\n"
#, c-format
msgid "could not update database entry %s-%s\n"
msgstr "kunne ikke oppdatere databaseelement %s-%s\n"
msgstr "kunne ikke oppdatere databaseoppføring %s-%s\n"
#, c-format
msgid "could not add entry '%s' in cache\n"
msgstr "kunne ikke legge til '%s' i cache\n"
msgstr "kunne ikke legge til oppføringen '%s' i mellomlageret\n"
#, c-format
msgid "removing invalid database: %s\n"
@@ -104,15 +110,15 @@ msgstr "fjerner ugyldig database: %s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "ugyldig navn for databaseelement '%s'\n"
msgstr "ugyldig navn for databaseoppføring '%s'\n"
#, c-format
msgid "duplicated database entry '%s'\n"
msgstr "gjentatt databaseelement '%s'\n"
msgstr "duplikat databaseoppføring '%s'\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "korrupt databaseelement '%s'\n"
msgstr "korrupt databaseoppføring '%s'\n"
#, c-format
msgid "could not open file %s: %s\n"
@@ -120,11 +126,11 @@ msgstr "kunne ikke åpne fil %s: %s\n"
#, c-format
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "%s database er ukonsistent: navn samsvarer ikke med pakke %s\n"
msgstr "%s databasen er ikke konsistent: navn samsvarer ikke med pakke %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "%s database er ukonsistent: versjon samsvarer ikke med pakke %s\n"
msgstr "%s databasen er ikke konsistent: versjon samsvarer ikke med pakke %s\n"
#, c-format
msgid "could not create directory %s: %s\n"
@@ -132,7 +138,7 @@ msgstr "kunne ikke opprette mappe %s: %s\n"
#, c-format
msgid "could not parse package description file in %s\n"
msgstr "kunne ikke analysere pakkebeskrivelse i fil %s\n"
msgstr "kunne ikke tolke filen med pakkebeskrivelse i %s\n"
#, c-format
msgid "missing package name in %s\n"
@@ -144,7 +150,7 @@ msgstr "mangler pakkeversjon i %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "feil oppstod under lesing av pakke: %s: %s\n"
msgstr "feil oppstod ved lesing av pakke: %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
@@ -156,15 +162,15 @@ msgstr "fjerner ugyldig fil: %s\n"
#, c-format
msgid "could not remove lock file %s\n"
msgstr "kunne ikke fjerne låsingsfil %s\n"
msgstr "kunne ikke fjerne låsefil %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "kunne ikke tolke filen med pakkebeskrivelse '%s' fra databasen '%s'\n"
#, c-format
msgid "database path is undefined\n"
msgstr "databaseplassering er udefinert\n"
msgstr "stien til databasen er udefinert\n"
#, c-format
msgid "dependency cycle detected:\n"
@@ -184,15 +190,15 @@ msgstr "ignorerer pakke %s-%s\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "kan ikke avgjøre \"%s\", en avhengighet av \"%s\"\n"
msgstr "kan ikke finne \"%s\", en avhengighet av \"%s\"\n"
#, c-format
msgid "could not get filesystem information\n"
msgstr "kunne ikke hente filsysteminformasjon\n"
msgstr "kunne ikke finne filsysteminformasjon\n"
#, c-format
msgid "could not get filesystem information for %s: %s\n"
msgstr "kunne ikke hente filsysteminformasjon for %s: %s\n"
msgstr "kunne ikke finne filsysteminformasjon for %s: %s\n"
#, c-format
msgid "could not determine mount point for file %s\n"
@@ -204,44 +210,43 @@ msgstr "kunne ikke avgjøre monteringspunkt for filsystem\n"
#, c-format
msgid "could not determine root mount point %s\n"
msgstr "kunne ikke avgjøre rotmonteringspunkt %s\n"
msgstr "kunne ikke avgjøre monteringspunkt for root %s\n"
#, c-format
msgid "Partition %s is mounted read only\n"
msgstr "Partisjonen %s er kun tilgjengelig for skriving\n"
msgstr "Partisjonen %s kan bare leses fra\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
"Partisjonen %s er for full: %ld blokker trengs, %ld blokker tilgjengelig\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Partisjonen %s er for full: %jd blokker trengs, %jd blokker er ledig\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr "kunne ikke opprette midlertidig fil i sammengeng med nedlasting\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' er ugyldig\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "mottakelse av fil '%s' fra %s : %s feilet\n"
msgstr "kunne ikke hente filen '%s' fra %s : %s\n"
#, c-format
msgid "%s appears to be truncated: %jd/%jd bytes\n"
msgstr "%s ser ut til å være trunkert: %jd/%jd bytes\n"
msgstr "%s ser ut til å være avkortet: %jd/%jd bytes\n"
#, c-format
msgid "failed to download %s\n"
msgstr "nedlasting av %s feilet\n"
msgstr "kunne ikke laste ned %s\n"
#, c-format
msgid "out of memory!"
msgstr "ikke mer minne!"
msgstr "tom for minne!"
#, c-format
msgid "unexpected system error"
@@ -249,7 +254,7 @@ msgstr "uventet systemfeil"
#, c-format
msgid "insufficient privileges"
msgstr "ikke nok rettigheter"
msgstr "utilstrekkelige tilgangsrettigheter"
#, c-format
msgid "could not find or read file"
@@ -269,43 +274,43 @@ msgstr "ikke nok ledig diskplass"
#, c-format
msgid "library not initialized"
msgstr "bibliotek ikke initialisert"
msgstr "bibliotek har ikke blitt initialisert"
#, c-format
msgid "library already initialized"
msgstr "bibliotek allerede initialisert"
msgstr "bibliotek har allerede blitt initialisert"
#, c-format
msgid "unable to lock database"
msgstr "kunne ikke låse database"
msgstr "kunne ikke låse databasen"
#, c-format
msgid "could not open database"
msgstr "kunne ikke åpne database"
msgstr "kunne ikke åpne databasen"
#, c-format
msgid "could not create database"
msgstr "kunne ikke opprette database"
msgstr "kunne ikke opprette databasen"
#, c-format
msgid "database not initialized"
msgstr "database ikke initialisert"
msgstr "databasen har ikke blitt initialisert"
#, c-format
msgid "database already registered"
msgstr "database allerede registret"
msgstr "databasen har allerede blitt registrert"
#, c-format
msgid "could not find database"
msgstr "kunne ikke finne database"
msgstr "kunne ikke finne databasen"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "ugyldig eller korrupt database"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "ugyldig eller korrupt database (PGP signatur)"
#, c-format
msgid "database is incorrect version"
@@ -313,47 +318,47 @@ msgstr "databasen har feil versjonsnummer"
#, c-format
msgid "could not update database"
msgstr "kunne ikke oppdatere database"
msgstr "kunne ikke oppdatere databasen"
#, c-format
msgid "could not remove database entry"
msgstr "kunne ikke fjerne databaseelement"
msgstr "kunne ikke fjerne databaseoppføring"
#, c-format
msgid "invalid url for server"
msgstr "ugyldig url for server"
msgstr "ugyldig url for tjener"
#, c-format
msgid "no servers configured for repository"
msgstr "ingen servere konfigurert for pakkebrønn"
msgstr "ingen tjenere har blitt satt opp for pakkebrønn"
#, c-format
msgid "transaction already initialized"
msgstr "transaksjon allerede initialisert"
msgstr "transaksjonen har allerede blitt initialisert"
#, c-format
msgid "transaction not initialized"
msgstr "transaksjon ikke initialisert"
msgstr "transaksjonen har ikke blitt initialisert"
#, c-format
msgid "duplicate target"
msgstr "klonet mål"
msgstr "duplikate mål"
#, c-format
msgid "transaction not prepared"
msgstr "transaksjon ikke forberedt"
msgstr "transaksjonen er ikke forberedt"
#, c-format
msgid "transaction aborted"
msgstr "transaksjon avsluttet"
msgstr "transaksjon avbrutt"
#, c-format
msgid "operation not compatible with the transaction type"
msgstr "operasjon ikke kompatibel med transaksjonstypen"
msgstr "handlingen er ikke kompatibel med transaksjonstypen"
#, c-format
msgid "transaction commit attempt when database is not locked"
msgstr "førsøk på utføring av transaksjon mens databasen ikke er lukket"
msgstr "forsøkte å utføre transaksjon med ulåst database"
#, c-format
msgid "could not find or read package"
@@ -361,35 +366,35 @@ msgstr "kunne ikke finne eller lese pakke"
#, c-format
msgid "operation cancelled due to ignorepkg"
msgstr "operasjon avsluttet grunnet ignorepkg"
msgstr "handling avbrutt pga ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "invalid"
msgstr "ugyldig eller korrupt pakke"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "ugyldig eller korrupt pakke (sjekksum)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "ugyldig eller korrupt pakke (PGP signatur)"
#, c-format
msgid "cannot open package file"
msgstr "kan ikke åpne pakkefil"
msgstr "kunne ikke åpne pakkefil"
#, c-format
msgid "cannot remove all files for package"
msgstr "kan ikke fjerne alle filer for pakke"
msgstr "kunne ikke fjerne alle filer for pakke"
#, c-format
msgid "package filename is not valid"
msgstr "pakkens filnavn er ikke gyldig"
msgstr "pakkefilnavn er ugyldig"
#, c-format
msgid "package architecture is not valid"
msgstr "pakkearkitekturen er ikke gyldig"
msgstr "pakkearkitektur er ugyldig"
#, c-format
msgid "could not find repository for target"
@@ -397,19 +402,19 @@ msgstr "fant ikke pakkebrønn for mål"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "mangler PGP signatur"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "ugyldig PGP signatur"
#, c-format
msgid "invalid or corrupted delta"
msgstr "invalid"
msgstr "ugyldig eller korrupt filforskjell"
#, c-format
msgid "delta patch failed"
msgstr "delta-patch feilet"
msgstr "fiks av filforskjell feilet"
#, c-format
msgid "could not satisfy dependencies"
@@ -417,19 +422,19 @@ msgstr "kunne ikke tilfredstille avhengigheter"
#, c-format
msgid "conflicting dependencies"
msgstr "modstridige avhengigheter"
msgstr "motstridende avhengigheter"
#, c-format
msgid "conflicting files"
msgstr "modstridige filer"
msgstr "motstridende filer"
#, c-format
msgid "failed to retrieve some files"
msgstr "mottagelsen av noen filer feilet"
msgstr "noen filer kunne ikke hentes"
#, c-format
msgid "invalid regular expression"
msgstr "ugyldig uttrykk"
msgstr "ugyldig regulært uttrykk"
#, c-format
msgid "libarchive error"
@@ -441,15 +446,19 @@ msgstr "feil i nedlastingsbibliotek"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "gpgme feil"
#, c-format
msgid "error invoking external downloader"
msgstr "påkalling av ekstern nedlaster feilet"
msgstr "feil ved bruk av eksternt nedlastningsprogram"
#, c-format
msgid "unexpected error"
msgstr "uforventet feil"
msgstr "uventet feil"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "kunne ikke laste all metadata for pakken %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
@@ -461,19 +470,19 @@ msgstr "fjerner %s fra målliste\n"
#, c-format
msgid "cannot remove file '%s': %s\n"
msgstr "kan ikke fjerne fil '%s': %s\n"
msgstr "kunne ikke fjerne fil '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "kunne ikke fjerne %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
msgstr "kunne ikke fjerne databaseelement %s-%s\n"
msgstr "kunne ikke fjerne databaseoppføring %s-%s\n"
#, c-format
msgid "could not remove entry '%s' from cache\n"
msgstr "kunne ikke fjerne element '%s' fra cache\n"
msgstr "kunne ikke fjerne oppføring '%s' fra mellomlageret\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
@@ -485,7 +494,7 @@ msgstr "%s: ignorerer pakkenedgradering (%s => %s)\n"
#, c-format
msgid "%s: downgrading from version %s to version %s\n"
msgstr "%s: nedgradering fra versjon %s til versjon %s\n"
msgstr "%s: nedgraderer fra versjon %s til versjon %s\n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
@@ -493,11 +502,11 @@ msgstr "%s: lokal (%s) er nyere enn %s (%s)\n"
#, c-format
msgid "ignoring package replacement (%s-%s => %s-%s)\n"
msgstr "ignorerer utbytting av pakke (%s-%s => %s-%s)\n"
msgstr "ignorerer erstatning for pakke (%s-%s => %s-%s)\n"
#, c-format
msgid "cannot replace %s by %s\n"
msgstr "kan ikke bytte ut %s med %s\n"
msgstr "kunne ikke erstatte %s med %s\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
@@ -505,39 +514,43 @@ msgstr "uløselige pakkekonflikter oppdaget\n"
#, c-format
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "fjerner '%s' fra mållisten fordi den strider mot '%s'\n"
msgstr "fjerner '%s' fra mållisten fordi den er i konflikt med '%s'\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "feilet å motta noen filer fra %s\n"
msgstr "kunne ikke motta alle filer fra %s\n"
#, c-format
msgid "could not commit removal transaction\n"
msgstr "kunne ikke begå fjerningstransaksjon\n"
msgstr "kunne ikke utføre transaksjon (fjerning)\n"
#, c-format
msgid "could not commit transaction\n"
msgstr "kunne ikke begå transaksjon\n"
msgstr "kunne ikke utføre transaksjon\n"
#, c-format
msgid "could not create temp directory\n"
msgstr "kunne ikke opprette midlertidig mappe\n"
msgstr "kunne ikke lage midlertidig mappe\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "kunne ikke kopiere midertidig fil til %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "kunne ikke fjerne %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "kunne ikke fjerne midlertidig mappe %s\n"
#, c-format
msgid "could not create pipe (%s)\n"
msgstr "kunne ikke opprette filter (%s)\n"
msgstr "kunne ikke opprette dataledning (%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
msgstr "kunne ikke skille ut en ny prosess (%s)\n"
msgstr "kunne ikke føde en ny prosess (%s)\n"
#, c-format
msgid "could not change the root directory (%s)\n"
@@ -549,20 +562,22 @@ msgstr "kall til execv feilet (%s)\n"
#, c-format
msgid "call to waitpid failed (%s)\n"
msgstr "kall waitpid feilet (%s)\n"
msgstr "kall til waitpid feilet (%s)\n"
#, c-format
msgid "could not open pipe (%s)\n"
msgstr "kunne ikke opprette filter (%s)\n"
msgstr "kunne ikke åpne dataledning (%s)\n"
#, c-format
msgid "command failed to execute correctly\n"
msgstr "kommando feilet å kjøre korrekt\n"
msgstr "kommandoen feilet\n"
#, c-format
msgid "no %s cache exists, creating...\n"
msgstr "ingen %s cache eksisterer, lager en ...\n"
msgstr "mellomlageret %s eksisterer ikke, oppretter...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "kunne ikke danne pakke-cache, bruker /tmp istedenfor\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"kunne ikke finne eller opprette mellomlager for pakker, bruker %s "
"istedenfor\n"

View File

@@ -2,14 +2,15 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Bartek Piotrowski <barthalion@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-08 09:10+0000\n"
"Last-Translator: Barthalion <barthalion@gmail.com>\n"
"Language-Team: Polish (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/pl/)\n"
"Language: pl\n"
@@ -44,7 +45,7 @@ msgid ""
"directory permissions differ on %s\n"
"filesystem: %o package: %o\n"
msgstr ""
"Różne prawa dla %s\n"
"Różne uprawnienia dla katalogu dla %s\n"
"system plików: %o pakiet: %o\n"
#, c-format
@@ -83,6 +84,10 @@ msgstr "nie można znaleźć obecnego katalogu\n"
msgid "could not change directory to %s (%s)\n"
msgstr "nie udało się zmienić katalogu na %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "nie można powrócić do katalogu roboczego (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "wystąpiły błędy podczas aktualizacji %s\n"
@@ -133,7 +138,7 @@ msgstr "nie można stworzyć katalogu %s: %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"
msgstr "nie udało się odczytać pliku opisowego w %s\n"
#, c-format
msgid "missing package name in %s\n"
@@ -161,7 +166,7 @@ msgstr "nie udało się usunąć pliku blokującego %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "nie można odczytać pliku opisowego pakietu '%s' z bazy '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -173,7 +178,7 @@ msgstr "wykryto cykl zależności:\n"
#, c-format
msgid "%s will be removed after its %s dependency\n"
msgstr "%s zostanie usunięta po zależniościach %s\n"
msgstr "%s zostanie usunięta po zależnościach %s\n"
#, c-format
msgid "%s will be installed before its %s dependency\n"
@@ -212,21 +217,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "Partycja %s jest zamontowana tylko do odczytu\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
"Partycja %s jest zapełniona: %ld potrzebnych bloków, %ld wolnych bloków\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Partycja %s jest zbyt pełna: potrzebne jest %jd bloków, %jd wolnych\n"
#, c-format
msgid "disk"
msgstr "dysk"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' jest błędny\n"
msgid "failed to create temporary file for download\n"
msgstr "nie udało się stworzyć tymczasowego pliku pobierania\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "url '%s' jest błędny\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -262,7 +266,7 @@ msgstr "nie udało się znaleźć bądź odczytać katalogu"
#, c-format
msgid "wrong or NULL argument passed"
msgstr "Dany został błędny bądź ZEROWY argument"
msgstr "Dany został błędny bądź pusty argument"
#, c-format
msgid "not enough free disk space"
@@ -302,11 +306,11 @@ msgstr "nie udało się odnaleźć bazy danych"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "Niepoprawna lub uszkodzona baza danych"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "Niepoprawna lub uszkodzona baza danych (podpis PGP)"
#, c-format
msgid "database is incorrect version"
@@ -364,17 +368,17 @@ msgstr "nie udało się znaleźć bądź odczytać pakietu"
msgid "operation cancelled due to ignorepkg"
msgstr "operacja anulowana przez ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "nieprawidłowy bądź uszkodzony pakiet przyrostowy"
msgstr "Niepoprawny lub uszkodzony pakiet"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "Niepoprawny lub uszkodzony pakiet (suma kontrolna)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "Niepoprawny lub uszkodzony pakiet (podpis PGP)"
#, c-format
msgid "cannot open package file"
@@ -398,11 +402,11 @@ msgstr "nie mogę znaleźć repozytorium dla celu"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "brakujący podpis PGP"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "niepoprawny podpis PGP"
#, c-format
msgid "invalid or corrupted delta"
@@ -442,7 +446,7 @@ msgstr "błąd pobierania biblioteki"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "błąd gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -453,6 +457,10 @@ msgstr ""
msgid "unexpected error"
msgstr "niespodziewany błąd"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "nie można w pełni załadować metadanych dla pakietu %s-%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"
@@ -467,7 +475,7 @@ msgstr "nie udało się usunąć pliku '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "nie można usunąć %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -515,11 +523,11 @@ msgstr "nie udało się pobrać niektórych plików z %s\n"
#, c-format
msgid "could not commit removal transaction\n"
msgstr "nie udało się wykonać tranzakcji usuwania\n"
msgstr "nie udało się wykonać transakcji usuwania\n"
#, c-format
msgid "could not commit transaction\n"
msgstr "nie udało się wykonać tranzakcji\n"
msgstr "nie udało się wykonać transakcji\n"
#, c-format
msgid "could not create temp directory\n"
@@ -529,6 +537,10 @@ msgstr "nie udało się stworzyć katalogu tymczasowego\n"
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 remove %s\n"
msgstr "nie można usunąć %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "nie udało się usunąć katalogu tymczasowego %s\n"
@@ -566,6 +578,7 @@ msgid "no %s cache exists, creating...\n"
msgstr "brak pamięci podręcznej dla %s, tworzenie...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"nie udało się stworzyć pamięci podręcznej pakietu, używanie /tmp w zamian\n"
"nie można odnaleźć lub stworzyć pamięci podręcznej pakietu, używam %s w "
"zamian\n"

View File

@@ -2,14 +2,15 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Gaspar Santos <omeuviolino@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-12 13:05+0000\n"
"Last-Translator: ArchGalileu <omeuviolino@gmail.com>\n"
"Language-Team: Portuguese (http://www.transifex.net/projects/p/archlinux-"
"pacman/team/pt/)\n"
"Language: pt\n"
@@ -82,6 +83,10 @@ msgstr "não foi possível obter o diretório de trabalho actual\n"
msgid "could not change directory to %s (%s)\n"
msgstr "não foi possível mudar o diretório para %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "não é possível restaurar diretório em trabalho (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "ocorreram erros durante a actualização de %s\n"
@@ -162,6 +167,7 @@ msgstr "não foi possível remover o ficheiro bloqueado %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
"não é possível analisar descrição do pacote '%s' da base de dados '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -214,22 +220,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "A partição %s está montada somente para leitura\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
"A partição %s está cheia: são necessários %ld blocos, estão livres %ld "
"blocos\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Partição %s sem espaço: Necessário %jd blocos, livre %jd blocos\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' é inválida\n"
msgid "failed to create temporary file for download\n"
msgstr "Erro ao criar ficheiro temporário para download\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "url '%s' é inválida\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -305,11 +309,11 @@ msgstr "não foi possível encontrar a base de dados"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "base de dados inválida ou corrompida"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "base de dados inválida ou corrompida (assinatura PGP)"
#, c-format
msgid "database is incorrect version"
@@ -367,17 +371,17 @@ msgstr "não foi possível ler ou escrever o pacote"
msgid "operation cancelled due to ignorepkg"
msgstr "operação cancelada devido a ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "delta inválido ou corrompido"
msgstr "pacote inválido ou corrompido"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "pacote inválido ou corrompido (checksum)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "pacote inválido ou corrompido (assinatura PGP)"
#, c-format
msgid "cannot open package file"
@@ -401,11 +405,11 @@ msgstr "não foi possível encontrar o repositório para o pacote"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "assinatura PGP em falta"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "assinatura PGP inválida"
#, c-format
msgid "invalid or corrupted delta"
@@ -445,7 +449,7 @@ msgstr "erro na biblioteca de descargas"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "erro GPGME"
#, c-format
msgid "error invoking external downloader"
@@ -455,6 +459,11 @@ msgstr "erro ao invocar o programa de descargas externo"
msgid "unexpected error"
msgstr "erro inesperado"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr ""
"não é possível apresentar na totalidade metadados para o pacote %s-%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 - a ignorar\n"
@@ -469,7 +478,7 @@ msgstr "não foi possível remover o ficheiro '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "Não é possível remover%s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -531,6 +540,10 @@ msgstr "não foi possível criar diretório temporário\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "não foi possível copiar ficheiro temporário para %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "não é possível remover%s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "não foi possível remover o diretório temporário %s\n"
@@ -568,6 +581,7 @@ msgid "no %s cache exists, creating...\n"
msgstr "cache %s não existe, a criar...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"não foi possível criar cache de pacotes, a usar /tmp como alternativa\n"
"não é possível encontrar ou criar cache do pacote, em uso %s como "
"alternativa\n"

View File

@@ -2,16 +2,18 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Sandro <sandrossv@hotmail.com>, 2011.
# Translators:
# ambaratti <ambaratti.listas@gmail.com>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Rafael <rafael.f.f1@gmail.com>, 2011.
# Sandro <sandrossv@hotmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 03:50+0000\n"
"Last-Translator: rafaelff1 <rafael.f.f1@gmail.com>\n"
"Language-Team: Portuguese (Brazilian) (http://www.transifex.net/projects/p/"
"archlinux-pacman/team/pt_BR/)\n"
"Language: pt_BR\n"
@@ -84,6 +86,10 @@ msgstr "não foi possível obter o diretório de trabalho atual\n"
msgid "could not change directory to %s (%s)\n"
msgstr "não foi possível mudar para o diretório %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "Falha em recuperar diretório de trabalho (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "ocorreram problemas durante a atualização de %s\n"
@@ -165,6 +171,8 @@ msgstr "não foi possível remover o arquivo de trava %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
"não foi possível analisar arquivo de descrição de pacote '%s' da base de "
"dados '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -172,7 +180,7 @@ msgstr "caminho da base de dados não definido\n"
#, c-format
msgid "dependency cycle detected:\n"
msgstr "dependência cíclica detetada:\n"
msgstr "dependência cíclica detectada:\n"
#, c-format
msgid "%s will be removed after its %s dependency\n"
@@ -217,21 +225,21 @@ msgid "Partition %s is mounted read only\n"
msgstr "Partição %s está montada somente para leitura\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
"A partição %s está cheia: %ld bloco(s) necessário(s), %ld bloco(s) livre(s)\n"
"Partição %s está cheia: %jd blocos necessários, %jd blocos disponíveis\n"
#, c-format
msgid "disk"
msgstr "disco"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "a url '%s' é inválida\n"
msgid "failed to create temporary file for download\n"
msgstr "falha em criar arquivo temporário para download\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "a url '%s' é inválida\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -307,11 +315,11 @@ msgstr "não foi possível encontrar a base de dados"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "base de dados inválida ou corrompida"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "base de dados inválida ou corrompida (assinatura PGP)"
#, c-format
msgid "database is incorrect version"
@@ -369,17 +377,17 @@ msgstr "não foi possível ler ou escrever o pacote"
msgid "operation cancelled due to ignorepkg"
msgstr "operação cancelada devido a ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "delta inválido ou corrompido"
msgstr "pacote inválido ou corrompido"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "pacote inválido ou corrompido (checksum)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "pacote inválido ou corrompido (assinatura PGP)"
#, c-format
msgid "cannot open package file"
@@ -403,11 +411,11 @@ msgstr "não foi possível encontrar o repositório para o pacote"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "assinatura PGP faltando"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "assinatura PGP inválida"
#, c-format
msgid "invalid or corrupted delta"
@@ -447,7 +455,7 @@ msgstr "erro na biblioteca de download"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "erro no gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -457,6 +465,10 @@ msgstr "erro ao chamar o programa de download externo"
msgid "unexpected error"
msgstr "erro inesperado"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "falha em carregar completamente os metadados para o pacote %s-%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 -- ignorando\n"
@@ -467,11 +479,11 @@ msgstr "removendo \"%s\" da lista de pacotes a serem atualizados\n"
#, c-format
msgid "cannot remove file '%s': %s\n"
msgstr "não foi possível remover o arquivo '%s': %s\n"
msgstr "não foi possível remover o arquivo \"%s\": %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "Não pude remover %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -479,7 +491,7 @@ msgstr "não foi possível remover o registro da base de dados %s-%s\n"
#, c-format
msgid "could not remove entry '%s' from cache\n"
msgstr "não foi possível remover a entrada '%s' do cache\n"
msgstr "não foi possível remover a entrada \"%s\" do cache\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
@@ -507,11 +519,11 @@ msgstr "não foi possível substituir %s por %s\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "conflito de pacotes não solucionável detetado\n"
msgstr "conflito de pacotes não solucionável detectado\n"
#, c-format
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"
msgstr "removendo \"%s\" da lista de pacotes porque ele conflita com \"%s\"\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
@@ -533,6 +545,10 @@ msgstr "não foi possível criar diretório temporário\n"
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 remove %s\n"
msgstr "não foi possível remover %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "não foi possível remover o diretório temporário %s\n"
@@ -570,5 +586,6 @@ msgid "no %s cache exists, creating...\n"
msgstr "cache %s não existe, criando...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "não foi possível criar cache de pacotes, usando /tmp em seu lugar\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"falha em encontrar ou criar cache do pacote, usando %s em substituição.\n"

View File

@@ -2,17 +2,18 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# cantabile <cantabile.desu@gmail.com>, 2011.
# Mihai Coman <mihai@m1x.ro>, 2011.
# Ionut Biru <ibiru@archlinux.org>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Ionut Biru <ibiru@archlinux.org>, 2011.
# Mihai Coman <mihai@m1x.ro>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 17:25+0000\n"
"Last-Translator: z0id <mihai@m1x.ro>\n"
"Language-Team: Romanian (http://www.transifex.net/projects/p/archlinux-"
"pacman/team/ro/)\n"
"Language: ro\n"
@@ -88,6 +89,10 @@ msgstr ""
"nu s-a putut intra în directorul %s (%s)\n"
"\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "nu s-a putut reveni la directorul de lucru curent (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "problemă apărută la actualizarea %s\n"
@@ -170,6 +175,8 @@ msgstr "nu poate fi eliminat fișierul de blocare %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
"nu s-a putut analiza fișierul '%s' de descriere a pachetului din db '%s'\n"
"\n"
#, c-format
msgid "database path is undefined\n"
@@ -221,20 +228,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "partiția %s este montată numai citire\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr "Partiția %s e plină: %ld blocuri necesare, %ld blocuri disponibile\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Partiția %s prea plină: %jd blocuri necesare,%jd blocuri libere\n"
#, c-format
msgid "disk"
msgstr "disc"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "URL '%s' este nevalid\n"
msgid "failed to create temporary file for download\n"
msgstr "eșec la crearea fișierului temporar pentru descărcare\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "URL '%s' este nevalid\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -310,11 +317,11 @@ msgstr "nu poate fi găsită baza de date"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "bază de date coruptă sau nevalidă"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "bază de date coruptă sau nevalidă (semnătura PGP)"
#, c-format
msgid "database is incorrect version"
@@ -372,17 +379,17 @@ msgstr "pachetul nu poate fi găsit sau citit"
msgid "operation cancelled due to ignorepkg"
msgstr "operație abandonată datorită ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "delta invalid sau corupt"
msgstr "pachet corupt sau nevalid"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "pachet corupt sau nevalid (sumă de control)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "pachet corupt sau nevalid (semnătură PGP)"
#, c-format
msgid "cannot open package file"
@@ -406,11 +413,11 @@ msgstr "depozitul pentru țintă nu poate fi găsit"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "semnătură PGP lipsă"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "semnătură PGP nevalidă"
#, c-format
msgid "invalid or corrupted delta"
@@ -450,7 +457,7 @@ msgstr "eroare în biblioteca de descărcare"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "eroare gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -460,6 +467,10 @@ msgstr "eroare la invocarea descărcătorului extern"
msgid "unexpected error"
msgstr "eroare neașteptată"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "nu s-au putut încărca complet metadatele pentru pachetul %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "nu poate fi găsit %s în baza de date -- se omite\n"
@@ -474,7 +485,7 @@ msgstr "nu poate fi eliminat fișierul '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "nu se poate elimina %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -536,6 +547,10 @@ msgstr "nu poate fi creat directorul temp\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "nu se poate copia tempfile la %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "nu s-a putut elimina %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "nu poate fi eliminat tmpdir %s\n"
@@ -573,5 +588,6 @@ msgid "no %s cache exists, creating...\n"
msgstr "nu există cache %s, se crează...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "nu se poate crea cache pachet, se folosește /tmp în schimb\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"nu s-a putut găsi sau creea cache pentru pachet; se folosește %s în schimb.\n"

View File

@@ -2,15 +2,16 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Ivan Yurasov <vdk@gmx.us>, 2011.
# partizan <serg.partizan@gmail.com>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 03:39+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/ru/)\n"
@@ -85,6 +86,10 @@ msgstr "не удалось определить текущий рабочий
msgid "could not change directory to %s (%s)\n"
msgstr "не удалось изменить каталог на %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr ""
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "обнаружена проблема во время обновления %s\n"
@@ -216,23 +221,21 @@ msgid "Partition %s is mounted read only\n"
msgstr "Раздел %s смонтирован только для чтения\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
"Раздел %s заполнен полностью: необходимо %ld блоков, доступно %ld блоков\n"
"\n"
#, c-format
msgid "disk"
msgstr "диск"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "ссылка '%s' некорректна\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
#, c-format
msgid "url '%s' is invalid\n"
msgstr "ссылка '%s' некорректна\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "не удалось получить файл '%s' из %s : %s\n"
@@ -369,9 +372,9 @@ msgstr "не удалось найти или прочитать пакет"
msgid "operation cancelled due to ignorepkg"
msgstr "операция прервана из-за ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "ошибка или повреждение в дельте"
msgstr ""
#, c-format
msgid "invalid or corrupted package (checksum)"
@@ -457,6 +460,10 @@ msgstr "ошибка вызова внешнего менеджера загру
msgid "unexpected error"
msgstr "непредвиденная ошибка"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr ""
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "не удалось найти %s в базе данных -- пропускается\n"
@@ -533,6 +540,10 @@ msgstr "не удалось создать временный каталог\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "не удалось скопировать временный файл в %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr ""
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "не удалось удалить временный каталог %s\n"
@@ -570,5 +581,5 @@ 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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""

View File

@@ -2,14 +2,17 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Dušan Lago <dusan.lago@gmail.com>, 2011.
# <jose1711@gmail.com>, 2011.
# jose1711 <jose1711@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-08 19:38+0000\n"
"Last-Translator: jose1711 <jose1711@gmail.com>\n"
"Language-Team: Slovak (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/sk/)\n"
"Language: sk\n"
@@ -82,6 +85,10 @@ msgstr "nie je možné zistiť aktuálny pracovný adresár\n"
msgid "could not change directory to %s (%s)\n"
msgstr "nie je možné prepnúť sa do adresára %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "nie je možné obnoviť pracovný adresár (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "nastal problém pri aktualizácii %s\n"
@@ -160,7 +167,7 @@ msgstr "nie je možné odstrániť zamykací súbor %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "nie je možné nájsť súbor s popisom balíčku '%s' z databázy '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -211,21 +218,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "Partícia %s je pripojená iba v režime na čítanie\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
"Partícia %s je príliš plná: %ld blokov potrebných, %ld blokov voľných\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Oddiel %s je plný: bloky %jd sú potrebné, bloky %jd sú k dispozícií\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "URL '%s' je neplatná\n"
msgid "failed to create temporary file for download\n"
msgstr "chyba pri vytváraní dočasného súboru pre sťahovanie\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "URL '%s' je neplatná\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -301,11 +307,11 @@ msgstr "nemožno nájsť databázu"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "neplatná alebo poškodená databáza"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "neplatná alebo poškodená databáza (PGP podpis)"
#, c-format
msgid "database is incorrect version"
@@ -363,17 +369,17 @@ msgstr "nie je možné nájsť alebo prečítať balíček"
msgid "operation cancelled due to ignorepkg"
msgstr "operácia bola zrušená kvôli ignorovanému balíčku"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "neplatný alebo poškodený delta rozdiel"
msgstr "neplatný alebo poškodený balíček"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "neplatný alebo poškodený balíček (kontrolný súčet)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "neplatný alebo poškodený balíček (PGP podpis)"
#, c-format
msgid "cannot open package file"
@@ -397,11 +403,11 @@ msgstr "nie je možné nájsť repozitár cieľa"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "chýba PGP podpis"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "neplatný PGP podpis"
#, c-format
msgid "invalid or corrupted delta"
@@ -441,7 +447,7 @@ msgstr "chyba knižnice pre sťahovanie súborov"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "chyba v gpgme"
#, c-format
msgid "error invoking external downloader"
@@ -451,6 +457,10 @@ msgstr "chyba volania externého programu pre sťahovanie súborov"
msgid "unexpected error"
msgstr "neočakávaná chyba"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "nie je možné poriadne načítať metadata pre balíček %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "nie je možné nájsť %s v databáze -- preskakujem\n"
@@ -465,7 +475,7 @@ msgstr "nie je možné odstrániť súbor '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "nie je možné vymazať %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -527,6 +537,10 @@ msgstr "nie je možné vytvoriť dočasný adresár\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "nie je možné skopírovať dočasný súbor do %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "%s nie je možné vymazať\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "nie je možné odstrániť dočasný adresár %s\n"
@@ -564,5 +578,7 @@ msgid "no %s cache exists, creating...\n"
msgstr "neexistuje cache %s, vytváram...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "nie je možné vytvoriť cache balíčkov, použijem /tmp\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"nie je možné nájsť alebo vytvoriť cache pre balíček, miesto toho sa používa "
"%s\n"

View File

@@ -2,14 +2,15 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Slobodan Terzić <githzerai06@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-11 17:15+0000\n"
"Last-Translator: Xabre <githzerai06@gmail.com>\n"
"Language-Team: Serbian (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/sr/)\n"
"Language: sr\n"
@@ -83,6 +84,10 @@ msgstr "не могу да одредим радну фасциклу\n"
msgid "could not change directory to %s (%s)\n"
msgstr "не могу да променим фасциклу у %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "не могу да повратим радну фасциклу (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "дошло је до грешке при надоградњи %s\n"
@@ -161,7 +166,7 @@ msgstr "не могу да уклоним фајл браве %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "не могу да обрадим фајл описа пакета „%s“ из базе „%s“\n"
#, c-format
msgid "database path is undefined\n"
@@ -212,21 +217,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "Партиција %s је монтирана само за читање\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
"Партиција %s је препуна: потребно је %ld блокова, али је %ld слободно\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Партиција %s је препуна: потребно је %jd блокова, а слободно је %jd\n"
#, c-format
msgid "disk"
msgstr "диск"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "„%s“ је нисправан урл\n"
msgid "failed to create temporary file for download\n"
msgstr "неуспело стварање привременог фајла преузимања\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "„%s“ је нисправан урл\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -302,11 +306,11 @@ msgstr "не могу да нађем базу"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "неисправна или покварена база"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "неисправна или покварена база (ПГП потпис)"
#, c-format
msgid "database is incorrect version"
@@ -364,17 +368,17 @@ msgstr "не могу да нађем или прочитам пакет"
msgid "operation cancelled due to ignorepkg"
msgstr "радња је отказана због игнорисаног пакета"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "неисправна или покварена делта"
msgstr "неисправан или покварен пакет"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "неисправан или покварен пакет (сума за проверу)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "неисправан или покварен пакет (ПГП потпис)"
#, c-format
msgid "cannot open package file"
@@ -398,11 +402,11 @@ msgstr "не могу да нађем ризницу циља"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "недостаје ПГП потпис"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "неисправан ПГП потпис "
#, c-format
msgid "invalid or corrupted delta"
@@ -442,7 +446,7 @@ msgstr "грешка у библиотеци преузимања"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "грешка гпгмија"
#, c-format
msgid "error invoking external downloader"
@@ -452,6 +456,10 @@ msgstr "грешка при покретању спољног програма
msgid "unexpected error"
msgstr "неочекивана грешка"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "не могу у потпуности да учитам метаподатке пакета %s—%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "не могу да нађем %s у бази — прескачем\n"
@@ -466,7 +474,7 @@ msgstr "не могу да уклоним фајл „%s“: %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "не могу да уклоним %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -528,6 +536,10 @@ msgstr "не могу да направим привремену фасцикл
msgid "could not copy tempfile to %s (%s)\n"
msgstr "не могу да копирам привремени фајл у %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "не могу да уклоним %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "не могу да уклоним привремену фасциклу %s\n"
@@ -565,5 +577,5 @@ 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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr "не могу да нађем или направим кеш пакета, као замену корисим %s\n"

View File

@@ -2,14 +2,15 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Slobodan Terzić <githzerai06@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-12 15:08+0000\n"
"Last-Translator: Xabre <githzerai06@gmail.com>\n"
"Language-Team: Serbian (Latin) (http://www.transifex.net/projects/p/"
"archlinux-pacman/team/sr@latin/)\n"
"Language: sr@latin\n"
@@ -83,6 +84,10 @@ msgstr "ne mogu da odredim radnu fasciklu\n"
msgid "could not change directory to %s (%s)\n"
msgstr "ne mogu da promenim fasciklu u %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "ne mogu da povratim radnu fasciklu (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "došlo je do greške pri nadogradnji %s\n"
@@ -161,7 +166,7 @@ msgstr "ne mogu da uklonim fajl brave %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "ne mogu da obradim fajl opisa paketa „%s“ iz baze „%s“\n"
#, c-format
msgid "database path is undefined\n"
@@ -212,21 +217,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "Particija %s je montirana samo za čitanje\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
"Particija %s je prepuna: potrebno je %ld blokova, ali je %ld slobodno\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Particija %s je prepuna: potrebno je %jd blokova, a slobodno je %jd\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "„%s“ je nispravan url\n"
msgid "failed to create temporary file for download\n"
msgstr "neuspelo stvaranje privremenog fajla preuzimanja\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "„%s“ je nispravan url\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -302,11 +306,11 @@ msgstr "ne mogu da nađem bazu"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "neispravna ili pokvarena baza"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "neispravna ili pokvarena baza (PGP potpis)"
#, c-format
msgid "database is incorrect version"
@@ -364,17 +368,17 @@ msgstr "ne mogu da nađem ili pročitam paket"
msgid "operation cancelled due to ignorepkg"
msgstr "radnja je otkazana zbog ignorisanog paketa"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "neispravna ili pokvarena delta"
msgstr "neispravan ili pokvaren paket"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "neispravan ili pokvaren paket (suma za proveru)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "neispravan ili pokvaren paket (PGP potpis)"
#, c-format
msgid "cannot open package file"
@@ -398,11 +402,11 @@ msgstr "ne mogu da nađem riznicu cilja"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "nedostaje PGP potpis"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "neispravan PGP potpis "
#, c-format
msgid "invalid or corrupted delta"
@@ -434,7 +438,7 @@ msgstr "neispravan regularni izraz"
#, c-format
msgid "libarchive error"
msgstr "greška libarchivea"
msgstr "greška libarhajva"
#, c-format
msgid "download library error"
@@ -442,7 +446,7 @@ msgstr "greška u biblioteci preuzimanja"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "greška gpgmija"
#, c-format
msgid "error invoking external downloader"
@@ -452,6 +456,10 @@ msgstr "greška pri pokretanju spoljnog programa za preuzimanje"
msgid "unexpected error"
msgstr "neočekivana greška"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "ne mogu u potpunosti da učitam metapodatke paketa %s—%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "ne mogu da nađem %s u bazi — preskačem\n"
@@ -466,7 +474,7 @@ msgstr "ne mogu da uklonim fajl „%s“: %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "ne mogu da uklonim %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -528,6 +536,10 @@ msgstr "ne mogu da napravim privremenu fasciklu\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "ne mogu da kopiram privremeni fajl u %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "ne mogu da uklonim %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "ne mogu da uklonim privremenu fasciklu %s\n"
@@ -565,5 +577,5 @@ msgid "no %s cache exists, creating...\n"
msgstr "ne postoji keš za %s; pravim....\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "ne mogu da napravim keš paketa; koristim /tmp kao zamenu\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr "ne mogu da nađem ili napravim keš paketa, kao zamenu korisim %s\n"

View File

@@ -2,14 +2,17 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# , 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-11-15 15:42+0000\n"
"Last-Translator: Gazpachian <f.halldal@gmail.com>\n"
"Language-Team: Swedish (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/sv/)\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -30,7 +33,7 @@ msgstr "nedgraderar paketet %s (%s => %s)\n"
#, c-format
msgid "warning given when extracting %s (%s)\n"
msgstr ""
msgstr "varning given vid extrahering av %s (%s)\n"
#, c-format
msgid "could not extract %s (%s)\n"
@@ -80,6 +83,10 @@ msgstr "kunde inte hitta nuvarande sökväg\n"
msgid "could not change directory to %s (%s)\n"
msgstr "kunde inte byta katalog till %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "Kunde ej återställa arbetskatalogen (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "problem uppstod under uppgraderingen %s\n"
@@ -150,7 +157,7 @@ msgstr "saknar metadata för paketet i %s\n"
#, c-format
msgid "removing invalid file: %s\n"
msgstr ""
msgstr "Tar bort ogiltig fil: %s\n"
#, c-format
msgid "could not remove lock file %s\n"
@@ -158,7 +165,7 @@ msgstr "kunde inte ta bort låsningsfil %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "Kunde ej finna paketbeskrivningsfilen '%s' från databasen '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -186,43 +193,43 @@ msgstr "kan inte lösa \"%s\", beroende till \"%s\", \n"
#, c-format
msgid "could not get filesystem information\n"
msgstr ""
msgstr "Kunde ej hämta filsysteminformation\n"
#, c-format
msgid "could not get filesystem information for %s: %s\n"
msgstr ""
msgstr "Kunde ej hämta filsysteminformation för %s: %s\n"
#, c-format
msgid "could not determine mount point for file %s\n"
msgstr ""
msgstr "Kunde ej bestämma monteringspunkt för fil %s\n"
#, c-format
msgid "could not determine filesystem mount points\n"
msgstr ""
msgstr "Kunde ej bestämma filsystemmonteringspunkter\n"
#, c-format
msgid "could not determine root mount point %s\n"
msgstr ""
msgstr "Kunde ej bestämma rootmonteringspunkt %s\n"
#, c-format
msgid "Partition %s is mounted read only\n"
msgstr ""
msgstr "Partition %s är monterad utan skrivrättigheter\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Partition %s för full: %jd block behövs, %jd block fria\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' är ogiltigt\n"
msgid "failed to create temporary file for download\n"
msgstr "Kunde ej skapa temporär fil för nedladdning\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "url '%s' är ogiltigt\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -262,7 +269,7 @@ msgstr "fel eller inga argument angivna"
#, c-format
msgid "not enough free disk space"
msgstr ""
msgstr "ej tillräckligt fritt diskutrymme"
#, c-format
msgid "library not initialized"
@@ -298,15 +305,15 @@ msgstr "kunde inte hitta databas"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "ogiltig eller korrupt databas"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "ogiltig eller korrupt databas (PGP-signatur)"
#, c-format
msgid "database is incorrect version"
msgstr ""
msgstr "databas är av felaktig version"
#, c-format
msgid "could not update database"
@@ -360,17 +367,17 @@ msgstr "kunde inte hitta eller förbereda paket"
msgid "operation cancelled due to ignorepkg"
msgstr "operationen avbryten på grund av ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "ogiltig eller korrupt delta"
msgstr "ogiltigt eller korrupt paket"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "ogiltigt eller korrupt paket (checksum)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "ogiltigt eller korrupt paket (PGP-signatur)"
#, c-format
msgid "cannot open package file"
@@ -394,11 +401,11 @@ msgstr "givet förråd finns inte"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "saknad PGP-signatur"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "ogiltig PGP-signatur"
#, c-format
msgid "invalid or corrupted delta"
@@ -438,7 +445,7 @@ msgstr "fel vid nerladdning av bibliotek"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "gpgme-fel"
#, c-format
msgid "error invoking external downloader"
@@ -448,6 +455,10 @@ msgstr "fel vid anrop av extern nerladdare"
msgid "unexpected error"
msgstr "oväntat fel"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "kunde ej ladda metadata för paket %s-%s fullständigt\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "kunde inte hitta %s i databasen -- hoppar över\n"
@@ -462,7 +473,7 @@ msgstr "kan inte ta bort '%s': %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "kunde ej ta bort %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -524,13 +535,17 @@ msgstr "kunde inte skapa temporär katalog\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "kunde inte kopiera temporär fil till %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "kunde ej ta bort %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "kunde inte ta bort tmpdir %s\n"
#, c-format
msgid "could not create pipe (%s)\n"
msgstr ""
msgstr "kunde ej skapa pipe (%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
@@ -542,7 +557,7 @@ msgstr "kunde inte byta rootkatalogen (%s)\n"
#, c-format
msgid "call to execv failed (%s)\n"
msgstr ""
msgstr "anrop till execv misslyckades (%s)\n"
#, c-format
msgid "call to waitpid failed (%s)\n"
@@ -550,7 +565,7 @@ msgstr "anrop till waitpid misslyckades (%s)\n"
#, c-format
msgid "could not open pipe (%s)\n"
msgstr ""
msgstr "kunde ej öppna pipe (%s)\n"
#, c-format
msgid "command failed to execute correctly\n"
@@ -561,5 +576,5 @@ msgid "no %s cache exists, creating...\n"
msgstr "ingen %s cache existerar, skapar...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "kunde inte skapa paket-cache, använder /tmp istället\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr "kunde ej hitta eller skapa paketcache, använder %s istället\n"

View File

@@ -2,15 +2,17 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Samed Beyribey <ras0ir@eventualis.org>, 2011.
# Translators:
# Atilla Öntaş <tarakbumba@gmail.com>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
# Samed Beyribey <ras0ir@eventualis.org>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-23 09:34+0000\n"
"Last-Translator: tarakbumba <tarakbumba@gmail.com>\n"
"Language-Team: Turkish (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/tr/)\n"
"Language: tr\n"
@@ -83,6 +85,10 @@ msgstr "üzerinde çalışılan dizin algılanamadı\n"
msgid "could not change directory to %s (%s)\n"
msgstr "%s dizinine geçilemedi (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "çalışılan dizin (%s) geri yüklenemiyor\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "%s güncellenirken bir sorun meydana geldi\n"
@@ -161,7 +167,7 @@ msgstr "kilit dosyası %s silinemedi\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "'%s' paket açıklama dosyası '%s' veritabanından ayrıştırılamıyor\n"
#, c-format
msgid "database path is undefined\n"
@@ -212,20 +218,20 @@ msgid "Partition %s is mounted read only\n"
msgstr "%s bölümü salt okunur olarak bağlandı\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr "%s bölümü dolu: %ld blok gerekiyor, %ld blok boş\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "%s disk bölümü çok dolu: %jd blok gerekli, %jd blok boş\n"
#, c-format
msgid "disk"
msgstr "disk"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "'%s' adresi geçersiz\n"
msgid "failed to create temporary file for download\n"
msgstr "indirilecek geçici dosya oluşturulamıyor\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "'%s' adresi geçersiz\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -301,11 +307,11 @@ msgstr "veritabanı bulunamadı"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "geçersiz veya bozuk veritabanı"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "geçersiz veya bozuk veritabanı (PGP imzası)"
#, c-format
msgid "database is incorrect version"
@@ -363,17 +369,17 @@ msgstr "paket bulunamadı veya okunamadı"
msgid "operation cancelled due to ignorepkg"
msgstr "ignorepkg nedeniyle işlem iptal edildi"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "geçersiz ya da bozuk veri"
msgstr "geçersiz veya bozuk paket"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "geçersiz veya bozuk paket (doğrulama)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "geçersiz veya bozuk paket (PGP imzası)"
#, c-format
msgid "cannot open package file"
@@ -397,11 +403,11 @@ msgstr "hedef için depo bulunamadı"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "kayıp PGP imzası"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "geçersiz PGP imzası"
#, c-format
msgid "invalid or corrupted delta"
@@ -441,7 +447,7 @@ msgstr "indirme kütüphanesi hatası"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "gpgme hatası"
#, c-format
msgid "error invoking external downloader"
@@ -451,6 +457,10 @@ msgstr "harici indiriciyi çağırırken hata oluştu"
msgid "unexpected error"
msgstr "beklenmedik hata"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "%s-%s paketi için meta verisi tam olarak yüklenemiyor\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "%s veritabanında bulunamadı -- atlanıyor\n"
@@ -465,7 +475,7 @@ msgstr "'%s' dosyası silinemiyor: %s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "%s(%s) kaldırılamıyor\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -528,6 +538,10 @@ msgstr "geçici dizin oluşturulamadı\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "geçici dosya %s üzerine kopyalanamadı (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "%s kaldırılamıyor\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "geçici dizin %s kaldırılamadı\n"
@@ -565,5 +579,6 @@ msgid "no %s cache exists, creating...\n"
msgstr "%s önbelleği yok, oluşturuluyor...\n"
#, c-format
msgid "couldn't create package cache, using /tmp instead\n"
msgstr "paket önbelleği oluşturulamadı, /tmp kullanılacak\n"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"paket önbelleği oluşturulamıyor veya bulunamıyor, yerine %s kullanılıyor\n"

View File

@@ -2,14 +2,18 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Yarema aka Knedlyk <yupadmin@gmail.com>, 2011.
# Данило Коростіль <ted.korostiled@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-10 20:43+0000\n"
"Last-Translator: Wiseacre <ted.korostiled@gmail.com>\n"
"Language-Team: Ukrainian (http://www.transifex.net/projects/p/archlinux-"
"pacman/team/uk/)\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -19,11 +23,11 @@ msgstr ""
#, 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"
@@ -31,7 +35,7 @@ msgstr "пониження версії пакунку %s (%s => %s)\n"
#, c-format
msgid "warning given when extracting %s (%s)\n"
msgstr ""
msgstr "Видається попередження протягом розпакування %s (%s)\n"
#, c-format
msgid "could not extract %s (%s)\n"
@@ -42,12 +46,12 @@ msgid ""
"directory permissions differ on %s\n"
"filesystem: %o package: %o\n"
msgstr ""
"права каталога відрізняються на\n"
"права каталогу відрізняються у\n"
"файловій системі %s: %o пакунок: %o\n"
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "розпакування: каталог не було перезаписано файлом %s\n"
msgstr "розпакування: каталог не перезаписано файлом %s\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
@@ -75,19 +79,23 @@ msgstr "розпакування %s як %s.pacnew\n"
#, c-format
msgid "could not get current working directory\n"
msgstr "неможливо отримати поточний робочий каталог\n"
msgstr "неможливо одержати поточний робочий каталог\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "неможливо змінити каталог на %s (%s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "неможливо відновити робочий каталог (%s)\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"
@@ -95,23 +103,23 @@ msgstr "неможливо оновити запис бази даних %s-%s\n
#, c-format
msgid "could not add entry '%s' in cache\n"
msgstr "неможливо додати запис '%s' у кеш\n"
msgstr "неможливо додати запис «%s» у кеш\n"
#, c-format
msgid "removing invalid database: %s\n"
msgstr "вилучення невірної бази даних: %s\n"
msgstr "вилучення неправильної бази даних: %s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "невірне ім'я для запису бази даних '%s'\n"
msgstr "неправильна назва для запису бази даних «%s»\n"
#, c-format
msgid "duplicated database entry '%s'\n"
msgstr "дублікат у базі даних '%s'\n"
msgstr "дублікат у базі даних «%s»\n"
#, c-format
msgid "corrupted database entry '%s'\n"
msgstr "пошкоджений запис у базі даних '%s'\n"
msgstr "пошкоджений запис у базі даних «%s»\n"
#, c-format
msgid "could not open file %s: %s\n"
@@ -119,11 +127,11 @@ msgstr "неможливо відкрити файл %s: %s\n"
#, c-format
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "база даних %s неоднорідна: неспівпадіння назви для пакунка %s\n"
msgstr "база даних %s неоднорідна: не збігаються назви для пакунка %s\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "база даних %s неоднорідна: неспівпадіння версій для пакунка %s\n"
msgstr "база даних %s неоднорідна: не збігаються версії для пакунка %s\n"
#, c-format
msgid "could not create directory %s: %s\n"
@@ -135,23 +143,23 @@ msgstr "неможливо розібрати файл опису пакунка
#, c-format
msgid "missing package name in %s\n"
msgstr "бракує імені пакунку в %s\n"
msgstr "бракує назви пакунка в %s\n"
#, c-format
msgid "missing package version in %s\n"
msgstr "бракує версії пакунку в %s\n"
msgstr "бракує версії пакунка в %s\n"
#, c-format
msgid "error while reading package %s: %s\n"
msgstr "помилка при читанні пакунку %s: %s\n"
msgstr "помилка при читанні пакунка %s: %s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "бракує метаданих пакунку в %s\n"
msgstr "бракує метаданих пакунка в %s\n"
#, c-format
msgid "removing invalid file: %s\n"
msgstr ""
msgstr "вилучення неправильного файла : %s\n"
#, c-format
msgid "could not remove lock file %s\n"
@@ -159,7 +167,7 @@ msgstr "неможливо вилучити файл блокування %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "неможливо розібрати файла опису пакунка «%s» з бази даних «%s»\n"
#, c-format
msgid "database path is undefined\n"
@@ -175,7 +183,7 @@ msgstr "%s буде вилучено після його залежності %s
#, c-format
msgid "%s will be installed before its %s dependency\n"
msgstr "%s буде встановлено перед його %s залежністю\n"
msgstr "%s буде встановлено перед його залежністю %s\n"
#, c-format
msgid "ignoring package %s-%s\n"
@@ -183,59 +191,59 @@ 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 "could not get filesystem information\n"
msgstr ""
msgstr "неможливо одержати інформації про файлову систему\n"
#, c-format
msgid "could not get filesystem information for %s: %s\n"
msgstr ""
msgstr "неможливо одержати інформації про файлову систему для %s: %s\n"
#, c-format
msgid "could not determine mount point for file %s\n"
msgstr ""
msgstr "неможливо визначити точки монтування для файла %s\n"
#, c-format
msgid "could not determine filesystem mount points\n"
msgstr ""
msgstr "неможливо визначити файлові системи точок монтування\n"
#, c-format
msgid "could not determine root mount point %s\n"
msgstr ""
msgstr "неможливо визначити корінь точки монтування %s\n"
#, c-format
msgid "Partition %s is mounted read only\n"
msgstr ""
msgstr "Розділ %s змонтовано лише для читання\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr ""
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "Розділ %s — надто повний; %jd блоків потрібно, %jd блоків вільно\n"
#, c-format
msgid "disk"
msgstr "диск"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "посилання '%s' невірне\n"
msgid "failed to create temporary file for download\n"
msgstr "не вдалось створити тимчасово файла для звантаження\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "посилання «%s» неправильне\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "не вдалося отримати файл '%s' з %s : %s\n"
msgstr "не вдалось одержати файл «%s» з %s : %s\n"
#, c-format
msgid "%s appears to be truncated: %jd/%jd bytes\n"
msgstr "здається %s обрізаний: %jd/%jd байтів\n"
msgstr "здається, %s обрізаний: %jd/%jd байтів\n"
#, c-format
msgid "failed to download %s\n"
msgstr "не вдалося завантажити %s\n"
msgstr "не вдалось звантажити %s\n"
#, c-format
msgid "out of memory!"
@@ -259,19 +267,19 @@ msgstr "неможливо знайти чи прочитати каталог"
#, c-format
msgid "wrong or NULL argument passed"
msgstr "передано невірний аргумент чи NULL"
msgstr "передано неправильний аргумент або NULL"
#, c-format
msgid "not enough free disk space"
msgstr ""
msgstr "недостатньо вільного місця на диску "
#, c-format
msgid "library not initialized"
msgstr "бібліотека не ініціалізована"
msgstr "бібліотеку не запущено"
#, c-format
msgid "library already initialized"
msgstr "бібліотека вже ініціалізована"
msgstr "бібліотеку вже запущено"
#, c-format
msgid "unable to lock database"
@@ -287,11 +295,11 @@ msgstr "неможливо створити базу даних"
#, c-format
msgid "database not initialized"
msgstr "база даних не ініціалізована"
msgstr "базу даних не запущено"
#, c-format
msgid "database already registered"
msgstr "база даних вже зареєстрована"
msgstr "базу даних уже зареєстровано"
#, c-format
msgid "could not find database"
@@ -299,15 +307,15 @@ msgstr "неможливо знайти базу даних"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "неправильна або пошкоджена база даних"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "неправильна або пошкоджена база даних (підпис PGP)"
#, c-format
msgid "database is incorrect version"
msgstr ""
msgstr "база даних має неправильну версію"
#, c-format
msgid "could not update database"
@@ -319,19 +327,19 @@ msgstr "неможливо вилучити запис з бази даних"
#, c-format
msgid "invalid url for server"
msgstr "невірне посилання чи сервер"
msgstr "неправильне посилання чи сервер"
#, c-format
msgid "no servers configured for repository"
msgstr "для репозиторія не налаштовано жодного сервера"
msgstr "не налаштовано жодного сервера для сховища"
#, c-format
msgid "transaction already initialized"
msgstr "транзакція вже ініціалізована"
msgstr "транзакцію вже запущено"
#, c-format
msgid "transaction not initialized"
msgstr "транзакція не ініціалізована"
msgstr "транзакцію не запущено"
#, c-format
msgid "duplicate target"
@@ -339,11 +347,11 @@ msgstr "продубльований цільовий пакунок"
#, c-format
msgid "transaction not prepared"
msgstr "транзакція не підготовлена"
msgstr "транзакцію не підготовлено"
#, c-format
msgid "transaction aborted"
msgstr "транзакцію перервано"
msgstr "транзакцію скасовано"
#, c-format
msgid "operation not compatible with the transaction type"
@@ -351,7 +359,7 @@ msgstr "операція несумісна з типом транзакції"
#, c-format
msgid "transaction commit attempt when database is not locked"
msgstr "спроба здійснити транзакцію в той час як база даних не є замкненою"
msgstr "спроба здійснити транзакцію, коли базу даних не замкнено"
#, c-format
msgid "could not find or read package"
@@ -359,55 +367,55 @@ msgstr "неможливо знайти чи прочитати пакунок"
#, c-format
msgid "operation cancelled due to ignorepkg"
msgstr "операцію відмінено через ignorepkg"
msgstr "операцію скасовано через ignorepkg"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "невірний чи пошкоджений дельта-патч"
msgstr "неправильний або пошкоджений пакунок"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "неправильний або пошкоджений пакунок (контрольна сума)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "неправильний або пошкоджений пакунок (підпис PGP)"
#, c-format
msgid "cannot open package file"
msgstr "неможливо відкрити файл пакунку"
msgstr "неможливо відкрити файл пакунка"
#, c-format
msgid "cannot remove all files for package"
msgstr "неможливо вилучити всі файли для пакунку"
msgstr "неможливо вилучити всі файли для пакунка"
#, c-format
msgid "package filename is not valid"
msgstr "ім'я файлу пакунку невірне"
msgstr "назва файла пакунку неправильна"
#, c-format
msgid "package architecture is not valid"
msgstr "архітектура пакунку невірна"
msgstr "архітектура пакунка неправильна"
#, c-format
msgid "could not find repository for target"
msgstr "неможливо знайти репозиторій з пакунком"
msgstr "неможливо знайти сховища з пакунком"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "немає підпису "
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "неправильний підпис "
#, c-format
msgid "invalid or corrupted delta"
msgstr "невірний чи пошкоджений дельта-патч"
msgstr "неправильна або пошкоджена різниця"
#, c-format
msgid "delta patch failed"
msgstr "накладення дельта-патчу невдале"
msgstr "Не вдалось накласти різницю"
#, c-format
msgid "could not satisfy dependencies"
@@ -415,19 +423,19 @@ msgstr "неможливо забезпечити залежності"
#, c-format
msgid "conflicting dependencies"
msgstr "конфліктуючі залежності"
msgstr "конфлікті залежності"
#, c-format
msgid "conflicting files"
msgstr "конфліктуючі файли"
msgstr "конфлікті файли"
#, c-format
msgid "failed to retrieve some files"
msgstr "не вдалося отримати деякі файли"
msgstr "не вдалось одержати деякі файли"
#, c-format
msgid "invalid regular expression"
msgstr "невірний регулярний вираз"
msgstr "неправильний формальний вираз"
#, c-format
msgid "libarchive error"
@@ -435,35 +443,39 @@ msgstr "помилка libarchive"
#, c-format
msgid "download library error"
msgstr "помилка бібліотеки завантаження"
msgstr "помилка бібліотеки звантаження"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "помилка "
#, c-format
msgid "error invoking external downloader"
msgstr "помилка виклику зовнішнього завантажувача"
msgstr "помилка виклику зовнішнього звантажувача"
#, c-format
msgid "unexpected error"
msgstr "неочікувана помилка"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "неможливо повністю завантажити метадані для пакунка %s-%s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "неможливо знайти %s в базі даних -- пропускається\n"
msgstr "неможливо знайти %s в базі даних пропускається\n"
#, c-format
msgid "removing %s from target list\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 "cannot remove %s (%s)\n"
msgstr ""
msgstr "неможливо вилучити %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -471,7 +483,7 @@ msgstr "неможливо вилучити запис бази даних %s-%s
#, c-format
msgid "could not remove entry '%s' from cache\n"
msgstr "неможливо вилучити запис '%s' з кешу\n"
msgstr "неможливо вилучити запис «%s» з кешу\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
@@ -499,15 +511,15 @@ msgstr "неможливо замінити %s на %s\n"
#, c-format
msgid "unresolvable package conflicts detected\n"
msgstr "виявлені нерозв'язні конфлікти пакунків\n"
msgstr "виявлено нерозв'язні конфлікти пакунків\n"
#, c-format
msgid "removing '%s' from target list because it conflicts with '%s'\n"
msgstr "вилучення '%s' з списку пакунків, бо він конфліктує з '%s'\n"
msgstr "вилучення «%s» зі списку пакунків через конфлікт з «%s»\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "не вдалося отримати деякі файли з %s\n"
msgstr "не вдалось одержати деякі файли з %s\n"
#, c-format
msgid "could not commit removal transaction\n"
@@ -519,19 +531,23 @@ msgstr "неможливо здійснити транзакцію\n"
#, c-format
msgid "could not create temp directory\n"
msgstr "неиожливо створити тимчасовий каталог\n"
msgstr "неможливо створити тимчасовий каталог\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "неможливо скопіювати тимчасовий файл до %s (%s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "неможливо вилучити %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "неможливо вилучити тимчасовий каталог %s\n"
#, c-format
msgid "could not create pipe (%s)\n"
msgstr ""
msgstr "неможливо створити вузол (%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
@@ -543,24 +559,25 @@ msgstr "неможливо змінити кореневий каталог (%s)
#, c-format
msgid "call to execv failed (%s)\n"
msgstr ""
msgstr "не вдалось викликати execv (%s)\n"
#, c-format
msgid "call to waitpid failed (%s)\n"
msgstr "виклик waitpid невдалий (%s)\n"
msgstr "не вдалось викликати waitpid (%s)\n"
#, c-format
msgid "could not open pipe (%s)\n"
msgstr ""
msgstr "неможливо відкрити вузол (%s)\n"
#, c-format
msgid "command failed to execute correctly\n"
msgstr "команда не змогла виконатися коректно\n"
msgstr "команда не змогла виконатись коректно\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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""
"неможливо знайти або створити кеш пакунків, використовуючи %s натомість\n"

View File

@@ -2,6 +2,7 @@
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# Dan McGee <dpmcgee@gmail.com>, 2011.
# leonfeng <rainofchaos@gmail.com>, 2011.
# 甘 露 <rhythm.gan@gmail.com>, 2011.
@@ -9,9 +10,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-08-09 15:51-0500\n"
"PO-Revision-Date: 2011-08-08 22:33+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-11-15 02:39+0000\n"
"Last-Translator: ganlu <rhythm.gan@gmail.com>\n"
"Language-Team: Chinese (China) (http://www.transifex.net/projects/p/"
"archlinux-pacman/team/zh_CN/)\n"
"Language: zh_CN\n"
@@ -84,6 +85,10 @@ msgstr "无法得到当前的工作目录\n"
msgid "could not change directory to %s (%s)\n"
msgstr "无法更改目录到 %1$s (%2$s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr "无法恢复工作目录 (%s)\n"
#, c-format
msgid "problem occurred while upgrading %s\n"
msgstr "更新 %s 时出现错误\n"
@@ -162,7 +167,7 @@ msgstr "无法删除锁定文件 %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr ""
msgstr "无法解析软件包描述文件 '%s' 从数据库 '%s'\n"
#, c-format
msgid "database path is undefined\n"
@@ -215,20 +220,20 @@ msgstr ""
"\n"
#, c-format
msgid "Partition %s too full: %ld blocks needed, %ld blocks free\n"
msgstr "分区 %s 无可用空间:需要 %ld 区,可用 %ld 区\n"
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr "分区 %s 太满:需要 %jd 区,可用 %jd 区\n"
#, c-format
msgid "disk"
msgstr "硬盘"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' 无效\n"
msgid "failed to create temporary file for download\n"
msgstr "无法创建下载用的临时文件\n"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr ""
msgid "url '%s' is invalid\n"
msgstr "url '%s' 无效\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
@@ -304,11 +309,11 @@ msgstr "无法找到数据库"
#, c-format
msgid "invalid or corrupted database"
msgstr ""
msgstr "无效或已损坏的数据库"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr ""
msgstr "无效或已损坏的数据库 (PGP 签名)"
#, c-format
msgid "database is incorrect version"
@@ -366,17 +371,17 @@ msgstr "无法找到或读取软件包"
msgid "operation cancelled due to ignorepkg"
msgstr "由于 ignorepkg 指定,操作已取消"
#, fuzzy, c-format
#, c-format
msgid "invalid or corrupted package"
msgstr "无效或已损坏的 delta"
msgstr "无效或已损坏的软件包"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr ""
msgstr "无效或已损坏的软件包 (检验值)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr ""
msgstr "无效或已损坏的软件包 (PGP 签名)"
#, c-format
msgid "cannot open package file"
@@ -400,11 +405,11 @@ msgstr "无法为目标找到软件库"
#, c-format
msgid "missing PGP signature"
msgstr ""
msgstr "缺失 PGP 签名"
#, c-format
msgid "invalid PGP signature"
msgstr ""
msgstr "无效 PGP 签名"
#, c-format
msgid "invalid or corrupted delta"
@@ -444,7 +449,7 @@ msgstr "下载函数库出错"
#, c-format
msgid "gpgme error"
msgstr ""
msgstr "pgpme 错误"
#, c-format
msgid "error invoking external downloader"
@@ -454,6 +459,10 @@ msgstr "调用外部下载程序时出错"
msgid "unexpected error"
msgstr "未预期的错误"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr "无法完全加载软件包 %s 的元数据 - %s\n"
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "无法在数据库中找到 %s -- 跳过\n"
@@ -468,7 +477,7 @@ msgstr "无法删除文件 '%1$s': %2$s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr ""
msgstr "无法删除 %s (%s)\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
@@ -484,7 +493,7 @@ msgstr "%1$s忽略软件包更新%2$s => %3$s\n"
#, c-format
msgid "%s: ignoring package downgrade (%s => %s)\n"
msgstr "%1$s正在忽略软件包经济%2$s => %3$s\n"
msgstr "%1$s正在忽略软件包降级%2$s => %3$s\n"
#, c-format
msgid "%s: downgrading from version %s to version %s\n"
@@ -530,6 +539,10 @@ msgstr "无法创建临时目录\n"
msgid "could not copy tempfile to %s (%s)\n"
msgstr "无法复制临时文件到 %1$s (%2$s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr "无法删除 %s\n"
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "无法删除临时目录 %s\n"
@@ -567,5 +580,5 @@ 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"
msgid "couldn't find or create package cache, using %s instead\n"
msgstr "无法找到或创建软件包缓存,使用 %s 中\n"

582
lib/libalpm/po/zh_TW.po Normal file
View File

@@ -0,0 +1,582 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
# <dlin.tw@gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-11-13 21:47-0600\n"
"PO-Revision-Date: 2011-10-06 03:39+0000\n"
"Last-Translator: toofishes <dpmcgee@gmail.com>\n"
"Language-Team: Chinese (Taiwan) (http://www.transifex.net/projects/p/"
"archlinux-pacman/team/zh_TW/)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
#, c-format
msgid "%s-%s is up to date -- skipping\n"
msgstr "%1$s-%2$s 已經爲最新 -- 跳過\n"
#, c-format
msgid "%s-%s is up to date -- reinstalling\n"
msgstr "%1$s-%2$s 已經爲最新 -- 重新安裝\n"
#, c-format
msgid "downgrading package %s (%s => %s)\n"
msgstr "正在降級軟件包 %1$s (%2$s => %3$s)\n"
#, c-format
msgid "warning given when extracting %s (%s)\n"
msgstr "解壓 %s 時出現警告 (%s)\n"
#, c-format
msgid "could not extract %s (%s)\n"
msgstr "無法解壓縮 %1$s (%2$s)\n"
#, c-format
msgid ""
"directory permissions differ on %s\n"
"filesystem: %o package: %o\n"
msgstr ""
"目錄權限不一致 %1$s\n"
"文件系統:%2$o 軟件包:%3$o\n"
#, c-format
msgid "extract: not overwriting dir with file %s\n"
msgstr "解壓縮:沒有用文件 %s 覆蓋目錄\n"
#, c-format
msgid "extract: symlink %s does not point to dir\n"
msgstr "解壓縮:符號鏈接 %s 沒有指向目錄\n"
#, c-format
msgid "could not rename %s to %s (%s)\n"
msgstr "無法將 %1$s 重命名爲 %2$s (%3$s)\n"
#, c-format
msgid "%s saved as %s\n"
msgstr "%1$s 已另存爲 %2$s\n"
#, c-format
msgid "could not install %s as %s (%s)\n"
msgstr "無法將 %1$s 安裝爲 %2$s (%3$s)\n"
#, c-format
msgid "%s installed as %s\n"
msgstr "%1$s 已安裝爲 %2$s\n"
#, c-format
msgid "extracting %s as %s.pacnew\n"
msgstr "正在解壓縮 %1$s 爲 %2$s.pacnew\n"
#, c-format
msgid "could not get current working directory\n"
msgstr "無法得到當前的工作目錄\n"
#, c-format
msgid "could not change directory to %s (%s)\n"
msgstr "無法更改目錄到 %1$s (%2$s)\n"
#, c-format
msgid "could not restore working directory (%s)\n"
msgstr ""
#, 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 "無法更新數據庫記錄 %1$s-%2$s\n"
#, c-format
msgid "could not add entry '%s' in cache\n"
msgstr "無法在緩存中添加記錄 '%s' \n"
#, c-format
msgid "removing invalid database: %s\n"
msgstr "正在刪除無效的數據庫: %s\n"
#, c-format
msgid "invalid name for database entry '%s'\n"
msgstr "數據庫記錄 '%s' 名字無效\n"
#, c-format
msgid "duplicated 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 "無法打開文件 %1$s: %2$s\n"
#, c-format
msgid "%s database is inconsistent: name mismatch on package %s\n"
msgstr "%1$s 數據庫不一致:名字和軟件包中的 %2$s 不一致\n"
#, c-format
msgid "%s database is inconsistent: version mismatch on package %s\n"
msgstr "%1$s 數據庫不一致:版本和軟件包中的 %2$s 不一致\n"
#, c-format
msgid "could not create directory %s: %s\n"
msgstr "無法更改目錄到 %1$s%2$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 "讀取軟件包 %1$s 發生錯誤: %2$s\n"
#, c-format
msgid "missing package metadata in %s\n"
msgstr "%s 中缺少軟件包元數據\n"
#, c-format
msgid "removing invalid file: %s\n"
msgstr "刪除無效文件: %s\n"
#, c-format
msgid "could not remove lock file %s\n"
msgstr "無法刪除鎖定文件 %s\n"
#, c-format
msgid "could not parse package description file '%s' from db '%s'\n"
msgstr "無法處理套件描述檔 '%s' 從套件庫 '%s'\\n\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 "%1$s 將在它 %2$s 的依賴關係之後被刪除\n"
#, c-format
msgid "%s will be installed before its %s dependency\n"
msgstr "%1$s 將在它 %2$s 的依賴關係之前被安裝\n"
#, c-format
msgid "ignoring package %s-%s\n"
msgstr "正在忽略軟件包更新 %s-%s\n"
#, c-format
msgid "cannot resolve \"%s\", a dependency of \"%s\"\n"
msgstr "無法解決 \"%1$s\"\"%2$s\" 的一個依賴關係\n"
#, c-format
msgid "could not get filesystem information\n"
msgstr "無法獲取文件系統的信息\n"
#, c-format
msgid "could not get filesystem information for %s: %s\n"
msgstr "無法爲 %s 獲得文件系統信息:%s\n"
#, c-format
msgid "could not determine mount point for file %s\n"
msgstr "無法確定文件 %s 的掛載點\n"
#, c-format
msgid "could not determine filesystem mount points\n"
msgstr "無法測定文件系統掛載點\n"
#, c-format
msgid "could not determine root mount point %s\n"
msgstr "無法測定根分區掛載點 %s\n"
#, c-format
msgid "Partition %s is mounted read only\n"
msgstr ""
"分區 %s 爲只讀\n"
"\n"
#, c-format
msgid "Partition %s too full: %jd blocks needed, %jd blocks free\n"
msgstr ""
#, c-format
msgid "disk"
msgstr "硬盤"
#, c-format
msgid "failed to create temporary file for download\n"
msgstr "無法建立下載暫存檔\\n\n"
#, c-format
msgid "url '%s' is invalid\n"
msgstr "url '%s' 無效\n"
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr "無法從 %2$s : %3$s 獲取文件 '%1$s'\n"
#, c-format
msgid "%s appears to be truncated: %jd/%jd bytes\n"
msgstr "%s 可縮小:%jd/%jd bytes\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 "not enough free disk space"
msgstr "剩餘空間不夠"
#, 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 "invalid or corrupted database"
msgstr "資料庫不正確或損毀"
#, c-format
msgid "invalid or corrupted database (PGP signature)"
msgstr "資料庫不正確或損毀 (PGP 簽章)"
#, c-format
msgid "database is incorrect version"
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 "無效的服務器 url"
#, c-format
msgid "no servers configured for repository"
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 "transaction commit attempt when database is not locked"
msgstr "未鎖定數據庫即提交了事務處理嘗試"
#, c-format
msgid "could not find or read package"
msgstr "無法找到或讀取軟件包"
#, c-format
msgid "operation cancelled due to ignorepkg"
msgstr "由於 ignorepkg 指定,操作已取消"
#, c-format
msgid "invalid or corrupted package"
msgstr "無效的或已損壞的軟件包"
#, c-format
msgid "invalid or corrupted package (checksum)"
msgstr "資料庫不正確或損毀(檢查碼)"
#, c-format
msgid "invalid or corrupted package (PGP signature)"
msgstr "套件不正確或損毀 (PGP 簽章)"
#, c-format
msgid "cannot open package file"
msgstr "無法打開軟件包文件"
#, c-format
msgid "cannot remove all files for package"
msgstr "無法爲軟件包刪除全部文件"
#, c-format
msgid "package filename is not valid"
msgstr "軟件包文件名無效"
#, c-format
msgid "package architecture is not valid"
msgstr "無效的軟件包架構"
#, c-format
msgid "could not find repository for target"
msgstr "無法爲目標找到軟件庫"
#, c-format
msgid "missing PGP signature"
msgstr "缺乏 PGP 簽章"
#, c-format
msgid "invalid PGP signature"
msgstr "PGP 簽章不正確"
#, c-format
msgid "invalid or corrupted delta"
msgstr "無效的或已損壞的 delta"
#, c-format
msgid "delta patch failed"
msgstr "delta 補丁失敗"
#, c-format
msgid "could not satisfy dependencies"
msgstr "無法滿足依賴關係"
#, c-format
msgid "conflicting dependencies"
msgstr "有衝突的依賴關係"
#, c-format
msgid "conflicting files"
msgstr "有衝突的文件"
#, c-format
msgid "failed to retrieve some files"
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 "gpgme error"
msgstr "gpgme 錯誤"
#, c-format
msgid "error invoking external downloader"
msgstr "調用外部下載程序時出錯"
#, c-format
msgid "unexpected error"
msgstr "未預期的錯誤"
#, c-format
msgid "could not fully load metadata for package %s-%s\n"
msgstr ""
#, c-format
msgid "could not find %s in database -- skipping\n"
msgstr "無法在數據庫中找到 %s -- 跳過\n"
#, c-format
msgid "removing %s from target list\n"
msgstr "正在從目標清單中刪除 '%s' \n"
#, c-format
msgid "cannot remove file '%s': %s\n"
msgstr "無法刪除文件 '%1$s': %2$s\n"
#, c-format
msgid "cannot remove %s (%s)\n"
msgstr "無法移除 %s (%s)\\n\n"
#, c-format
msgid "could not remove database entry %s-%s\n"
msgstr "無法刪除數據庫記錄 %1$s-%2$s\n"
#, c-format
msgid "could not remove entry '%s' from cache\n"
msgstr "無法從緩存中刪除記錄 '%s'\n"
#, c-format
msgid "%s: ignoring package upgrade (%s => %s)\n"
msgstr "%1$s忽略軟件包更新%2$s => %3$s\n"
#, c-format
msgid "%s: ignoring package downgrade (%s => %s)\n"
msgstr "%1$s正在忽略軟件包經濟%2$s => %3$s\n"
#, c-format
msgid "%s: downgrading from version %s to version %s\n"
msgstr "%s正在從版本 %s 降級爲 %s \n"
#, c-format
msgid "%s: local (%s) is newer than %s (%s)\n"
msgstr "%1$s本地%2$s比 %3$s 的版本更新 (%4$s)\n"
#, c-format
msgid "ignoring package replacement (%s-%s => %s-%s)\n"
msgstr "正在忽略軟件包更新 (%s-%s => %s-%s)\n"
#, c-format
msgid "cannot replace %s by %s\n"
msgstr "無法用文件 '%2$s' 替代 %1$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 "正在從目標清單中刪除 '%1$s' ,因爲它和 '%2$s' 衝突\n"
#, c-format
msgid "failed to retrieve some files from %s\n"
msgstr "無法從 %s 獲取某些文件\n"
#, c-format
msgid "could not commit removal transaction\n"
msgstr "無法交付可撤銷處理\n"
#, c-format
msgid "could not commit transaction\n"
msgstr "無法交付處理\n"
#, c-format
msgid "could not create temp directory\n"
msgstr "無法創建臨時目錄\n"
#, c-format
msgid "could not copy tempfile to %s (%s)\n"
msgstr "無法複製臨時文件到 %1$s (%2$s)\n"
#, c-format
msgid "could not remove %s\n"
msgstr ""
#, c-format
msgid "could not remove tmpdir %s\n"
msgstr "無法刪除臨時目錄 %s\n"
#, c-format
msgid "could not create pipe (%s)\n"
msgstr "無法創建管道(%s)\n"
#, c-format
msgid "could not fork a new process (%s)\n"
msgstr "無法 fork 新進程 (%s)\n"
#, c-format
msgid "could not change the root directory (%s)\n"
msgstr "無法更改根目錄 (%s)\n"
#, c-format
msgid "call to execv failed (%s)\n"
msgstr "調用 execv 失敗 (%s)\n"
#, c-format
msgid "call to waitpid failed (%s)\n"
msgstr "調用 waitpid 失敗 (%s)\n"
#, c-format
msgid "could not open pipe (%s)\n"
msgstr "無法打開管道(%s)\n"
#, c-format
msgid "command failed to execute correctly\n"
msgstr "命令未能被正確執行\n"
#, c-format
msgid "no %s cache exists, creating...\n"
msgstr "沒有 %s 緩存存在,正在創建...\n"
#, c-format
msgid "couldn't find or create package cache, using %s instead\n"
msgstr ""

View File

@@ -49,6 +49,7 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
{
const char *pkgname;
alpm_trans_t *trans;
alpm_pkg_t *copy;
/* Sanity checks */
CHECK_HANDLE(handle, return -1);
@@ -67,11 +68,14 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
_alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s to the transaction remove list\n",
pkgname);
trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(pkg));
if(_alpm_pkg_dup(pkg, &copy) == -1) {
return -1;
}
trans->remove = alpm_list_add(trans->remove, copy);
return 0;
}
static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp)
static int remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp)
{
alpm_trans_t *trans = handle->trans;
@@ -81,14 +85,18 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp)
alpm_depmissing_t *miss = i->data;
alpm_pkg_t *info = _alpm_db_get_pkgfromcache(handle->db_local, miss->target);
if(info) {
if(!_alpm_pkg_find(trans->remove, alpm_pkg_get_name(info))) {
alpm_pkg_t *copy;
if(!_alpm_pkg_find(trans->remove, info->name)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "pulling %s in target list\n",
alpm_pkg_get_name(info));
trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(info));
info->name);
if(_alpm_pkg_dup(info, &copy) == -1) {
return -1;
}
trans->remove = alpm_list_add(trans->remove, copy);
}
} else {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not find %s in database -- skipping\n"),
miss->target);
_alpm_log(handle, ALPM_LOG_ERROR,
_("could not find %s in database -- skipping\n"), miss->target);
}
}
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_depmiss_free);
@@ -96,6 +104,7 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp)
lp = alpm_checkdeps(handle, _alpm_db_get_pkgcache(handle->db_local),
trans->remove, NULL, 1);
}
return 0;
}
static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp)
@@ -117,7 +126,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp)
pkg = vpkg;
if(pkg) {
_alpm_log(handle, ALPM_LOG_WARNING, _("removing %s from target list\n"),
alpm_pkg_get_name(pkg));
pkg->name);
_alpm_pkg_free(pkg);
}
}
@@ -134,6 +143,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp)
* the packages blocking the transaction.
* @param handle the context handle
* @param data a pointer to an alpm_list_t* to fill
* @return 0 on success, -1 on error
*/
int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
{
@@ -144,19 +154,23 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
if((trans->flags & ALPM_TRANS_FLAG_RECURSE)
&& !(trans->flags & ALPM_TRANS_FLAG_CASCADE)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "finding removable dependencies\n");
_alpm_recursedeps(db, trans->remove,
trans->flags & ALPM_TRANS_FLAG_RECURSEALL);
if(_alpm_recursedeps(db, trans->remove,
trans->flags & ALPM_TRANS_FLAG_RECURSEALL)) {
return -1;
}
}
if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
EVENT(trans, ALPM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
EVENT(handle, ALPM_EVENT_CHECKDEPS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for unsatisfied dependencies\n");
lp = alpm_checkdeps(handle, _alpm_db_get_pkgcache(db), trans->remove, NULL, 1);
if(lp != NULL) {
if(trans->flags & ALPM_TRANS_FLAG_CASCADE) {
remove_prepare_cascade(handle, lp);
if(remove_prepare_cascade(handle, lp)) {
return -1;
}
} else if(trans->flags & ALPM_TRANS_FLAG_UNNEEDED) {
/* Remove needed packages (which would break dependencies)
* from target list */
@@ -184,11 +198,14 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
if((trans->flags & ALPM_TRANS_FLAG_CASCADE)
&& (trans->flags & ALPM_TRANS_FLAG_RECURSE)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "finding removable dependencies\n");
_alpm_recursedeps(db, trans->remove, trans->flags & ALPM_TRANS_FLAG_RECURSEALL);
if(_alpm_recursedeps(db, trans->remove,
trans->flags & ALPM_TRANS_FLAG_RECURSEALL)) {
return -1;
}
}
if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
EVENT(trans, ALPM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
EVENT(handle, ALPM_EVENT_CHECKDEPS_DONE, NULL, NULL);
}
return 0;
@@ -199,12 +216,12 @@ static int can_remove_file(alpm_handle_t *handle, const alpm_file_t *file,
{
char filepath[PATH_MAX];
snprintf(filepath, PATH_MAX, "%s%s", handle->root, file->name);
if(alpm_list_find_str(skip_remove, filepath)) {
if(alpm_list_find_str(skip_remove, file->name)) {
/* return success because we will never actually remove this file */
return 1;
}
snprintf(filepath, PATH_MAX, "%s%s", handle->root, file->name);
/* If we fail write permissions due to a read-only filesystem, abort.
* Assume all other possible failures are covered somewhere else */
if(_alpm_access(handle, NULL, filepath, W_OK) == -1) {
@@ -300,17 +317,21 @@ static int unlink_file(alpm_handle_t *handle, alpm_pkg_t *info,
int cmp = filehash ? strcmp(filehash, backup->hash) : 0;
FREE(filehash);
if(cmp != 0) {
char newpath[PATH_MAX];
snprintf(newpath, PATH_MAX, "%s.pacsave", file);
char *newpath;
size_t len = strlen(file) + 8 + 1;
MALLOC(newpath, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(newpath, len, "%s.pacsave", file);
if(rename(file, newpath)) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
file, newpath, strerror(errno));
alpm_logaction(handle, "error: could not rename %s to %s (%s)\n",
file, newpath, strerror(errno));
free(newpath);
return -1;
}
_alpm_log(handle, ALPM_LOG_WARNING, _("%s saved as %s\n"), file, newpath);
alpm_logaction(handle, "warning: %s saved as %s\n", file, newpath);
free(newpath);
return 0;
}
}
@@ -338,24 +359,23 @@ int _alpm_remove_single_package(alpm_handle_t *handle,
const char *pkgname = oldpkg->name;
const char *pkgver = oldpkg->version;
alpm_filelist_t *filelist;
char scriptlet[PATH_MAX];
size_t i;
if(newpkg) {
_alpm_log(handle, ALPM_LOG_DEBUG, "removing old package first (%s-%s)\n",
pkgname, pkgver);
} else {
EVENT(handle->trans, ALPM_TRANS_EVT_REMOVE_START, oldpkg, NULL);
EVENT(handle, ALPM_EVENT_REMOVE_START, oldpkg, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "removing package %s-%s\n",
pkgname, pkgver);
snprintf(scriptlet, PATH_MAX, "%s%s-%s/install",
_alpm_db_path(handle->db_local), pkgname, pkgver);
/* run the pre-remove scriptlet if it exists */
if(alpm_pkg_has_scriptlet(oldpkg) &&
!(handle->trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle, scriptlet, "pre_remove", pkgver, NULL);
char *scriptlet = _alpm_local_db_pkgpath(handle->db_local,
oldpkg, "install");
_alpm_runscriptlet(handle, scriptlet, "pre_remove", pkgver, NULL, 0);
free(scriptlet);
}
}
@@ -402,7 +422,7 @@ int _alpm_remove_single_package(alpm_handle_t *handle,
if(!newpkg) {
/* init progress bar, but only on true remove transactions */
PROGRESS(handle->trans, ALPM_TRANS_PROGRESS_REMOVE_START, pkgname, 0,
PROGRESS(handle, ALPM_PROGRESS_REMOVE_START, pkgname, 0,
pkg_count, targ_count);
}
@@ -417,7 +437,7 @@ int _alpm_remove_single_package(alpm_handle_t *handle,
if(!newpkg) {
/* update progress bar after each file */
percent = (position * 100) / filenum;
PROGRESS(handle->trans, ALPM_TRANS_PROGRESS_REMOVE_START, pkgname,
PROGRESS(handle, ALPM_PROGRESS_REMOVE_START, pkgname,
percent, pkg_count, targ_count);
}
position++;
@@ -426,13 +446,16 @@ int _alpm_remove_single_package(alpm_handle_t *handle,
if(!newpkg) {
/* set progress to 100% after we finish unlinking files */
PROGRESS(handle->trans, ALPM_TRANS_PROGRESS_REMOVE_START, pkgname, 100,
PROGRESS(handle, ALPM_PROGRESS_REMOVE_START, pkgname, 100,
pkg_count, targ_count);
/* run the post-remove script if it exists */
if(alpm_pkg_has_scriptlet(oldpkg) &&
!(handle->trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle, scriptlet, "post_remove", pkgver, NULL);
char *scriptlet = _alpm_local_db_pkgpath(handle->db_local,
oldpkg, "install");
_alpm_runscriptlet(handle, scriptlet, "post_remove", pkgver, NULL, 0);
free(scriptlet);
}
}
@@ -452,13 +475,13 @@ db:
if(!newpkg) {
/* TODO: awesome! we're passing invalid pointers. */
EVENT(handle->trans, ALPM_TRANS_EVT_REMOVE_DONE, oldpkg, NULL);
EVENT(handle, ALPM_EVENT_REMOVE_DONE, oldpkg, NULL);
}
return 0;
}
int _alpm_remove_packages(alpm_handle_t *handle)
int _alpm_remove_packages(alpm_handle_t *handle, int run_ldconfig)
{
alpm_list_t *targ;
size_t pkg_count, targ_count;
@@ -472,23 +495,25 @@ int _alpm_remove_packages(alpm_handle_t *handle)
alpm_pkg_t *pkg = targ->data;
if(trans->state == STATE_INTERRUPTED) {
return 0;
return ret;
}
if(_alpm_remove_single_package(handle, pkg, NULL,
targ_count, pkg_count) == -1) {
handle->pm_errno = ALPM_ERR_TRANS_ABORT;
/* running ldconfig at this point could possibly screw system */
run_ldconfig = 0;
ret = -1;
goto cleanup;
}
targ_count++;
}
/* run ldconfig if it exists */
_alpm_ldconfig(handle);
if(run_ldconfig) {
/* run ldconfig if it exists */
_alpm_ldconfig(handle);
}
cleanup:
return ret;
}

View File

@@ -25,7 +25,7 @@
#include "trans.h"
int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data);
int _alpm_remove_packages(alpm_handle_t *handle);
int _alpm_remove_packages(alpm_handle_t *handle, int run_ldconfig);
int _alpm_remove_single_package(alpm_handle_t *handle,
alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg,

369
lib/libalpm/sha2.c Normal file
View File

@@ -0,0 +1,369 @@
/*
* FIPS-180-2 compliant SHA-256 implementation
*
* Copyright (C) 2006-2010, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* 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/>.
*/
/*
* The SHA-256 Secure Hash Standard was published by NIST in 2002.
*
* http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
*/
/*
* Pacman Notes:
*
* Taken from the PolarSSL project at http://polarssl.org under terms of the
* GPL. This is from version 1.0.0 of the library, and has been modified
* as following, which may be helpful for future updates:
* * remove "polarssl/config.h" include
* * change include from "polarssl/md5.h" to "md5.h"
* * removal of HMAC code
* * removal of SELF_TEST code
* * removal of ipad and opad from the sha2_context struct in sha2.h
* * increase the size of buffer for performance reasons
* * various static changes
*/
#include <stdio.h>
#include "sha2.h"
/*
* 32-bit integer manipulation macros (big endian)
*/
#ifndef GET_ULONG_BE
#define GET_ULONG_BE(n,b,i) \
{ \
(n) = ( (unsigned long) (b)[(i) ] << 24 ) \
| ( (unsigned long) (b)[(i) + 1] << 16 ) \
| ( (unsigned long) (b)[(i) + 2] << 8 ) \
| ( (unsigned long) (b)[(i) + 3] ); \
}
#endif
#ifndef PUT_ULONG_BE
#define PUT_ULONG_BE(n,b,i) \
{ \
(b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
(b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
(b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
(b)[(i) + 3] = (unsigned char) ( (n) ); \
}
#endif
/*
* SHA-256 context setup
*/
static void sha2_starts( sha2_context *ctx, int is224 )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
if( is224 == 0 )
{
/* SHA-256 */
ctx->state[0] = 0x6A09E667;
ctx->state[1] = 0xBB67AE85;
ctx->state[2] = 0x3C6EF372;
ctx->state[3] = 0xA54FF53A;
ctx->state[4] = 0x510E527F;
ctx->state[5] = 0x9B05688C;
ctx->state[6] = 0x1F83D9AB;
ctx->state[7] = 0x5BE0CD19;
}
else
{
/* SHA-224 */
ctx->state[0] = 0xC1059ED8;
ctx->state[1] = 0x367CD507;
ctx->state[2] = 0x3070DD17;
ctx->state[3] = 0xF70E5939;
ctx->state[4] = 0xFFC00B31;
ctx->state[5] = 0x68581511;
ctx->state[6] = 0x64F98FA7;
ctx->state[7] = 0xBEFA4FA4;
}
ctx->is224 = is224;
}
static void sha2_process( sha2_context *ctx, const unsigned char data[64] )
{
unsigned long temp1, temp2, W[64];
unsigned long A, B, C, D, E, F, G, H;
GET_ULONG_BE( W[ 0], data, 0 );
GET_ULONG_BE( W[ 1], data, 4 );
GET_ULONG_BE( W[ 2], data, 8 );
GET_ULONG_BE( W[ 3], data, 12 );
GET_ULONG_BE( W[ 4], data, 16 );
GET_ULONG_BE( W[ 5], data, 20 );
GET_ULONG_BE( W[ 6], data, 24 );
GET_ULONG_BE( W[ 7], data, 28 );
GET_ULONG_BE( W[ 8], data, 32 );
GET_ULONG_BE( W[ 9], data, 36 );
GET_ULONG_BE( W[10], data, 40 );
GET_ULONG_BE( W[11], data, 44 );
GET_ULONG_BE( W[12], data, 48 );
GET_ULONG_BE( W[13], data, 52 );
GET_ULONG_BE( W[14], data, 56 );
GET_ULONG_BE( W[15], data, 60 );
#define SHR(x,n) ((x & 0xFFFFFFFF) >> n)
#define ROTR(x,n) (SHR(x,n) | (x << (32 - n)))
#define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3))
#define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10))
#define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22))
#define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25))
#define F0(x,y,z) ((x & y) | (z & (x | y)))
#define F1(x,y,z) (z ^ (x & (y ^ z)))
#define R(t) \
( \
W[t] = S1(W[t - 2]) + W[t - 7] + \
S0(W[t - 15]) + W[t - 16] \
)
#define P(a,b,c,d,e,f,g,h,x,K) \
{ \
temp1 = h + S3(e) + F1(e,f,g) + K + x; \
temp2 = S2(a) + F0(a,b,c); \
d += temp1; h = temp1 + temp2; \
}
A = ctx->state[0];
B = ctx->state[1];
C = ctx->state[2];
D = ctx->state[3];
E = ctx->state[4];
F = ctx->state[5];
G = ctx->state[6];
H = ctx->state[7];
P( A, B, C, D, E, F, G, H, W[ 0], 0x428A2F98 );
P( H, A, B, C, D, E, F, G, W[ 1], 0x71374491 );
P( G, H, A, B, C, D, E, F, W[ 2], 0xB5C0FBCF );
P( F, G, H, A, B, C, D, E, W[ 3], 0xE9B5DBA5 );
P( E, F, G, H, A, B, C, D, W[ 4], 0x3956C25B );
P( D, E, F, G, H, A, B, C, W[ 5], 0x59F111F1 );
P( C, D, E, F, G, H, A, B, W[ 6], 0x923F82A4 );
P( B, C, D, E, F, G, H, A, W[ 7], 0xAB1C5ED5 );
P( A, B, C, D, E, F, G, H, W[ 8], 0xD807AA98 );
P( H, A, B, C, D, E, F, G, W[ 9], 0x12835B01 );
P( G, H, A, B, C, D, E, F, W[10], 0x243185BE );
P( F, G, H, A, B, C, D, E, W[11], 0x550C7DC3 );
P( E, F, G, H, A, B, C, D, W[12], 0x72BE5D74 );
P( D, E, F, G, H, A, B, C, W[13], 0x80DEB1FE );
P( C, D, E, F, G, H, A, B, W[14], 0x9BDC06A7 );
P( B, C, D, E, F, G, H, A, W[15], 0xC19BF174 );
P( A, B, C, D, E, F, G, H, R(16), 0xE49B69C1 );
P( H, A, B, C, D, E, F, G, R(17), 0xEFBE4786 );
P( G, H, A, B, C, D, E, F, R(18), 0x0FC19DC6 );
P( F, G, H, A, B, C, D, E, R(19), 0x240CA1CC );
P( E, F, G, H, A, B, C, D, R(20), 0x2DE92C6F );
P( D, E, F, G, H, A, B, C, R(21), 0x4A7484AA );
P( C, D, E, F, G, H, A, B, R(22), 0x5CB0A9DC );
P( B, C, D, E, F, G, H, A, R(23), 0x76F988DA );
P( A, B, C, D, E, F, G, H, R(24), 0x983E5152 );
P( H, A, B, C, D, E, F, G, R(25), 0xA831C66D );
P( G, H, A, B, C, D, E, F, R(26), 0xB00327C8 );
P( F, G, H, A, B, C, D, E, R(27), 0xBF597FC7 );
P( E, F, G, H, A, B, C, D, R(28), 0xC6E00BF3 );
P( D, E, F, G, H, A, B, C, R(29), 0xD5A79147 );
P( C, D, E, F, G, H, A, B, R(30), 0x06CA6351 );
P( B, C, D, E, F, G, H, A, R(31), 0x14292967 );
P( A, B, C, D, E, F, G, H, R(32), 0x27B70A85 );
P( H, A, B, C, D, E, F, G, R(33), 0x2E1B2138 );
P( G, H, A, B, C, D, E, F, R(34), 0x4D2C6DFC );
P( F, G, H, A, B, C, D, E, R(35), 0x53380D13 );
P( E, F, G, H, A, B, C, D, R(36), 0x650A7354 );
P( D, E, F, G, H, A, B, C, R(37), 0x766A0ABB );
P( C, D, E, F, G, H, A, B, R(38), 0x81C2C92E );
P( B, C, D, E, F, G, H, A, R(39), 0x92722C85 );
P( A, B, C, D, E, F, G, H, R(40), 0xA2BFE8A1 );
P( H, A, B, C, D, E, F, G, R(41), 0xA81A664B );
P( G, H, A, B, C, D, E, F, R(42), 0xC24B8B70 );
P( F, G, H, A, B, C, D, E, R(43), 0xC76C51A3 );
P( E, F, G, H, A, B, C, D, R(44), 0xD192E819 );
P( D, E, F, G, H, A, B, C, R(45), 0xD6990624 );
P( C, D, E, F, G, H, A, B, R(46), 0xF40E3585 );
P( B, C, D, E, F, G, H, A, R(47), 0x106AA070 );
P( A, B, C, D, E, F, G, H, R(48), 0x19A4C116 );
P( H, A, B, C, D, E, F, G, R(49), 0x1E376C08 );
P( G, H, A, B, C, D, E, F, R(50), 0x2748774C );
P( F, G, H, A, B, C, D, E, R(51), 0x34B0BCB5 );
P( E, F, G, H, A, B, C, D, R(52), 0x391C0CB3 );
P( D, E, F, G, H, A, B, C, R(53), 0x4ED8AA4A );
P( C, D, E, F, G, H, A, B, R(54), 0x5B9CCA4F );
P( B, C, D, E, F, G, H, A, R(55), 0x682E6FF3 );
P( A, B, C, D, E, F, G, H, R(56), 0x748F82EE );
P( H, A, B, C, D, E, F, G, R(57), 0x78A5636F );
P( G, H, A, B, C, D, E, F, R(58), 0x84C87814 );
P( F, G, H, A, B, C, D, E, R(59), 0x8CC70208 );
P( E, F, G, H, A, B, C, D, R(60), 0x90BEFFFA );
P( D, E, F, G, H, A, B, C, R(61), 0xA4506CEB );
P( C, D, E, F, G, H, A, B, R(62), 0xBEF9A3F7 );
P( B, C, D, E, F, G, H, A, R(63), 0xC67178F2 );
ctx->state[0] += A;
ctx->state[1] += B;
ctx->state[2] += C;
ctx->state[3] += D;
ctx->state[4] += E;
ctx->state[5] += F;
ctx->state[6] += G;
ctx->state[7] += H;
}
/*
* SHA-256 process buffer
*/
static void sha2_update( sha2_context *ctx, const unsigned char *input, size_t ilen )
{
size_t fill;
unsigned long left;
if( ilen <= 0 )
return;
left = ctx->total[0] & 0x3F;
fill = 64 - left;
ctx->total[0] += (unsigned long) ilen;
ctx->total[0] &= 0xFFFFFFFF;
if( ctx->total[0] < (unsigned long) ilen )
ctx->total[1]++;
if( left && ilen >= fill )
{
memcpy( (void *) (ctx->buffer + left),
(void *) input, fill );
sha2_process( ctx, ctx->buffer );
input += fill;
ilen -= fill;
left = 0;
}
while( ilen >= 64 )
{
sha2_process( ctx, input );
input += 64;
ilen -= 64;
}
if( ilen > 0 )
{
memcpy( (void *) (ctx->buffer + left),
(void *) input, ilen );
}
}
static const unsigned char sha2_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,
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, 0
};
/*
* SHA-256 final digest
*/
static void sha2_finish( sha2_context *ctx, unsigned char output[32] )
{
unsigned long last, padn;
unsigned long high, low;
unsigned char msglen[8];
high = ( ctx->total[0] >> 29 )
| ( ctx->total[1] << 3 );
low = ( ctx->total[0] << 3 );
PUT_ULONG_BE( high, msglen, 0 );
PUT_ULONG_BE( low, msglen, 4 );
last = ctx->total[0] & 0x3F;
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
sha2_update( ctx, (unsigned char *) sha2_padding, padn );
sha2_update( ctx, msglen, 8 );
PUT_ULONG_BE( ctx->state[0], output, 0 );
PUT_ULONG_BE( ctx->state[1], output, 4 );
PUT_ULONG_BE( ctx->state[2], output, 8 );
PUT_ULONG_BE( ctx->state[3], output, 12 );
PUT_ULONG_BE( ctx->state[4], output, 16 );
PUT_ULONG_BE( ctx->state[5], output, 20 );
PUT_ULONG_BE( ctx->state[6], output, 24 );
if( ctx->is224 == 0 )
PUT_ULONG_BE( ctx->state[7], output, 28 );
}
/*
* output = SHA-256( input buffer )
*/
void sha2( const unsigned char *input, size_t ilen,
unsigned char output[32], int is224 )
{
sha2_context ctx;
sha2_starts( &ctx, is224 );
sha2_update( &ctx, input, ilen );
sha2_finish( &ctx, output );
memset( &ctx, 0, sizeof( sha2_context ) );
}
/*
* output = SHA-256( file contents )
*/
int sha2_file( const char *path, unsigned char output[32], int is224 )
{
FILE *f;
size_t n;
sha2_context ctx;
unsigned char buf[4096];
if( ( f = fopen( path, "rb" ) ) == NULL )
return( 1 );
sha2_starts( &ctx, is224 );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
sha2_update( &ctx, buf, n );
sha2_finish( &ctx, output );
memset( &ctx, 0, sizeof( sha2_context ) );
if( ferror( f ) != 0 )
{
fclose( f );
return( 2 );
}
fclose( f );
return( 0 );
}

65
lib/libalpm/sha2.h Normal file
View File

@@ -0,0 +1,65 @@
/*
* SHA-224 and SHA-256 cryptographic hash function
*
* Copyright (C) 2006-2010, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* 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 _SHA2_H
#define _SHA2_H
#include <string.h>
/**
* \brief SHA-256 context structure
*/
typedef struct
{
unsigned long total[2]; /*!< number of bytes processed */
unsigned long state[8]; /*!< intermediate digest state */
unsigned char buffer[64]; /*!< data block being processed */
int is224; /*!< 0 => SHA-256, else SHA-224 */
}
sha2_context;
/**
* \brief Output = SHA-256( input buffer )
*
* \param input buffer holding the data
* \param ilen length of the input data
* \param output SHA-224/256 checksum result
* \param is224 0 = use SHA256, 1 = use SHA224
*/
void sha2( const unsigned char *input, size_t ilen,
unsigned char output[32], int is224 );
/**
* \brief Output = SHA-256( file contents )
*
* \param path input file name
* \param output SHA-224/256 checksum result
* \param is224 0 = use SHA256, 1 = use SHA224
*
* \return 0 if successful, 1 if fopen failed,
* or 2 if fread failed
*/
int sha2_file( const char *path, unsigned char output[32], int is224 );
#endif /* sha2.h */

View File

@@ -42,6 +42,12 @@
if(gpg_err_code(err) != GPG_ERR_NO_ERROR) { goto error; } \
} while(0)
/**
* Return a statically allocated validity string based on the GPGME validity
* code. This is mainly for debug purposes and is not translated.
* @param validity a validity code returned by GPGME
* @return a string such as "marginal"
*/
static const char *string_validity(gpgme_validity_t validity)
{
switch(validity) {
@@ -69,6 +75,12 @@ static void sigsum_test_bit(gpgme_sigsum_t sigsum, alpm_list_t **summary,
}
}
/**
* Calculate a set of strings to represent the given GPGME signature summary
* value. This is a bitmask so you may get any number of strings back.
* @param sigsum a GPGME signature summary bitmask
* @return the list of signature summary strings
*/
static alpm_list_t *list_sigsum(gpgme_sigsum_t sigsum)
{
alpm_list_t *summary = NULL;
@@ -104,6 +116,12 @@ static alpm_list_t *list_sigsum(gpgme_sigsum_t sigsum)
return summary;
}
/**
* Initialize the GPGME library.
* This can be safely called multiple times; however it is not thread-safe.
* @param handle the context handle
* @return 0 on success, -1 on error
*/
static int init_gpgme(alpm_handle_t *handle)
{
static int init = 0;
@@ -116,12 +134,15 @@ static int init_gpgme(alpm_handle_t *handle)
return 0;
}
sigdir = alpm_option_get_gpgdir(handle);
sigdir = handle->gpgdir;
if (_alpm_access(handle, sigdir, "pubring.gpg", R_OK)
if(_alpm_access(handle, sigdir, "pubring.gpg", R_OK)
|| _alpm_access(handle, sigdir, "trustdb.gpg", R_OK)) {
handle->pm_errno = ALPM_ERR_NOT_A_FILE;
_alpm_log(handle, ALPM_LOG_DEBUG, "Signature verification will fail!\n");
_alpm_log(handle, ALPM_LOG_WARNING,
_("Public keyring not found; have you run '%s'?\n"),
"pacman-key --init");
}
/* calling gpgme_check_version() returns the current version and runs
@@ -157,7 +178,151 @@ static int init_gpgme(alpm_handle_t *handle)
error:
_alpm_log(handle, ALPM_LOG_ERROR, _("GPGME error: %s\n"), gpgme_strerror(err));
RET_ERR(handle, ALPM_ERR_GPGME, 1);
RET_ERR(handle, ALPM_ERR_GPGME, -1);
}
/**
* Determine if we have a key is known in our local keyring.
* @param handle the context handle
* @param fpr the fingerprint key ID to look up
* @return 1 if key is known, 0 if key is unknown, -1 on error
*/
static int key_in_keychain(alpm_handle_t *handle, const char *fpr)
{
gpgme_error_t err;
gpgme_ctx_t ctx;
gpgme_key_t key;
int ret = -1;
memset(&ctx, 0, sizeof(ctx));
err = gpgme_new(&ctx);
CHECK_ERR();
_alpm_log(handle, ALPM_LOG_DEBUG, "looking up key %s locally\n", fpr);
err = gpgme_get_key(ctx, fpr, &key, 0);
if(gpg_err_code(err) == GPG_ERR_EOF) {
_alpm_log(handle, ALPM_LOG_DEBUG, "key lookup failed, unknown key\n");
ret = 0;
} else if(gpg_err_code(err) == GPG_ERR_NO_ERROR) {
_alpm_log(handle, ALPM_LOG_DEBUG, "key lookup success, key exists\n");
ret = 1;
} else {
_alpm_log(handle, ALPM_LOG_DEBUG, "gpg error: %s\n", gpgme_strerror(err));
}
error:
gpgme_key_unref(key);
gpgme_release(ctx);
return ret;
}
/**
* Search for a GPG key in a remote location.
* This requires GPGME to call the gpg binary and have a keyserver previously
* defined in a gpg.conf configuration file.
* @param handle the context handle
* @param fpr the fingerprint key ID to look up
* @param pgpkey storage location for the given key if found
* @return 1 on success, 0 on key not found, -1 on error
*/
static int key_search(alpm_handle_t *handle, const char *fpr,
alpm_pgpkey_t *pgpkey)
{
gpgme_error_t err;
gpgme_ctx_t ctx;
gpgme_keylist_mode_t mode;
gpgme_key_t key;
int ret = -1;
memset(&ctx, 0, sizeof(ctx));
err = gpgme_new(&ctx);
CHECK_ERR();
mode = gpgme_get_keylist_mode(ctx);
/* using LOCAL and EXTERN together doesn't work for GPG 1.X. Ugh. */
mode &= ~GPGME_KEYLIST_MODE_LOCAL;
mode |= GPGME_KEYLIST_MODE_EXTERN;
err = gpgme_set_keylist_mode(ctx, mode);
CHECK_ERR();
_alpm_log(handle, ALPM_LOG_DEBUG, "looking up key %s remotely\n", fpr);
err = gpgme_get_key(ctx, fpr, &key, 0);
if(gpg_err_code(err) == GPG_ERR_EOF) {
_alpm_log(handle, ALPM_LOG_DEBUG, "key lookup failed, unknown key\n");
ret = 0;
goto error;
} else if(gpg_err_code(err) != GPG_ERR_NO_ERROR) {
_alpm_log(handle, ALPM_LOG_DEBUG, "gpg error: %s\n", gpgme_strerror(err));
goto error;
}
/* should only get here if key actually exists */
pgpkey->data = key;
if(key->subkeys->fpr) {
pgpkey->fingerprint = key->subkeys->fpr;
} else if(key->subkeys->keyid) {
pgpkey->fingerprint = key->subkeys->keyid;
}
pgpkey->uid = key->uids->uid;
pgpkey->name = key->uids->name;
pgpkey->email = key->uids->email;
pgpkey->created = key->subkeys->timestamp;
pgpkey->expires = key->subkeys->expires;
ret = 1;
error:
gpgme_release(ctx);
return ret;
}
/**
* Import a key into the local keyring.
* @param handle the context handle
* @param key the key to import, likely retrieved from #key_search
* @return 0 on success, -1 on error
*/
static int key_import(alpm_handle_t *handle, alpm_pgpkey_t *key)
{
gpgme_error_t err;
gpgme_ctx_t ctx;
gpgme_key_t keys[2];
gpgme_import_result_t result;
int ret = -1;
if(_alpm_access(handle, handle->gpgdir, "pubring.gpg", W_OK)) {
/* no chance of import succeeding if pubring isn't writable */
_alpm_log(handle, ALPM_LOG_ERROR, _("keyring is not writable\n"));
return -1;
}
memset(&ctx, 0, sizeof(ctx));
err = gpgme_new(&ctx);
CHECK_ERR();
_alpm_log(handle, ALPM_LOG_DEBUG, "importing key\n");
keys[0] = key->data;
keys[1] = NULL;
err = gpgme_op_import_keys(ctx, keys);
CHECK_ERR();
result = gpgme_op_import_result(ctx);
CHECK_ERR();
/* we know we tried to import exactly one key, so check for this */
if(result->considered != 1 || !result->imports) {
_alpm_log(handle, ALPM_LOG_DEBUG, "could not import key, 0 results\n");
ret = -1;
} else if(result->imports->result != GPG_ERR_NO_ERROR) {
_alpm_log(handle, ALPM_LOG_DEBUG, "gpg error: %s\n", gpgme_strerror(err));
ret = -1;
} else {
ret = 0;
}
error:
gpgme_release(ctx);
return ret;
}
/**
@@ -165,25 +330,17 @@ error:
* @param base64_data the signature to attempt to decode
* @param data the decoded data; must be freed by the caller
* @param data_len the length of the returned data
* @return 0 on success, 1 on failure to properly decode
* @return 0 on success, -1 on failure to properly decode
*/
static int decode_signature(const char *base64_data,
unsigned char **data, int *data_len) {
unsigned char *usline;
int len;
len = strlen(base64_data);
usline = (unsigned char *)base64_data;
int ret, destlen = 0;
/* get the necessary size for the buffer by passing 0 */
ret = base64_decode(NULL, &destlen, usline, len);
if(ret != 0 && ret != POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL) {
goto error;
}
/* alloc our memory and repeat the call to decode */
MALLOC(*data, (size_t)destlen, goto error);
ret = base64_decode(*data, &destlen, usline, len);
if(ret != 0) {
unsigned char **data, size_t *data_len) {
size_t len = strlen(base64_data);
unsigned char *usline = (unsigned char *)base64_data;
/* reasonable allocation of expected length is 3/4 of encoded length */
size_t destlen = len * 3 / 4;
MALLOC(*data, destlen, goto error);
if(base64_decode(*data, &destlen, usline, len)) {
free(*data);
goto error;
}
*data_len = destlen;
@@ -192,7 +349,7 @@ static int decode_signature(const char *base64_data,
error:
*data = NULL;
*data_len = 0;
return 1;
return -1;
}
/**
@@ -204,19 +361,19 @@ error:
* The return value will be 0 if nothing abnormal happened during the signature
* check, and -1 if an error occurred while checking signatures or if a
* signature could not be found; pm_errno will be set. Note that "abnormal"
* does not include a failed signature; the value in #result should be checked
* does not include a failed signature; the value in siglist should be checked
* to determine if the signature(s) are good.
* @param handle the context handle
* @param path the full path to a file
* @param base64_sig optional PGP signature data in base64 encoding
* @result
* @param siglist a pointer to storage for signature results
* @return 0 in normal cases, -1 if the something failed in the check process
*/
int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
const char *base64_sig, alpm_sigresult_t *result)
const char *base64_sig, alpm_siglist_t *siglist)
{
int ret = -1, sigcount;
gpgme_error_t err;
gpgme_error_t err = 0;
gpgme_ctx_t ctx;
gpgme_data_t filedata, sigdata;
gpgme_verify_result_t verify_result;
@@ -229,24 +386,38 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
RET_ERR(handle, ALPM_ERR_NOT_A_FILE, -1);
}
if(!result) {
if(!siglist) {
RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1);
}
result->count = 0;
siglist->count = 0;
if(!base64_sig) {
size_t len = strlen(path) + 5;
CALLOC(sigpath, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(sigpath, len, "%s.sig", path);
sigpath = _alpm_sigpath(handle, path);
/* this will just help debugging */
_alpm_access(handle, NULL, sigpath, R_OK);
}
if(!_alpm_access(handle, NULL, sigpath, R_OK) == 0) {
/* sigcount is 0 */
/* does the file we are verifying exist? */
file = fopen(path, "rb");
if(file == NULL) {
handle->pm_errno = ALPM_ERR_NOT_A_FILE;
goto error;
}
/* does the sig file exist (if we didn't get the data directly)? */
if(!base64_sig) {
sigfile = fopen(sigpath, "rb");
if(sigfile == NULL) {
_alpm_log(handle, ALPM_LOG_DEBUG, "sig path %s could not be opened\n",
sigpath);
handle->pm_errno = ALPM_ERR_SIG_MISSING;
goto error;
}
}
if(init_gpgme(handle)) {
/* pm_errno was set in gpgme_init() */
return -1;
goto error;
}
_alpm_log(handle, ALPM_LOG_DEBUG, "checking signature for %s\n", path);
@@ -259,33 +430,23 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
CHECK_ERR();
/* create our necessary data objects to verify the signature */
file = fopen(path, "rb");
if(file == NULL) {
handle->pm_errno = ALPM_ERR_NOT_A_FILE;
goto error;
}
err = gpgme_data_new_from_stream(&filedata, file);
CHECK_ERR();
/* next create data object for the signature */
if(base64_sig) {
/* memory-based, we loaded it from a sync DB */
int data_len;
size_t data_len;
int decode_ret = decode_signature(base64_sig,
&decoded_sigdata, &data_len);
if(decode_ret) {
handle->pm_errno = ALPM_ERR_SIG_INVALID;
goto error;
goto gpg_error;
}
err = gpgme_data_new_from_mem(&sigdata,
(char *)decoded_sigdata, data_len, 0);
} else {
/* file-based, it is on disk */
sigfile = fopen(sigpath, "rb");
if(sigfile == NULL) {
handle->pm_errno = ALPM_ERR_SIG_MISSING;
goto error;
}
err = gpgme_data_new_from_stream(&sigdata, sigfile);
}
CHECK_ERR();
@@ -298,20 +459,15 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
if(!verify_result || !verify_result->signatures) {
_alpm_log(handle, ALPM_LOG_DEBUG, "no signatures returned\n");
handle->pm_errno = ALPM_ERR_SIG_MISSING;
goto error;
goto gpg_error;
}
for(gpgsig = verify_result->signatures, sigcount = 0;
gpgsig; gpgsig = gpgsig->next, sigcount++);
_alpm_log(handle, ALPM_LOG_DEBUG, "%d signatures returned\n", sigcount);
result->status = calloc(sigcount, sizeof(alpm_sigstatus_t));
result->validity = calloc(sigcount, sizeof(alpm_sigvalidity_t));
result->uid = calloc(sigcount, sizeof(char*));
if(!result->status || !result->validity || !result->uid) {
handle->pm_errno = ALPM_ERR_MEMORY;
goto error;
}
result->count = sigcount;
CALLOC(siglist->results, sigcount, sizeof(alpm_sigresult_t),
handle->pm_errno = ALPM_ERR_MEMORY; goto gpg_error);
siglist->count = sigcount;
for(gpgsig = verify_result->signatures, sigcount = 0; gpgsig;
gpgsig = gpgsig->next, sigcount++) {
@@ -319,6 +475,7 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
alpm_sigstatus_t status;
alpm_sigvalidity_t validity;
gpgme_key_t key;
alpm_sigresult_t *result;
_alpm_log(handle, ALPM_LOG_DEBUG, "fingerprint: %s\n", gpgsig->fpr);
summary_list = list_sigsum(gpgsig->summary);
@@ -333,21 +490,29 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
string_validity(gpgsig->validity),
gpgme_strerror(gpgsig->validity_reason));
result = siglist->results + sigcount;
err = gpgme_get_key(ctx, gpgsig->fpr, &key, 0);
if(gpg_err_code(err) == GPG_ERR_EOF) {
_alpm_log(handle, ALPM_LOG_DEBUG, "key lookup failed, unknown key\n");
err = GPG_ERR_NO_ERROR;
STRDUP(result->uid[sigcount], gpgsig->fpr,
handle->pm_errno = ALPM_ERR_MEMORY; goto error);
/* we dupe the fpr in this case since we have no key to point at */
STRDUP(result->key.fingerprint, gpgsig->fpr,
handle->pm_errno = ALPM_ERR_MEMORY; goto gpg_error);
} else {
CHECK_ERR();
if(key->uids) {
const char *uid = key->uids->uid;
STRDUP(result->uid[sigcount], uid,
handle->pm_errno = ALPM_ERR_MEMORY; goto error);
_alpm_log(handle, ALPM_LOG_DEBUG, "key user: %s\n", uid);
result->key.data = key;
result->key.fingerprint = key->subkeys->fpr;
result->key.uid = key->uids->uid;
result->key.name = key->uids->name;
result->key.email = key->uids->email;
result->key.created = key->subkeys->timestamp;
result->key.expires = key->subkeys->expires;
_alpm_log(handle, ALPM_LOG_DEBUG,
"key: %s, %s, owner_trust %s, disabled %d\n",
key->subkeys->fpr, key->uids->uid,
string_validity(key->owner_trust), key->disabled);
}
gpgme_key_unref(key);
}
switch(gpg_err_code(gpgsig->status)) {
@@ -370,40 +535,41 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
status = ALPM_SIGSTATUS_INVALID;
break;
}
if(status == ALPM_SIGSTATUS_VALID
|| status == ALPM_SIGSTATUS_KEY_EXPIRED) {
switch(gpgsig->validity) {
case GPGME_VALIDITY_ULTIMATE:
case GPGME_VALIDITY_FULL:
validity = ALPM_SIGVALIDITY_FULL;
break;
case GPGME_VALIDITY_MARGINAL:
validity = ALPM_SIGVALIDITY_MARGINAL;
break;
case GPGME_VALIDITY_NEVER:
validity = ALPM_SIGVALIDITY_NEVER;
break;
case GPGME_VALIDITY_UNKNOWN:
case GPGME_VALIDITY_UNDEFINED:
default:
validity = ALPM_SIGVALIDITY_UNKNOWN;
break;
}
} else {
validity = ALPM_SIGVALIDITY_NEVER;
/* special case: key disabled is not returned in above status code */
if(result->key.data && key->disabled) {
status = ALPM_SIGSTATUS_KEY_DISABLED;
}
result->status[sigcount] = status;
result->validity[sigcount] = validity;
switch(gpgsig->validity) {
case GPGME_VALIDITY_ULTIMATE:
case GPGME_VALIDITY_FULL:
validity = ALPM_SIGVALIDITY_FULL;
break;
case GPGME_VALIDITY_MARGINAL:
validity = ALPM_SIGVALIDITY_MARGINAL;
break;
case GPGME_VALIDITY_NEVER:
validity = ALPM_SIGVALIDITY_NEVER;
break;
case GPGME_VALIDITY_UNKNOWN:
case GPGME_VALIDITY_UNDEFINED:
default:
validity = ALPM_SIGVALIDITY_UNKNOWN;
break;
}
result->status = status;
result->validity = validity;
}
ret = 0;
error:
gpg_error:
gpgme_data_release(sigdata);
gpgme_data_release(filedata);
gpgme_release(ctx);
error:
if(sigfile) {
fclose(sigfile);
}
@@ -418,25 +584,65 @@ error:
}
return ret;
}
#else
int _alpm_gpgme_checksig(alpm_handle_t UNUSED *handle, const char UNUSED *path,
const char UNUSED *base64_sig, alpm_sigresult_t UNUSED *result)
#else /* HAVE_LIBGPGME */
static int key_in_keychain(alpm_handle_t UNUSED *handle, const char UNUSED *fpr)
{
return -1;
}
#endif
int _alpm_gpgme_checksig(alpm_handle_t UNUSED *handle, const char UNUSED *path,
const char UNUSED *base64_sig, alpm_siglist_t UNUSED *siglist)
{
return -1;
}
#endif /* HAVE_LIBGPGME */
/**
* Form a signature path given a file path.
* Caller must free the result.
* @param handle the context handle
* @param path the full path to a file
* @return the path with '.sig' appended, NULL on errors
*/
char *_alpm_sigpath(alpm_handle_t *handle, const char *path)
{
char *sigpath;
size_t len;
if(!path) {
return NULL;
}
len = strlen(path) + 5;
CALLOC(sigpath, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
sprintf(sigpath, "%s.sig", path);
return sigpath;
}
/**
* Helper for checking the PGP signature for the given file path.
* This wraps #_alpm_gpgme_checksig in a slightly friendlier manner to simplify
* handling of optional signatures and marginal/unknown trust levels and
* handling the correct error code return values.
* @param handle the context handle
* @param path the full path to a file
* @param base64_sig optional PGP signature data in base64 encoding
* @param optional whether signatures are optional (e.g., missing OK)
* @param marginal whether signatures with marginal trust are acceptable
* @param unknown whether signatures with unknown trust are acceptable
* @param sigdata a pointer to storage for signature results
* @return 0 on success, -1 on error (consult pm_errno or sigdata)
*/
int _alpm_check_pgp_helper(alpm_handle_t *handle, const char *path,
const char *base64_sig, int optional, int marginal, int unknown,
enum _alpm_errno_t invalid_err)
alpm_siglist_t **sigdata)
{
alpm_sigresult_t result;
alpm_siglist_t *siglist;
int ret;
memset(&result, 0, sizeof(result));
CALLOC(siglist, 1, sizeof(alpm_siglist_t),
RET_ERR(handle, ALPM_ERR_MEMORY, -1));
_alpm_log(handle, ALPM_LOG_DEBUG, "checking signatures for %s\n", path);
ret = _alpm_gpgme_checksig(handle, path, base64_sig, &result);
ret = _alpm_gpgme_checksig(handle, path, base64_sig, siglist);
if(ret && handle->pm_errno == ALPM_ERR_SIG_MISSING) {
if(optional) {
_alpm_log(handle, ALPM_LOG_DEBUG, "missing optional signature\n");
@@ -450,13 +656,13 @@ int _alpm_check_pgp_helper(alpm_handle_t *handle, const char *path,
_alpm_log(handle, ALPM_LOG_DEBUG, "signature check failed\n");
/* ret will already be -1 */
} else {
int num;
for(num = 0; !ret && num < result.count; num++) {
switch(result.status[num]) {
size_t num;
for(num = 0; !ret && num < siglist->count; num++) {
switch(siglist->results[num].status) {
case ALPM_SIGSTATUS_VALID:
case ALPM_SIGSTATUS_KEY_EXPIRED:
_alpm_log(handle, ALPM_LOG_DEBUG, "signature is valid\n");
switch(result.validity[num]) {
switch(siglist->results[num].validity) {
case ALPM_SIGVALIDITY_FULL:
_alpm_log(handle, ALPM_LOG_DEBUG, "signature is fully trusted\n");
break;
@@ -480,68 +686,202 @@ int _alpm_check_pgp_helper(alpm_handle_t *handle, const char *path,
break;
case ALPM_SIGSTATUS_SIG_EXPIRED:
case ALPM_SIGSTATUS_KEY_UNKNOWN:
case ALPM_SIGSTATUS_KEY_DISABLED:
case ALPM_SIGSTATUS_INVALID:
_alpm_log(handle, ALPM_LOG_DEBUG, "signature is not valid\n");
ret = -1;
break;
}
}
}
if(ret) {
handle->pm_errno = invalid_err;
if(sigdata) {
*sigdata = siglist;
} else {
alpm_siglist_cleanup(siglist);
free(siglist);
}
return ret;
}
/**
* Examine a signature result list and take any appropriate or necessary
* actions. This may include asking the user to import a key or simply printing
* helpful failure messages so the user can take action out of band.
* @param handle the context handle
* @param identifier a friendly name for the signed resource; usually a
* database or package name
* @param siglist a pointer to storage for signature results
* @param optional whether signatures are optional (e.g., missing OK)
* @param marginal whether signatures with marginal trust are acceptable
* @param unknown whether signatures with unknown trust are acceptable
* @return 0 if all signatures are OK, -1 on errors, 1 if we should retry the
* validation process
*/
int _alpm_process_siglist(alpm_handle_t *handle, const char *identifier,
alpm_siglist_t *siglist, int optional, int marginal, int unknown)
{
size_t i;
int retry = 0;
if(!optional && siglist->count == 0) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: missing required signature\n"), identifier);
}
for(i = 0; i < siglist->count; i++) {
alpm_sigresult_t *result = siglist->results + i;
const char *name = result->key.uid ? result->key.uid : result->key.fingerprint;
switch(result->status) {
case ALPM_SIGSTATUS_VALID:
case ALPM_SIGSTATUS_KEY_EXPIRED:
switch(result->validity) {
case ALPM_SIGVALIDITY_FULL:
break;
case ALPM_SIGVALIDITY_MARGINAL:
if(!marginal) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: signature from \"%s\" is marginal trust\n"),
identifier, name);
/* QUESTION(handle, ALPM_QUESTION_EDIT_KEY_TRUST, &result->key, NULL, NULL, &answer); */
}
break;
case ALPM_SIGVALIDITY_UNKNOWN:
if(!unknown) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: signature from \"%s\" is unknown trust\n"),
identifier, name);
/* QUESTION(handle, ALPM_QUESTION_EDIT_KEY_TRUST, &result->key, NULL, NULL, &answer); */
}
break;
case ALPM_SIGVALIDITY_NEVER:
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: signature from \"%s\" should never be trusted\n"),
identifier, name);
break;
}
break;
case ALPM_SIGSTATUS_KEY_UNKNOWN:
/* ensure this key is still actually unknown; we may have imported it
* on an earlier call to this function. */
if(key_in_keychain(handle, result->key.fingerprint) == 1) {
break;
}
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: key \"%s\" is unknown\n"), identifier, name);
#ifdef HAVE_LIBGPGME
{
int answer;
alpm_pgpkey_t fetch_key;
memset(&fetch_key, 0, sizeof(fetch_key));
if(key_search(handle, result->key.fingerprint, &fetch_key) == 1) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"unknown key, found %s on keyserver\n", fetch_key.uid);
if(!_alpm_access(handle, handle->gpgdir, "pubring.gpg", W_OK)) {
QUESTION(handle, ALPM_QUESTION_IMPORT_KEY,
&fetch_key, NULL, NULL, &answer);
if(answer) {
if(key_import(handle, &fetch_key) == 0) {
retry = 1;
} else {
_alpm_log(handle, ALPM_LOG_ERROR,
_("key \"%s\" could not be imported\n"), fetch_key.uid);
}
}
} else {
/* keyring directory was not writable, so we don't even try */
_alpm_log(handle, ALPM_LOG_WARNING,
_("key %s, \"%s\" found on keyserver, keyring is not writable\n"),
fetch_key.fingerprint, fetch_key.uid);
}
} else {
_alpm_log(handle, ALPM_LOG_ERROR,
_("key \"%s\" could not be looked up remotely\n"), name);
}
gpgme_key_unref(fetch_key.data);
}
#endif
break;
case ALPM_SIGSTATUS_KEY_DISABLED:
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: key \"%s\" is disabled\n"), identifier, name);
break;
case ALPM_SIGSTATUS_SIG_EXPIRED:
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: signature from \"%s\" is expired\n"), identifier, name);
break;
case ALPM_SIGSTATUS_INVALID:
_alpm_log(handle, ALPM_LOG_ERROR,
_("%s: signature from \"%s\" is invalid\n"),
identifier, name);
break;
}
}
alpm_sigresult_cleanup(&result);
return ret;
return retry;
}
/**
* Check the PGP signature for the given package file.
* @param pkg the package to check
* @param siglist a pointer to storage for signature results
* @return a int value : 0 (valid), 1 (invalid), -1 (an error occurred)
*/
int SYMEXPORT alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg,
alpm_sigresult_t *result)
alpm_siglist_t *siglist)
{
ASSERT(pkg != NULL, return -1);
ASSERT(result != NULL, RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
ASSERT(siglist != NULL, RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
pkg->handle->pm_errno = 0;
return _alpm_gpgme_checksig(pkg->handle, alpm_pkg_get_filename(pkg),
pkg->base64_sig, result);
return _alpm_gpgme_checksig(pkg->handle, pkg->filename,
pkg->base64_sig, siglist);
}
/**
* Check the PGP signature for the given database.
* @param db the database to check
* @param siglist a pointer to storage for signature results
* @return a int value : 0 (valid), 1 (invalid), -1 (an error occurred)
*/
int SYMEXPORT alpm_db_check_pgp_signature(alpm_db_t *db,
alpm_sigresult_t *result)
alpm_siglist_t *siglist)
{
ASSERT(db != NULL, return -1);
ASSERT(result != NULL, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1));
ASSERT(siglist != NULL, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1));
db->handle->pm_errno = 0;
return _alpm_gpgme_checksig(db->handle, _alpm_db_path(db), NULL, result);
return _alpm_gpgme_checksig(db->handle, _alpm_db_path(db), NULL, siglist);
}
int SYMEXPORT alpm_sigresult_cleanup(alpm_sigresult_t *result)
/**
* Clean up and free a signature result list.
* Note that this does not free the siglist object itself in case that
* was allocated on the stack; this is the responsibility of the caller.
* @param siglist a pointer to storage for signature results
* @return 0 on success, -1 on error
*/
int SYMEXPORT alpm_siglist_cleanup(alpm_siglist_t *siglist)
{
ASSERT(result != NULL, return -1);
/* Because it is likely result is on the stack, uid and status may have bogus
* values in the struct. Only look at them if count is greater than 0. */
if(result->count > 0) {
free(result->status);
if(result->uid) {
int i;
for(i = 0; i < result->count; i++) {
free(result->uid[i]);
}
free(result->uid);
ASSERT(siglist != NULL, return -1);
size_t num;
for(num = 0; num < siglist->count; num++) {
alpm_sigresult_t *result = siglist->results + num;
if(result->key.data) {
#if HAVE_LIBGPGME
gpgme_key_unref(result->key.data);
#endif
} else {
free(result->key.fingerprint);
}
}
if(siglist->count) {
free(siglist->results);
}
siglist->results = NULL;
siglist->count = 0;
return 0;
}

View File

@@ -21,11 +21,15 @@
#include "alpm.h"
char *_alpm_sigpath(alpm_handle_t *handle, const char *path);
int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
const char *base64_sig, alpm_sigresult_t *result);
const char *base64_sig, alpm_siglist_t *result);
int _alpm_check_pgp_helper(alpm_handle_t *handle, const char *path,
const char *base64_sig, int optional, int marginal, int unknown,
enum _alpm_errno_t invalid_err);
alpm_siglist_t **sigdata);
int _alpm_process_siglist(alpm_handle_t *handle, const char *identifier,
alpm_siglist_t *siglist, int optional, int marginal, int unknown);
#endif /* _ALPM_SIGNING_H */

File diff suppressed because it is too large Load Diff

View File

@@ -48,9 +48,7 @@
*/
/** Initialize the transaction. */
int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags,
alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress)
int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags)
{
alpm_trans_t *trans;
@@ -67,9 +65,6 @@ int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags,
CALLOC(trans, 1, sizeof(alpm_trans_t), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
trans->flags = flags;
trans->cb_event = event;
trans->cb_conv = conv;
trans->cb_progress = progress;
trans->state = STATE_INITIALIZED;
handle->trans = trans;
@@ -82,7 +77,7 @@ static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs)
alpm_list_t *i;
alpm_list_t *invalid = NULL;
const char *arch = alpm_option_get_arch(handle);
const char *arch = handle->arch;
if(!arch) {
return NULL;
}
@@ -91,8 +86,8 @@ static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs)
const char *pkgarch = alpm_pkg_get_arch(pkg);
if(pkgarch && strcmp(pkgarch, arch) && strcmp(pkgarch, "any")) {
char *string;
const char *pkgname = alpm_pkg_get_name(pkg);
const char *pkgver = alpm_pkg_get_version(pkg);
const char *pkgname = pkg->name;
const char *pkgver = pkg->version;
size_t len = strlen(pkgname) + strlen(pkgver) + strlen(pkgarch) + 3;
MALLOC(string, len, RET_ERR(handle, ALPM_ERR_MEMORY, invalid));
sprintf(string, "%s-%s-%s", pkgname, pkgver, pkgarch);
@@ -169,7 +164,7 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
trans->state = STATE_COMMITING;
if(trans->add == NULL) {
if(_alpm_remove_packages(handle) == -1) {
if(_alpm_remove_packages(handle, 1) == -1) {
/* pm_errno is set by _alpm_remove_commit() */
return -1;
}
@@ -224,9 +219,9 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle)
if(!nolock_flag) {
if(_alpm_handle_unlock(handle)) {
_alpm_log(handle, ALPM_LOG_WARNING, _("could not remove lock file %s\n"),
alpm_option_get_lockfile(handle));
handle->lockfile);
alpm_logaction(handle, "warning: could not remove lock file %s\n",
alpm_option_get_lockfile(handle));
handle->lockfile);
}
}
@@ -241,6 +236,9 @@ void _alpm_trans_free(alpm_trans_t *trans)
return;
}
alpm_list_free_inner(trans->unresolvable,
(alpm_list_fn_free)_alpm_pkg_free_trans);
alpm_list_free(trans->unresolvable);
alpm_list_free_inner(trans->add, (alpm_list_fn_free)_alpm_pkg_free_trans);
alpm_list_free(trans->add);
alpm_list_free_inner(trans->remove, (alpm_list_fn_free)_alpm_pkg_free);
@@ -277,43 +275,50 @@ static int grep(const char *fn, const char *needle)
return 0;
}
int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn,
const char *script, const char *ver, const char *oldver)
int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath,
const char *script, const char *ver, const char *oldver, int is_archive)
{
char scriptfn[PATH_MAX];
char cmdline[PATH_MAX];
char tmpdir[PATH_MAX];
char *argv[] = { "sh", "-c", cmdline, NULL };
char *scriptpath;
int clean_tmpdir = 0;
char *tmpdir, *scriptfn = NULL, *scriptpath;
int retval = 0;
size_t len;
if(_alpm_access(handle, NULL, installfn, R_OK) != 0) {
_alpm_log(handle, ALPM_LOG_DEBUG, "scriptlet '%s' not found\n", installfn);
if(_alpm_access(handle, NULL, filepath, R_OK) != 0) {
_alpm_log(handle, ALPM_LOG_DEBUG, "scriptlet '%s' not found\n", filepath);
return 0;
}
/* creates a directory in $root/tmp/ for copying/extracting the scriptlet */
snprintf(tmpdir, PATH_MAX, "%stmp/", handle->root);
if(!is_archive && !grep(filepath, script)) {
/* script not found in scriptlet file; we can only short-circuit this early
* if it is an actual scriptlet file and not an archive. */
return 0;
}
/* create a directory in $root/tmp/ for copying/extracting the scriptlet */
len = strlen(handle->root) + strlen("tmp/alpm_XXXXXX") + 1;
MALLOC(tmpdir, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(tmpdir, len, "%stmp/", handle->root);
if(access(tmpdir, F_OK) != 0) {
_alpm_makepath_mode(tmpdir, 01777);
}
snprintf(tmpdir, PATH_MAX, "%stmp/alpm_XXXXXX", handle->root);
snprintf(tmpdir, len, "%stmp/alpm_XXXXXX", handle->root);
if(mkdtemp(tmpdir) == NULL) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not create temp directory\n"));
free(tmpdir);
return 1;
} else {
clean_tmpdir = 1;
}
/* either extract or copy the scriptlet */
snprintf(scriptfn, PATH_MAX, "%s/.INSTALL", tmpdir);
if(strcmp(script, "pre_upgrade") == 0 || strcmp(script, "pre_install") == 0) {
if(_alpm_unpack_single(handle, installfn, tmpdir, ".INSTALL")) {
len += strlen("/.INSTALL");
MALLOC(scriptfn, len, RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(scriptfn, len, "%s/.INSTALL", tmpdir);
if(is_archive) {
if(_alpm_unpack_single(handle, filepath, tmpdir, ".INSTALL")) {
retval = 1;
}
} else {
if(_alpm_copyfile(installfn, scriptfn)) {
if(_alpm_copyfile(filepath, scriptfn)) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not copy tempfile to %s (%s)\n"), scriptfn, strerror(errno));
retval = 1;
}
@@ -322,14 +327,14 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn,
goto cleanup;
}
/* chop off the root so we can find the tmpdir in the chroot */
scriptpath = scriptfn + strlen(handle->root) - 1;
if(!grep(scriptfn, script)) {
/* script not found in scriptlet file */
if(is_archive && !grep(scriptfn, script)) {
/* script not found in extracted scriptlet file */
goto cleanup;
}
/* chop off the root so we can find the tmpdir in the chroot */
scriptpath = scriptfn + strlen(handle->root) - 1;
if(oldver) {
snprintf(cmdline, PATH_MAX, ". %s; %s %s %s",
scriptpath, script, ver, oldver);
@@ -343,10 +348,17 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn,
retval = _alpm_run_chroot(handle, "/bin/sh", argv);
cleanup:
if(clean_tmpdir && _alpm_rmrf(tmpdir)) {
_alpm_log(handle, ALPM_LOG_WARNING, _("could not remove tmpdir %s\n"), tmpdir);
if(scriptfn && unlink(scriptfn)) {
_alpm_log(handle, ALPM_LOG_WARNING,
_("could not remove %s\n"), scriptfn);
}
if(rmdir(tmpdir)) {
_alpm_log(handle, ALPM_LOG_WARNING,
_("could not remove tmpdir %s\n"), tmpdir);
}
free(scriptfn);
free(tmpdir);
return retval;
}

View File

@@ -39,39 +39,16 @@ typedef enum _alpm_transstate_t {
struct __alpm_trans_t {
alpm_transflag_t flags;
alpm_transstate_t state;
alpm_list_t *add; /* list of (alpm_pkg_t *) */
alpm_list_t *remove; /* list of (alpm_pkg_t *) */
alpm_list_t *unresolvable; /* list of (alpm_pkg_t *) */
alpm_list_t *add; /* list of (alpm_pkg_t *) */
alpm_list_t *remove; /* list of (alpm_pkg_t *) */
alpm_list_t *skip_remove; /* list of (char *) */
alpm_trans_cb_event cb_event;
alpm_trans_cb_conv cb_conv;
alpm_trans_cb_progress cb_progress;
};
#define EVENT(t, e, d1, d2) \
do { \
if((t) && (t)->cb_event) { \
(t)->cb_event(e, d1, d2); \
} \
} while(0)
#define QUESTION(t, q, d1, d2, d3, r) \
do { \
if((t) && (t)->cb_conv) { \
(t)->cb_conv(q, d1, d2, d3, r); \
} \
} while(0)
#define PROGRESS(t, e, p, per, h, r) \
do { \
if((t) && (t)->cb_progress) { \
(t)->cb_progress(e, p, per, h, r); \
} \
} while(0)
void _alpm_trans_free(alpm_trans_t *trans);
int _alpm_trans_init(alpm_trans_t *trans, alpm_transflag_t flags,
alpm_trans_cb_event event, alpm_trans_cb_conv conv,
alpm_trans_cb_progress progress);
int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn,
const char *script, const char *ver, const char *oldver);
int _alpm_trans_init(alpm_trans_t *trans, alpm_transflag_t flags);
int _alpm_runscriptlet(alpm_handle_t *handle, const char *filepath,
const char *script, const char *ver, const char *oldver, int is_archive);
#endif /* _ALPM_TRANS_H */

View File

@@ -31,6 +31,7 @@
#include <unistd.h>
#include <ctype.h>
#include <dirent.h>
#include <fcntl.h>
#include <time.h>
#include <syslog.h>
#include <errno.h>
@@ -46,8 +47,10 @@
#ifdef HAVE_LIBSSL
#include <openssl/md5.h>
#include <openssl/sha.h>
#else
#include "md5.h"
#include "sha2.h"
#endif
/* libalpm */
@@ -126,8 +129,6 @@ int _alpm_makepath_mode(const char *path, mode_t mode)
return ret;
}
#define CPBUFSIZE 8 * 1024
int _alpm_copyfile(const char *src, const char *dest)
{
FILE *in, *out;
@@ -145,10 +146,10 @@ int _alpm_copyfile(const char *src, const char *dest)
return 1;
}
CALLOC(buf, (size_t)CPBUFSIZE, (size_t)1, ret = 1; goto cleanup;);
MALLOC(buf, (size_t)ALPM_BUFFER_SIZE, ret = 1; goto cleanup);
/* do the actual file copy */
while((len = fread(buf, 1, CPBUFSIZE, in))) {
while((len = fread(buf, 1, ALPM_BUFFER_SIZE, in))) {
size_t nwritten = 0;
nwritten = fwrite(buf, 1, len, out);
if((nwritten != len) || ferror(out)) {
@@ -171,7 +172,7 @@ int _alpm_copyfile(const char *src, const char *dest)
cleanup:
fclose(in);
fclose(out);
FREE(buf);
free(buf);
return ret;
}
@@ -190,7 +191,12 @@ char *_alpm_strtrim(char *str)
pch++;
}
if(pch != str) {
memmove(str, pch, (strlen(pch) + 1));
size_t len = strlen(pch);
if(len) {
memmove(str, pch, len + 1);
} else {
*str = '\0';
}
}
/* check if there wasn't anything but whitespace in the string. */
@@ -215,7 +221,7 @@ char *_alpm_strtrim(char *str)
size_t _alpm_strip_newline(char *str)
{
size_t len;
if(str == '\0') {
if(*str == '\0') {
return 0;
}
len = strlen(str);
@@ -270,8 +276,7 @@ int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix,
mode_t oldmask;
struct archive *_archive;
struct archive_entry *entry;
char cwd[PATH_MAX];
int restore_cwd = 0;
int cwdfd;
if((_archive = archive_read_new()) == NULL) {
RET_ERR(handle, ALPM_ERR_LIBARCHIVE, 1);
@@ -281,7 +286,7 @@ int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix,
archive_read_support_format_all(_archive);
if(archive_read_open_filename(_archive, archive,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
ALPM_BUFFER_SIZE) != ARCHIVE_OK) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), archive,
archive_error_string(_archive));
RET_ERR(handle, ALPM_ERR_PKG_OPEN, 1);
@@ -290,10 +295,11 @@ int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix,
oldmask = umask(0022);
/* save the cwd so we can restore it later */
if(getcwd(cwd, PATH_MAX) == NULL) {
do {
cwdfd = open(".", O_RDONLY);
} while(cwdfd == -1 && errno == EINTR);
if(cwdfd < 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not get current working directory\n"));
} else {
restore_cwd = 1;
}
/* just in case our cwd was removed in the upgrade operation */
@@ -358,10 +364,14 @@ int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix,
cleanup:
umask(oldmask);
archive_read_finish(_archive);
if(restore_cwd && chdir(cwd) != 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"),
cwd, strerror(errno));
if(cwdfd >= 0) {
if(fchdir(cwdfd) != 0) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("could not restore working directory (%s)\n"), strerror(errno));
}
close(cwdfd);
}
return ret;
}
@@ -483,17 +493,16 @@ int _alpm_logaction(alpm_handle_t *handle, const char *fmt, va_list args)
int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[])
{
char cwd[PATH_MAX];
pid_t pid;
int pipefd[2];
int restore_cwd = 0;
int pipefd[2], cwdfd;
int retval = 0;
/* save the cwd so we can restore it later */
if(getcwd(cwd, PATH_MAX) == NULL) {
do {
cwdfd = open(".", O_RDONLY);
} while(cwdfd == -1 && errno == EINTR);
if(cwdfd < 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not get current working directory\n"));
} else {
restore_cwd = 1;
}
/* just in case our cwd was removed in the upgrade operation */
@@ -562,7 +571,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[]
if(fgets(line, PATH_MAX, pipe_file) == NULL)
break;
alpm_logaction(handle, "%s", line);
EVENT(handle->trans, ALPM_TRANS_EVT_SCRIPTLET_INFO, line, NULL);
EVENT(handle, ALPM_EVENT_SCRIPTLET_INFO, line, NULL);
}
fclose(pipe_file);
}
@@ -591,8 +600,12 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[]
}
cleanup:
if(restore_cwd && chdir(cwd) != 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), cwd, strerror(errno));
if(cwdfd >= 0) {
if(fchdir(cwdfd) != 0) {
_alpm_log(handle, ALPM_LOG_ERROR,
_("could not restore working directory (%s)\n"), strerror(errno));
}
close(cwdfd);
}
return retval;
@@ -636,8 +649,8 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename)
struct stat buf;
/* Loop through the cache dirs until we find a matching file */
for(i = alpm_option_get_cachedirs(handle); i; i = alpm_list_next(i)) {
snprintf(path, PATH_MAX, "%s%s", (char *)alpm_list_getdata(i),
for(i = handle->cachedirs; i; i = i->next) {
snprintf(path, PATH_MAX, "%s%s", (char *)i->data,
filename);
if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) {
retpath = strdup(path);
@@ -657,12 +670,12 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename)
const char *_alpm_filecache_setup(alpm_handle_t *handle)
{
struct stat buf;
alpm_list_t *i, *tmp;
char *cachedir;
alpm_list_t *i;
char *cachedir, *tmpdir;
/* Loop through the cache dirs until we find a writeable dir */
for(i = alpm_option_get_cachedirs(handle); i; i = alpm_list_next(i)) {
cachedir = alpm_list_getdata(i);
/* Loop through the cache dirs until we find a usable directory */
for(i = handle->cachedirs; i; i = i->next) {
cachedir = i->data;
if(stat(cachedir, &buf) != 0) {
/* cache directory does not exist.... try creating it */
_alpm_log(handle, ALPM_LOG_WARNING, _("no %s cache exists, creating...\n"),
@@ -671,21 +684,33 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle)
_alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", cachedir);
return cachedir;
}
} else if(S_ISDIR(buf.st_mode) && (buf.st_mode & S_IWUSR)) {
} else if(!S_ISDIR(buf.st_mode)) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"skipping cachedir, not a directory: %s\n", cachedir);
} else if(access(cachedir, W_OK) != 0) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"skipping cachedir, not writable: %s\n", cachedir);
} else if(!(buf.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) {
_alpm_log(handle, ALPM_LOG_DEBUG,
"skipping cachedir, no write bits set: %s\n", cachedir);
} else {
_alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", cachedir);
return cachedir;
} else {
_alpm_log(handle, ALPM_LOG_DEBUG, "skipping cachedir: %s\n", cachedir);
}
}
/* we didn't find a valid cache directory. use /tmp. */
tmp = alpm_list_add(NULL, "/tmp/");
alpm_option_set_cachedirs(handle, tmp);
alpm_list_free(tmp);
_alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", "/tmp/");
_alpm_log(handle, ALPM_LOG_WARNING, _("couldn't create package cache, using /tmp instead\n"));
return "/tmp/";
/* we didn't find a valid cache directory. use TMPDIR or /tmp. */
if((tmpdir = getenv("TMPDIR")) && stat(tmpdir, &buf) && S_ISDIR(buf.st_mode)) {
/* TMPDIR was good, we can use it */
} else {
tmpdir = "/tmp";
}
alpm_option_add_cachedir(handle, tmpdir);
cachedir = handle->cachedirs->prev->data;
_alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", cachedir);
_alpm_log(handle, ALPM_LOG_WARNING,
_("couldn't find or create package cache, using %s instead\n"), cachedir);
return cachedir;
}
/** lstat wrapper that treats /path/dirsymlink/ the same as /path/dirsymlink.
@@ -721,7 +746,7 @@ static int md5_file(const char *path, unsigned char output[16])
MD5_CTX ctx;
unsigned char *buf;
CALLOC(buf, 8192, sizeof(unsigned char), return 1);
CALLOC(buf, ALPM_BUFFER_SIZE, sizeof(unsigned char), return 1);
if((f = fopen(path, "rb")) == NULL) {
free(buf);
@@ -730,7 +755,7 @@ static int md5_file(const char *path, unsigned char output[16])
MD5_Init(&ctx);
while((n = fread(buf, 1, sizeof(buf), f)) > 0) {
while((n = fread(buf, 1, ALPM_BUFFER_SIZE, f)) > 0) {
MD5_Update(&ctx, buf, n);
}
@@ -747,6 +772,53 @@ static int md5_file(const char *path, unsigned char output[16])
fclose(f);
return 0;
}
/* third param is so we match the PolarSSL definition */
static int sha2_file(const char *path, unsigned char output[32], int is224)
{
FILE *f;
size_t n;
SHA256_CTX ctx;
unsigned char *buf;
CALLOC(buf, ALPM_BUFFER_SIZE, sizeof(unsigned char), return 1);
if((f = fopen(path, "rb")) == NULL) {
free(buf);
return 1;
}
if(is224) {
SHA224_Init(&ctx);
} else {
SHA256_Init(&ctx);
}
while((n = fread(buf, 1, ALPM_BUFFER_SIZE, f)) > 0) {
if(is224) {
SHA224_Update(&ctx, buf, n);
} else {
SHA256_Update(&ctx, buf, n);
}
}
if(is224) {
SHA224_Final(output, &ctx);
} else {
SHA256_Final(output, &ctx);
}
memset(&ctx, 0, sizeof(SHA256_CTX));
free(buf);
if(ferror(f) != 0) {
fclose(f);
return 2;
}
fclose(f);
return 0;
}
#endif
/** Get the md5 sum of file.
@@ -768,6 +840,7 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
ret = md5_file(filename, output);
if(ret > 0) {
free(md5sum);
return NULL;
}
@@ -780,22 +853,61 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
return md5sum;
}
int _alpm_test_md5sum(const char *filepath, const char *md5sum)
/** Get the sha256 sum of file.
* @param filename name of the file
* @return the checksum on success, NULL on error
* @addtogroup alpm_misc
*/
char SYMEXPORT *alpm_compute_sha256sum(const char *filename)
{
char *md5sum2;
unsigned char output[32];
char *sha256sum;
int ret, i;
ASSERT(filename != NULL, return NULL);
/* allocate 64 chars plus 1 for null */
CALLOC(sha256sum, 65, sizeof(char), return NULL);
/* defined above for OpenSSL, otherwise defined in sha2.h */
ret = sha2_file(filename, output, 0);
if(ret > 0) {
free(sha256sum);
return NULL;
}
/* Convert the result to something readable */
for (i = 0; i < 32; i++) {
/* sprintf is acceptable here because we know our output */
sprintf(sha256sum +(i * 2), "%02x", output[i]);
}
return sha256sum;
}
int _alpm_test_checksum(const char *filepath, const char *expected,
enum _alpm_csum type)
{
char *computed;
int ret;
md5sum2 = alpm_compute_md5sum(filepath);
if(type == ALPM_CSUM_MD5) {
computed = alpm_compute_md5sum(filepath);
} else if(type == ALPM_CSUM_SHA256) {
computed = alpm_compute_sha256sum(filepath);
} else {
return -1;
}
if(md5sum == NULL || md5sum2 == NULL) {
if(expected == NULL || computed == NULL) {
ret = -1;
} else if(strcmp(md5sum, md5sum2) != 0) {
} else if(strcmp(expected, computed) != 0) {
ret = 1;
} else {
ret = 0;
}
FREE(md5sum2);
FREE(computed);
return ret;
}
@@ -966,17 +1078,43 @@ unsigned long _alpm_hash_sdbm(const char *str)
return hash;
}
long _alpm_parsedate(const char *line)
off_t _alpm_strtoofft(const char *line)
{
char *end;
unsigned long long result;
errno = 0;
/* we are trying to parse bare numbers only, no leading anything */
if(line[0] < '0' || line[0] > '9') {
return (off_t)-1;
}
result = strtoull(line, &end, 10);
if (result == 0 && end == line) {
/* line was not a number */
return (off_t)-1;
} else if (result == ULLONG_MAX && errno == ERANGE) {
/* line does not fit in unsigned long long */
return (off_t)-1;
} else if (*end) {
/* line began with a number but has junk left over at the end */
return (off_t)-1;
}
return (off_t)result;
}
time_t _alpm_parsedate(const char *line)
{
if(isalpha((unsigned char)line[0])) {
/* initialize to null in case of failure */
struct tm tmp_tm = { 0 };
struct tm tmp_tm;
memset(&tmp_tm, 0, sizeof(struct tm));
setlocale(LC_TIME, "C");
strptime(line, "%a %b %e %H:%M:%S %Y", &tmp_tm);
setlocale(LC_TIME, "");
return mktime(&tmp_tm);
}
return atol(line);
return (time_t)atol(line);
}
/**

View File

@@ -75,6 +75,13 @@
#define CHECK_HANDLE(handle, action) do { if(!(handle)) { action; } (handle)->pm_errno = 0; } while(0)
/** Standard buffer size used throughout the library. */
#ifdef BUFSIZ
#define ALPM_BUFFER_SIZE BUFSIZ
#else
#define ALPM_BUFFER_SIZE 8192
#endif
/**
* Used as a buffer/state holder for _alpm_archive_fgets().
*/
@@ -91,6 +98,11 @@ struct archive_read_buffer {
int ret;
};
enum _alpm_csum {
ALPM_CSUM_MD5,
ALPM_CSUM_SHA256,
};
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);
@@ -109,12 +121,13 @@ int _alpm_str_cmp(const void *s1, const void *s2);
char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename);
const char *_alpm_filecache_setup(alpm_handle_t *handle);
int _alpm_lstat(const char *path, struct stat *buf);
int _alpm_test_md5sum(const char *filepath, const char *md5sum);
int _alpm_test_checksum(const char *filepath, const char *expected, enum _alpm_csum type);
int _alpm_archive_fgets(struct archive *a, struct archive_read_buffer *b);
int _alpm_splitname(const char *target, char **name, char **version,
unsigned long *name_hash);
unsigned long _alpm_hash_sdbm(const char *str);
long _alpm_parsedate(const char *line);
off_t _alpm_strtoofft(const char *line);
time_t _alpm_parsedate(const char *line);
int _alpm_raw_cmp(const char *first, const char *second);
int _alpm_raw_ncmp(const char *first, const char *second, size_t max);
int _alpm_access(alpm_handle_t *handle, const char *dir, const char *file, int amode);

View File

@@ -98,16 +98,21 @@ static int rpmvercmp(const char *a, const char *b)
str1 = strdup(a);
str2 = strdup(b);
one = str1;
two = str2;
one = ptr1 = str1;
two = ptr2 = str2;
/* 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++;
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;
if (!(*one && *two)) break;
/* If the separator lengths were different, we are also finished */
if ((one - ptr1) != (two - ptr2)) {
return (one - ptr1) < (two - ptr2) ? -1 : 1;
}
ptr1 = one;
ptr2 = two;
@@ -115,13 +120,13 @@ static int rpmvercmp(const char *a, const char *b)
/* 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)) {
while(*ptr1 && isdigit((int)*ptr1)) ptr1++;
while(*ptr2 && isdigit((int)*ptr2)) ptr2++;
if (isdigit((int)*ptr1)) {
while (*ptr1 && isdigit((int)*ptr1)) ptr1++;
while (*ptr2 && isdigit((int)*ptr2)) ptr2++;
isnum = 1;
} else {
while(*ptr1 && isalpha((int)*ptr1)) ptr1++;
while(*ptr2 && isalpha((int)*ptr2)) ptr2++;
while (*ptr1 && isalpha((int)*ptr1)) ptr1++;
while (*ptr2 && isalpha((int)*ptr2)) ptr2++;
isnum = 0;
}

85
ltmain.sh Executable file → Normal file
View File

@@ -1,9 +1,9 @@
# libtool (GNU libtool) 2.4
# libtool (GNU libtool) 2.4.2
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# 2007, 2008, 2009, 2010, 2011 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.
@@ -41,6 +41,7 @@
# --quiet, --silent don't print informational messages
# --no-quiet, --no-silent
# print informational messages (default)
# --no-warn don't display warning messages
# --tag=TAG use configuration variables from tag TAG
# -v, --verbose print more informational messages than default
# --no-verbose don't print the extra informational messages
@@ -69,7 +70,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
# $progname: (GNU libtool) 2.4
# $progname: (GNU libtool) 2.4.2
# automake: $automake_version
# autoconf: $autoconf_version
#
@@ -79,9 +80,9 @@
PROGRAM=libtool
PACKAGE=libtool
VERSION=2.4
VERSION=2.4.2
TIMESTAMP=""
package_revision=1.3293
package_revision=1.3337
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -136,15 +137,10 @@ progpath="$0"
: ${CP="cp -f"}
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
: ${EGREP="grep -E"}
: ${FGREP="grep -F"}
: ${GREP="grep"}
: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
: ${SED="sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}
@@ -387,7 +383,7 @@ case $progpath in
;;
*)
save_IFS="$IFS"
IFS=:
IFS=${PATH_SEPARATOR-:}
for progdir in $PATH; do
IFS="$save_IFS"
test -x "$progdir/$progname" && break
@@ -771,8 +767,8 @@ func_help ()
s*\$LTCFLAGS*'"$LTCFLAGS"'*
s*\$LD*'"$LD"'*
s/\$with_gnu_ld/'"$with_gnu_ld"'/
s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
p
d
}
@@ -1052,6 +1048,7 @@ opt_finish=false
opt_help=false
opt_help_all=false
opt_silent=:
opt_warning=:
opt_verbose=:
opt_silent=false
opt_verbose=false
@@ -1118,6 +1115,10 @@ esac
;;
--no-silent|--no-quiet)
opt_silent=false
func_append preserve_args " $opt"
;;
--no-warning|--no-warn)
opt_warning=false
func_append preserve_args " $opt"
;;
--no-verbose)
@@ -2059,7 +2060,7 @@ func_mode_compile ()
*.[cCFSifmso] | \
*.ada | *.adb | *.ads | *.asm | \
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
*.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
*.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
func_xform "$libobj"
libobj=$func_xform_result
;;
@@ -3201,11 +3202,13 @@ func_mode_install ()
# Set up the ranlib parameters.
oldlib="$destdir/$name"
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
tool_oldlib=$func_to_tool_file_result
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
if test -n "$stripme" && test -n "$old_striplib"; then
func_show_eval "$old_striplib $oldlib" 'exit $?'
func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
fi
# Do each command in the postinstall commands.
@@ -3470,7 +3473,7 @@ static const void *lt_preloaded_setup() {
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
*-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
*-*-hpux*)
pic_flag_for_symtable=" $pic_flag" ;;
@@ -5060,9 +5063,15 @@ void lt_dump_script (FILE* f)
{
EOF
func_emit_wrapper yes |
$SED -e 's/\([\\"]\)/\\\1/g' \
-e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
$SED -n -e '
s/^\(.\{79\}\)\(..*\)/\1\
\2/
h
s/\([\\"]\)/\\\1/g
s/$/\\n/
s/\([^\n]*\).*/ fputs ("\1", f);/p
g
D'
cat <<"EOF"
}
EOF
@@ -5646,7 +5655,8 @@ func_mode_link ()
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -5790,9 +5800,12 @@ func_mode_link ()
arg=$func_stripname_result
;;
-Wl,--as-needed|-Wl,--no-as-needed)
deplibs="$deplibs $arg"
continue
-Wl,*--as-needed*)
deplibs="$deplibs $wl--as-needed"
;;
-Wl,*--no-as-needed*)
deplibs="$deplibs $wl--no-as-needed"
;;
-Wl,*)
@@ -6164,7 +6177,8 @@ func_mode_link ()
fi
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -6848,7 +6862,7 @@ func_mode_link ()
test "$hardcode_direct_absolute" = no; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$dir"
add_dir="-L$absdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -7333,6 +7347,7 @@ func_mode_link ()
# which has an extra 1 added just for fun
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
darwin|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
@@ -7449,7 +7464,7 @@ func_mode_link ()
versuffix="$major.$revision"
;;
linux)
linux) # correct to gnu/linux during the next big refactor
func_arith $current - $age
major=.$func_arith_result
versuffix="$major.$age.$revision"
@@ -8037,6 +8052,11 @@ EOF
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
# Remove ${wl} instances when linking with ld.
# FIXME: should test the right _cmds variable.
case $archive_cmds in
*\$LD\ *) wl= ;;
esac
if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
@@ -8067,7 +8087,7 @@ EOF
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) func_apped perm_rpath " $libdir" ;;
*) func_append perm_rpath " $libdir" ;;
esac
fi
done
@@ -8075,11 +8095,7 @@ EOF
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
if test -n "$hardcode_libdir_flag_spec_ld"; then
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
else
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
@@ -9169,6 +9185,8 @@ EOF
esac
done
fi
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
tool_oldlib=$func_to_tool_file_result
eval cmds=\"$old_archive_cmds\"
func_len " $cmds"
@@ -9278,7 +9296,8 @@ EOF
*.la)
func_basename "$deplib"
name="$func_basename_result"
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
func_resolve_sysroot "$deplib"
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
test -z "$libdir" && \
func_fatal_error "\`$deplib' is not a valid libtool archive"
func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"

10
m4/ltversion.m4 vendored
View File

@@ -9,15 +9,15 @@
# @configure_input@
# serial 3293 ltversion.m4
# serial 3337 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4])
m4_define([LT_PACKAGE_REVISION], [1.3293])
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4'
macro_revision='1.3293'
[macro_version='2.4.2'
macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

View File

@@ -4,9 +4,7 @@ AUTOMAKE_OPTIONS = std-options
SUBDIRS = po
bin_SCRIPTS = \
$(OURSCRIPTS) \
repo-remove \
repo-elephant
$(OURSCRIPTS)
OURSCRIPTS = \
makepkg \
@@ -46,6 +44,7 @@ edit = sed \
-e 's|@localedir[@]|$(localedir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
-e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
-e 's|@prefix[@]|$(prefix)|g' \
-e '1s|!/bin/bash|!$(BASH_SHELL)|g' \
-e 's|@PACKAGE_VERSION[@]|$(REAL_PACKAGE_VERSION)|g' \
@@ -65,7 +64,7 @@ edit = sed \
# third 'test' line- make sure one of the two checks succeeded
$(OURSCRIPTS): Makefile
@echo ' ' GEN $@;
@rm -f $@
@$(RM) $@
@test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@
@chmod +x $@
@chmod a-w $@
@@ -98,11 +97,27 @@ repo-add: \
$(srcdir)/library/output_format.sh
repo-remove: $(srcdir)/repo-add.sh.in
rm -f repo-remove
$(RM) repo-remove
$(LN_S) repo-add repo-remove
repo-elephant: $(srcdir)/repo-add.sh.in
rm -f repo-elephant
$(RM) repo-elephant
$(LN_S) repo-add repo-elephant
install-data-hook:
cd $(DESTDIR)$(bindir) && \
$(RM) repo-elephant && \
( $(LN_S) repo-add repo-elephant || \
ln repo-add repo-elephant || \
cp repo-add repo-elephant )
cd $(DESTDIR)$(bindir) && \
$(RM) repo-remove && \
( $(LN_S) repo-add repo-remove || \
ln repo-add repo-remove || \
cp repo-add repo-remove )
uninstall-hook:
cd $(DESTDIR)$(bindir) && \
$(RM) repo-remove repo-elephant
# vim:set ts=2 sw=2 noet:

View File

@@ -81,6 +81,8 @@ FORCE_VER=""
PACMAN_OPTS=
shopt -s extglob
### SUBROUTINES ###
plain() {
@@ -172,15 +174,6 @@ clean_up() {
}
##
# Signal Traps
##
set -E
trap 'clean_up' 0
trap 'trap_exit "$(gettext "TERM signal caught. Exiting...")"' TERM HUP QUIT
trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT
trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR
enter_fakeroot() {
msg "$(gettext "Entering %s environment...")" "fakeroot"
@@ -250,7 +243,7 @@ get_full_version() {
for i in pkgver pkgrel epoch; do
local indirect="${i}_override"
eval $(declare -f package_$1 | sed -n "s/\(^[[:space:]]*$i=\)/${i}_override=/p")
[[ -z ${!indirect} ]] && eval "${indirect}=\${${i}}"
[[ -z ${!indirect} ]] && eval ${indirect}=\"${!i}\"
done
if (( ! $epoch_override )); then
echo $pkgver_override-$pkgrel_override
@@ -341,7 +334,7 @@ in_array() {
source_has_signatures(){
local file
for file in "${source[@]}"; do
if [[ $file =~ .*(sig|asc) ]]; then
if [[ $file = *.@(sig?(n)|asc) ]]; then
return 0
fi
done
@@ -412,7 +405,7 @@ download_file() {
fi
# rename the temporary download file to the final destination
if [[ $dlfile != $file ]]; then
if [[ $dlfile != "$file" ]]; then
mv -f "$SRCDEST/$dlfile" "$SRCDEST/$file"
fi
}
@@ -420,7 +413,7 @@ download_file() {
run_pacman() {
local cmd
printf -v cmd "%q " "$PACMAN" $PACMAN_OPTS "$@"
if (( ! ASROOT )) && [[ ! $1 =~ ^-(T|Qq)$ ]]; then
if (( ! ASROOT )) && [[ ! $1 = -@(T|Qq) ]]; then
if type -p sudo >/dev/null; then
cmd="sudo $cmd"
else
@@ -439,8 +432,8 @@ check_deps() {
local ret=0
local pmout
pmout=$(run_pacman -T "$@") || ret=$?
set -E
set -E
if (( ret == 127 )); then #unresolved deps
echo "$pmout"
elif (( ret )); then
@@ -472,11 +465,13 @@ handle_deps() {
fi
# we might need the new system environment
# avoid triggering the ERR trap
# avoid triggering the ERR trap and exiting
set +e
local restoretrap=$(trap -p ERR)
trap - ERR
source /etc/profile &>/dev/null
eval $restoretrap
set -e
return $R_DEPS_SATISFIED
}
@@ -702,52 +697,55 @@ check_pgpsigs() {
msg "$(gettext "Verifying source file signatures with %s...")" "gpg"
local file
local file pubkey
local warning=0
local errors=0
local statusfile=$(mktemp)
for file in "${source[@]}"; do
file="$(get_filename "$file")"
if [[ ! $file =~ .*(sig|asc) ]]; then
if [[ ! $file = *.@(sig?(n)|asc) ]]; then
continue
fi
echo -n " ${file%.*} ... " >&2
printf " %s ... " "${file%.*}" >&2
if ! file="$(get_filepath "$file")"; then
echo "$(gettext "SIGNATURE NOT FOUND")" >&2
printf '%s\n' "$(gettext "SIGNATURE NOT FOUND")" >&2
errors=1
continue
fi
if ! sourcefile="$(get_filepath "${file%.*}")"; then
echo "$(gettext "SOURCE FILE NOT FOUND")" >&2
printf '%s\n' "$(gettext "SOURCE FILE NOT FOUND")" >&2
errors=1
continue
fi
if ! gpg --quiet --batch --status-file "$statusfile" --verify "$file" "$sourcefile" 2> /dev/null; then
if grep "NO_PUBKEY" "$statusfile" > /dev/null; then
warning "$(gettext "Unknown public key") $(awk '/NO_PUBKEY/ {print $3}' $statusfile)" >&2
printf '%s' "$(gettext "FAILED")" >&2
if ! pubkey=$(awk '/NO_PUBKEY/ { print $3; exit 1; }' "$statusfile"); then
printf ' (%s)' "$(gettext "unknown public key") $pubkey" >&2
warnings=1
else
echo "$(gettext "FAILED")" >&2
errors=1
fi
printf '\n' >&2
else
if grep "REVKEYSIG" "$statusfile" > /dev/null; then
echo "$(gettext "Passed")" "-" "$(gettext "Warning: the key has been revoked.")" >&2
if grep -q "REVKEYSIG" "$statusfile"; then
printf '%s (%s)' "$(gettext "FAILED")" "$(gettext "the key has been revoked.")" >&2
errors=1
elif grep "EXPSIG" "$statusfile" > /dev/null; then
echo "$(gettext "Passed")" "-" "$(gettext "Warning: the signature has expired.")" >&2
warnings=1
elif grep "EXPKEYSIG" "$statusfile" > /dev/null; then
echo "$(gettext "Passed")" "-" "$(gettext "Warning: the key has expired.")" >&2
warnings=1
else
echo $(gettext "Passed") >&2
printf '%s' "$(gettext "Passed")" >&2
if grep -q "EXPSIG" "$statusfile"; then
printf ' (%s)' "$(gettext "WARNING:") $(gettext "the signature has expired.")" >&2
warnings=1
elif grep -q "EXPKEYSIG" "$statusfile"; then
printf ' (%s)' "$(gettext "WARNING:") $(gettext "the key has expired.")" >&2
warnings=1
fi
fi
printf '\n' >&2
fi
done
@@ -864,14 +862,12 @@ run_function() {
# clear user-specified buildflags if requested
if [[ $(check_option buildflags) = "n" ]]; then
CFLAGS=""
CXXFLAGS=""
LDFLAGS=""
unset CFLAGS CXXFLAGS LDFLAGS
fi
# clear user-specified makeflags if requested
if [[ $(check_option makeflags) = "n" ]]; then
MAKEFLAGS=""
unset MAKEFLAGS
fi
msg "$(gettext "Starting %s()...")" "$pkgfunc"
@@ -991,16 +987,15 @@ tidy_install() {
# check file still exists (potentially already compressed due to hardlink)
if [[ -f ${manpage} ]]; then
# find hard links and remove them
# the '|| true' part keeps the script from bailing if find returned an
# error, such as when one of the man directories doesn't exist
hardlinks="$(find ${MAN_DIRS[@]} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true
for hl in ${hardlinks}; do
rm -f "${hl}";
done
# the '|| true' part keeps the script from bailing on the EOF returned
# by read at the end of the find output
IFS=$'\n' read -rd '' -a hardlinks < \
<(find "${MAN_DIRS[@]}" \! -name "$file" -samefile "$manpage" 2>/dev/null) || true
rm -f "${hardlinks[@]}"
# compress the original
gzip -9 "$manpage"
# recreate hard links removed earlier
for hl in ${hardlinks}; do
for hl in "${hardlinks[@]}"; do
ln "${manpage}.gz" "${hl}.gz"
chmod 644 ${hl}.gz
done
@@ -1018,11 +1013,11 @@ tidy_install() {
find . -type f -perm -u+w 2>/dev/null | while read binary ; do
case "$(file -bi "$binary")" in
*application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip $STRIP_SHARED "$binary";;
strip $STRIP_SHARED "$binary";;
*application/x-archive*) # Libraries (.a)
/usr/bin/strip $STRIP_STATIC "$binary";;
strip $STRIP_STATIC "$binary";;
*application/x-executable*) # Binaries
/usr/bin/strip $STRIP_BINARIES "$binary";;
strip $STRIP_BINARIES "$binary";;
esac
done
fi
@@ -1130,7 +1125,7 @@ write_pkginfo() {
[[ $license ]] && printf "license = %s\n" "${license[@]}"
[[ $replaces ]] && printf "replaces = %s\n" "${replaces[@]}"
[[ $groups ]] && printf "group = %s\n" "${groups[@]}"
[[ $optdepends ]] && printf "optdepend = %s\n" "${optdepends[@]}"
[[ $optdepends ]] && printf "optdepend = %s\n" "${optdepends[@]//+([[:space:]])/ }"
[[ $conflicts ]] && printf "conflict = %s\n" "${conflicts[@]}"
[[ $backup ]] && printf "backup = %s\n" "${backup[@]}"
@@ -1252,17 +1247,6 @@ create_package() {
# tar it up
msg2 "$(gettext "Compressing package...")"
local EXT
case "$PKGEXT" in
*tar.gz) EXT=${PKGEXT%.gz} ;;
*tar.bz2) EXT=${PKGEXT%.bz2} ;;
*tar.xz) EXT=${PKGEXT%.xz} ;;
*tar.Z) EXT=${PKGEXT%.Z} ;;
*tar) EXT=${PKGEXT} ;;
*) warning "$(gettext "'%s' is not a valid archive extension.")" \
"$PKGEXT" ; EXT=$PKGEXT ;;
esac
local fullver=$(get_full_version)
local pkg_file="$PKGDEST/${nameofpkg}-${fullver}-${PKGARCH}${PKGEXT}"
local ret=0
@@ -1275,13 +1259,18 @@ create_package() {
shopt -s nullglob
# TODO: Maybe this can be set globally for robustness
shopt -s -o pipefail
# bsdtar's gzip compression always saves the time stamp, making one
# archive created using the same command line distinct from another.
# Disable bsdtar compression and use gzip -n for now.
bsdtar -cf - $comp_files * |
case "$PKGEXT" in
*tar.gz) gzip -c -f -n ;;
*tar.bz2) bzip2 -c -f ;;
*tar.xz) xz -c -z - ;;
*tar.Z) compress -c -f ;;
*tar) cat ;;
*tar.gz) gzip -c -f -n ;;
*tar.bz2) bzip2 -c -f ;;
*tar.xz) xz -c -z - ;;
*tar.Z) compress -c -f ;;
*tar) cat ;;
*) warning "$(gettext "'%s' is not a valid archive extension.")" \
"$PKGEXT"; cat ;;
esac > "${pkg_file}" || ret=$?
shopt -u nullglob
@@ -1333,6 +1322,7 @@ create_signature() {
}
create_srcpackage() {
local ret=0
msg "$(gettext "Creating source package...")"
local srclinks="$(mktemp -d "$startdir"/srclinks.XXXXXXXXX)"
mkdir "${srclinks}"/${pkgbase}
@@ -1354,16 +1344,15 @@ create_srcpackage() {
local i
for i in 'changelog' 'install'; do
local filelist=$(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
local file
for file in $filelist; do
while read -r file; do
# evaluate any bash variables used
eval file=${file}
if [[ ! -f "${srclinks}/${pkgbase}/$file" ]]; then
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
if [[ $file && ! -f "${srclinks}/${pkgbase}/$file" ]]; then
msg2 "$(gettext "Adding %s file (%s)...")" "$i" "${file}"
ln -s "${startdir}/$file" "${srclinks}/${pkgbase}/"
fi
done
done < <(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
done
local TAR_OPT
@@ -1371,6 +1360,7 @@ create_srcpackage() {
*tar.gz) TAR_OPT="z" ;;
*tar.bz2) TAR_OPT="j" ;;
*tar.xz) TAR_OPT="J" ;;
*tar.Z) TAR_OPT="Z" ;;
*tar) TAR_OPT="" ;;
*) warning "$(gettext "'%s' is not a valid archive extension.")" \
"$SRCEXT" ;;
@@ -1387,7 +1377,7 @@ create_srcpackage() {
exit 1 # TODO: error code
fi
if (( ! ret )) && [[ ! "$SRCPKGDEST" -ef "${startdir}" ]]; then
if [[ ! "$SRCPKGDEST" -ef "${startdir}" ]]; then
rm -f "${pkg_file/$SRCPKGDEST/$startdir}"
ln -s "${pkg_file}" "${pkg_file/$SRCPKGDEST/$startdir}"
ret=$?
@@ -1449,25 +1439,28 @@ check_sanity() {
ret=1
fi
awk -F'=' '/^[[:space:]]*pkgver=/ { $1=""; print $0 }' "$BUILDFILE" |
while read i _; do
if [[ $i =~ [[:space:]:-] ]]; then
awk -F'=' '$1 ~ /^[[:space:]]*pkgver$/' "$BUILDFILE" | sed "s/[[:space:]]*#.*//" |
while IFS='=' read -r _ i; do
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "${i%%+([[:space:]])}")\"
if [[ $i = *[[:space:]:-]* ]]; then
error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
return 1
fi
done || ret=1
awk -F'=' '/^[[:space:]]*pkgrel=/ { $1=""; print $0 }' "$BUILDFILE" |
while read i _; do
if [[ $i =~ [[:space:]-] ]]; then
awk -F'=' '$1 ~ /^[[:space:]]*pkgrel$/' "$BUILDFILE" | sed "s/[[:space:]]*#.*//" |
while IFS='=' read -r _ i; do
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "${i%%+([[:space:]])}")\"
if [[ $i = *[[:space:]-]* ]]; then
error "$(gettext "%s is not allowed to contain hyphens or whitespace.")" "pkgrel"
return 1
fi
done || ret=1
awk -F'=' '/^[[:space:]]*epoch=/ { $1=""; print $0 }' "$BUILDFILE" |
while read i _; do
if [[ ! $i =~ ^[0-9]*$ ]]; then
awk -F'=' '$1 ~ /^[[:space:]]*epoch$/' "$BUILDFILE" |
while IFS='=' read -r _ i; do
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "${i%%+([[:space:]])}")\"
if [[ $i != *([[:digit:]]) ]]; then
error "$(gettext "%s must be an integer.")" "epoch"
return 1
fi
@@ -1503,7 +1496,7 @@ check_sanity() {
eval $(awk '/^[[:space:]]*provides=/,/\)/' "$BUILDFILE" | \
sed -e "s/provides=/provides_list+=/" -e "s/#.*//" -e 's/\\$//')
for i in ${provides_list[@]}; do
if [[ $i != ${i//</} || $i != ${i//>/} ]]; then
if [[ $i == *['<>']* ]]; then
error "$(gettext "%s array cannot contain comparison (< or >) operators.")" "provides"
ret=1
fi
@@ -1523,24 +1516,24 @@ check_sanity() {
eval $(awk '/^[[:space:]]*optdepends=\(/,/\)[[:space:]]*(#.*)?$/' "$BUILDFILE" | \
sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//" -e 's/\\$//')
for i in "${optdepends_list[@]}"; do
local pkg=${i%%:*}
if [[ ! $pkg =~ ^[[:alnum:]\>\<\=\.\+\_\-]+$ ]]; then
local pkg=${i%%:[[:space:]]*}
# the '-' character _must_ be first or last in the character range
if [[ $pkg != +([-[:alnum:]><=.+_:]) ]]; then
error "$(gettext "Invalid syntax for %s : '%s'")" "optdepend" "$i"
ret=1
fi
done
for i in 'changelog' 'install'; do
local filelist=$(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
local file
for file in $filelist; do
while read -r file; do
# evaluate any bash variables used
eval file=${file}
if [[ ! -f $file ]]; then
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
if [[ $file && ! -f $file ]]; then
error "$(gettext "%s file (%s) does not exist.")" "$i" "$file"
ret=1
fi
done
done < <(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
done
local valid_options=1
@@ -1611,7 +1604,7 @@ check_software() {
fi
# gpg - source verification
if (( ! SKIPPGPCHECK )) && [[ source_has_signatures ]]; then
if (( ! SKIPPGPCHECK )) && source_has_signatures; then
if ! type -p gpg >/dev/null; then
error "$(gettext "Cannot find the %s binary required for verifying source files.")" "gpg"
ret=1
@@ -1761,7 +1754,7 @@ devel_update() {
# _foo=pkgver
#
if [[ -n $newpkgver ]]; then
if [[ $newpkgver != $pkgver ]]; then
if [[ $newpkgver != "$pkgver" ]]; then
if [[ -f $BUILDFILE && -w $BUILDFILE ]]; then
@SEDINPLACE@ "s/^pkgver=[^ ]*/pkgver=$newpkgver/" "$BUILDFILE"
@SEDINPLACE@ "s/^pkgrel=[^ ]*/pkgrel=1/" "$BUILDFILE"
@@ -1844,6 +1837,7 @@ usage() {
echo "$(gettext " -r, --rmdeps Remove installed dependencies after a successful build")"
echo "$(gettext " -R, --repackage Repackage contents of the package without rebuilding")"
printf "$(gettext " -s, --syncdeps Install missing dependencies with %s")\n" "pacman"
echo "$(gettext " -S, --source Generate a source-only tarball without downloaded sources")"
echo "$(gettext " --allsource Generate a source-only tarball including downloaded sources")"
printf "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg"
printf "$(gettext " --check Run the %s function in the %s")\n" "check()" "$BUILDSCRIPT"
@@ -1857,7 +1851,6 @@ usage() {
echo "$(gettext " --skipchecksums Do not verify checksums of the source files")"
echo "$(gettext " --skipinteg Do not perform any verification checks on source files")"
echo "$(gettext " --skippgpcheck Do not verify source files with PGP signatures")"
echo "$(gettext " --source Generate a source-only tarball without downloaded sources")"
echo
printf "$(gettext "These options can be passed to %s:")\n" "pacman"
echo
@@ -1889,7 +1882,7 @@ fi
ARGLIST=("$@")
# Parse Command Line Options.
OPT_SHORT="AcdefFghiLmop:rRsV"
OPT_SHORT="AcdefFghiLmop:rRsSV"
OPT_LONG="allsource,asroot,ignorearch,check,clean,nodeps"
OPT_LONG+=",noextract,force,forcever:,geninteg,help,holdver,skippgpcheck"
OPT_LONG+=",install,key:,log,nocolor,nobuild,nocheck,nosign,pkg:,rmdeps"
@@ -1940,8 +1933,8 @@ while true; do
--skipinteg) SKIPCHECKSUMS=1; SKIPPGPCHECK=1 ;;
--skippgpcheck) SKIPPGPCHECK=1;;
--sign) SIGNPKG='y' ;;
--source) SOURCEONLY=1 ;;
-s|--syncdeps) DEP_BIN=1 ;;
-S|--source) SOURCEONLY=1 ;;
-h|--help) usage; exit 0 ;; # E_OK
-V|--version) version; exit 0 ;; # E_OK
@@ -1952,6 +1945,15 @@ while true; do
shift
done
# setup signal traps
trap 'clean_up' 0
for signal in TERM HUP QUIT; do
trap "trap_exit \"$(gettext "%s signal caught. Exiting...")\" \"$signal\"" "$signal"
done
trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT
trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR
set -E
# preserve environment variables and canonicalize path
[[ -n ${PKGDEST} ]] && _PKGDEST=$(canonicalize_path ${PKGDEST})
[[ -n ${SRCDEST} ]] && _SRCDEST=$(canonicalize_path ${SRCDEST})

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