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

1336 Commits

Author SHA1 Message Date
Dan McGee
dff73a2a69 Avoid stat call to determine is_directory if possible
On Linux and OS X, we can determine if an entry obtained through a readdir()
call is a directory without also having to stat it. This can save a
significant number of syscalls. The performance increase isn't dramatic, but
it could be on some platforms (e.g. Cygwin) so it shouldn't hurt to use this
unconditionally where supported.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-11 10:06:03 -05:00
Sebastian Nowicki
821ff061b1 Set pm_errno on libarchive errors while reading
Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-27 10:53:48 -05:00
Dan McGee
d2ff8f4b96 Update gettext Makefiles to 0.18
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-23 08:17:06 -05:00
Dan McGee
d201d1f312 Merge branch 'maint' 2010-09-15 07:31:37 -05:00
Baurzhan Muftakhidinov
e29dde9157 Update Kazakh translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-15 07:19:51 -05:00
Dan McGee
fe788ee4a6 Fix libfetch configure checking
I don't know what I tested in commit 3e7b90ff69, but it definitely wasn't
working as advertised. Fix the checks in the source code itself to match the
right define (HAVE_LIBFETCH), as well as make sure the configure check
defaults to looking for the library but not bailing if it could not be
found.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-06 11:20:51 -05:00
Dan McGee
6d41da4086 Minor translation file updates after make distcheck
It touched up these a bit after it ran, so might as well check the changes
in so we don't have to deal with them again later.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 20:10:10 -05:00
Dan McGee
881bf5c90f Merge branch 'maint' 2010-09-03 20:06:08 -05:00
Tobias Eriksson
3739e2c10c libalpm Swedish translation update
Signed-off by: Tobias Eriksson <tobier@tobier.se>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 19:55:22 -05:00
Dan McGee
3e7b90ff69 Clean up libfetch checking in configure
Model it after the new OpenSSL check, and have it be a bit more useful. If
you do not explicitly pass a command line option, it will be linked if
available but will not error out if it is missing. Also bump the version to
that where connection caching was introduced as we use these new features in
the codebase.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-02 12:30:36 -05:00
Dan McGee
eba521913d Use OpenSSL MD5 crypto functions if available
I've noticed my Atom-powered laptop is dog-slow when doing integrity checks
on packages, and it turns out our MD5 implementation isn't near as good as
that provided by OpenSSL. Using their routines instead provided anywhere
from a 1.4x up to a 1.8x performance benefit over our built-in MD5 function.

This does not remove the MD5 code from our codebase, but it does enable
linking against OpenSSL to get their much faster implementation if it is
available on whatever platform you are using. At configure-time, we will
default to using it if it is available, but this can be easily changed by
using the `--with-openssl` or `--without-openssl` arguments to configure.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-02 12:05:23 -05:00
Dan McGee
24d8a15308 libalpm md5: use larger and dynamic buffer
This gave at least a 10% improvement on a few tested platforms due to the
reduced number of read calls from files when computing the md5sum. It really
is just a precursor to another patch to come which is to use MD5 functions
that do the job a lot better than anything we can do.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-02 10:33:21 -05:00
Dan McGee
5a25f54757 Merge branch 'maint' 2010-09-01 21:19:06 -05:00
Gaspar Santos
a7c4159b16 Add new European Portuguese translation
This is being checked in as 'pt' rather than 'pt_PT' as that is what
Transifex seems to want, and it is also the dominant choice of packages
already installed on my system when doing a count of the files located in
the /usr/share/locale translation directories.

Thanks for the new translation!

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-01 21:15:07 -05:00
Jonathan Conder
693ebbd16b use execv to avoid using sh just to run ldconfig
Signed-off-by: Jonathan Conder <j@skurvy.no-ip.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 11:19:15 -05:00
Jonathan Conder
0223a028e0 redirect scriptlet stderr synchronously through alpm
Fixes FS#18770, and hopefully an occasional deadlock in my frontend as well.
For simplicity it redirects all scriptlet output through SCRIPTLET_INFO, and
all callbacks in the child process have been replaced for thread-safety.

Signed-off-by: Jonathan Conder <j@skurvy.no-ip.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 11:19:09 -05:00
Dan McGee
8d88f0c897 Merge branch 'maint' 2010-08-23 21:53:06 -05:00
Allan McRae
48589ccc64 Fix some whitespace issues
The combination of tabs and spaces is annoying in any editor that
does not use a tab width of 2 spaces.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-23 21:49:05 -05:00
Dan McGee
d896527d21 fgets invocation cleanup
From the fgets manpage:

	fgets() reads in at most one less than size characters from stream and
	stores them into the buffer pointed to by s. Reading stops after an EOF
	or a newline. If a newline is read, it is stored into the buffer. A
	'\0' is stored after the last character in the buffer.

This means there is no need at all to do 'size - 1' math. Remove all of that
and just use sizeof() for simplicity on the buffer we plan on reading into.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-23 21:48:28 -05:00
Jozef Riha
0478dfa1a5 Add Slovak translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-23 21:45:54 -05:00
Dan McGee
ce3f4e7800 Enable libfetch connection caching
This will allow downloads to reuse connections if possible, which could make
big differences on perceived FTP speed as the connection won't have to be
reestablished each time. For the most part, HTTP requests wouldn't be using
keep alive anyway so this won't have an effect there.

I'm not enthused about having to do this with the library initialization,
but there isn't a much better place due to the fact that the loop over
databases occurs on the frontend and not the backend.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-23 17:42:22 -05:00
Mateusz Herych
c3f5375380 Updates for Polish translations
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-18 13:11:28 -05:00
Dan McGee
ddc4130c97 Merge branch 'maint' 2010-07-27 10:18:35 -05:00
Baurzhan Muftakhidinov
0d6efb35ce Small fix to Kazakh translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-27 10:14:35 -05:00
Dan McGee
fa4f25626c Mark sync_pkg and sync_target as static functions
We no longer use these anywhere outside of sync.c, so do the rename and add
static to their definition to meet our coding standards.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-27 10:10:55 -05:00
Dan McGee
f8d7cd6b26 Maintain a list of seen packages when installing a group
As reported in FS#20221, we don't always do the right thing when installing
a group and using the --needed option. This was due to the code pulling
packages based on what was already in the transaction's add list, but
completely ignoring the fact that we may have already seen and skipped this
same package in an earlier repository.

Add a list to the private _alpm_sync_pkg() function that allows us to have
this extra information so we don't mistakenly downgrade a package when using
--needed.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-27 10:10:55 -05:00
Allan McRae
a835599496 Download sync db into DBPath/sync
The sync db should be stored in the sync/ folder.  This cleans up
DBPath to only have local/ and sync/ directories in it.

A nice side effect is that the db are now in the right place so we
can implement directly reading from them.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-07 07:26:04 -05:00
Allan McRae
68dcabdfbe Remove DBEXT usage
With commit 5dffef78, the repo database always has a symlink
of the form reponame.db.  Use that filename and let libarchive
determine the compression type.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-07 07:25:55 -05:00
Allan McRae
60de8ec932 Check return value of fgets calls
Prevents compiler warnings with -D_FORTIFY_SOURCE=2

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-07 07:24:57 -05:00
Allan McRae
5a3aae02fe Check return value of chdir and getcwd
Prevents compiler warnings when building with -D_FORTIFY_SOURCE=2

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-01 00:14:59 -05:00
Allan McRae
41724cbcde Check return value of fwrite when copying files
Check that writing to destination file actually occurs in
_alpm_copyfile.  Required adding a new error (PM_ERR_WRITE)
as none of the others appeared appropriate.

Prevents compiler warning when using -D_FORTIFY_SOURCE=2.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-30 23:49:48 -05:00
Allan McRae
081e6a8360 Do not compare signed and unsigned types
The casting of nread is safe as it is tested to be >0 when it is
initally assigned.  It is also being implicitly cast in the fwrite
call in the line above.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-30 08:32:11 -05:00
Dan McGee
67d71ea932 Merge branch 'maint' 2010-06-20 21:01:32 -05:00
Dan McGee
6c00ca8f23 Handle sync target + ignore properly
Rather than say we can't find the target after saying "No, I guess I don't
want to install this", we should make sure the ignored status gets passed
all the way through. This fixes FS#19866.

Pactest is also included that failed before due to the fact that we normally
treat an unfound package as a reason to exit with a non-zero status.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 15:19:19 -05:00
Allan McRae
59c47aaf52 Clarify testing within conditional statements
Follow the HACKING guidelines and always use != 0 or == 0 rather
than negation within conditional statements to improve clarity.
Most of these are !strcmp usages which is the example of what not
to do in the HACKING document.

Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-21 01:04:58 +10:00
Andres P
3e4d2c3aa6 libalpm: compare pkgname with strcoll
Use strcoll to compare package names to provide output sorted
according to a users LC_COLLATE settings.

Signed-off-by: Andres P <aepd87@gmail.com>
[Allan: added commit message]
Signed-off-by: Allan McRae <allan@archlinux.org>
2010-06-21 01:04:57 +10:00
Ionuț Bîru
c355d2a3b7 Update Romanian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 12:18:01 -05:00
Leandro Inácio
6e31ddf42e Revise Portuguese (Brazil) translation
Fix the '\t' characters that got introduced by the last update of this
translation that should not have been there.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 12:08:28 -05:00
Manuel Tortosa
8fbc91e693 Updating Catalan translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 12:02:07 -05:00
Juan Pablo González T
fe7b77cd8a Update Spanish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 11:00:20 -05:00
Roman Kyrylych
ea7696b441 Update Ukrainian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-14 10:29:57 -05:00
Leandro Inácio
6297248087 Update Portuguese (Brazil) translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-11 19:01:46 -05:00
Dan McGee
5f5b6f16af translations: rename Norwegian translation from nb_NO to nb
This puts us more in line with other projects that don't attach the country
code to the language code.

$ du -sh /usr/share/locale/nb*/LC_MESSAGES
3.5M    /usr/share/locale/nb/LC_MESSAGES
132K    /usr/share/locale/nb_NO/LC_MESSAGES

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-11 10:05:45 -05:00
Dan McGee
f9c70d3140 translations: rename Swedish translation from sv_SE to sv
This puts us more in line with other projects that don't attach the country
code to the language code.

$ du -sh /usr/share/locale/sv*/LC_MESSAGES
7.2M    /usr/share/locale/sv/LC_MESSAGES
60K     /usr/share/locale/sv_SE/LC_MESSAGES

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-11 09:57:12 -05:00
Christos Nouskas
d978039cf0 Revise Greek translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-09 15:16:59 -05:00
Dan McGee
8163beb622 Update English (British) translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 20:17:14 -05:00
Matthias Gorissen
b00d911331 Update German translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 15:08:43 -05:00
Sergey Tereschenko
982018bf74 Update Russian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 12:24:48 -05:00
Dan McGee
93def410b8 Add note about XySSL/PolarSSL name change
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 10:35:08 -05:00
Baurzhan Muftakhidinov
9a56830164 Update Kazakh translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-07 09:30:39 -05:00