Commit Graph

1321 Commits

Author SHA1 Message Date
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
Xavier Chantry 3012c0e091 Update French translation
Thanks to CalimeroTeknik <calimeroteknik@free.fr> for providing many
corrections !

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-06 16:42:01 -05:00
Christos Nouskas b79193a37e Update Greek translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-06 16:41:35 -05:00
Vojtěch Gondžala d58f398312 Update Czech translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 11:40:42 -05:00
Nagy Gabor c80e04a151 Update Hungarian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 11:34:31 -05:00
Giovanni Scafora a3b1585b7b Update Italian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 11:30:51 -05:00
甘露(Gan Lu) a66f8dbbb1 Update Chinese translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 11:27:45 -05:00
Samed Beyribey 10aba2fd53 Update Turkish translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-04 19:44:33 -05:00
Dan McGee f60db581a7 translation: update pot/po files for libalpm in prep for release
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-04 13:36:38 -05:00
Jonathan Conder 9ab6bfad22 fix memory leak in _alpm_sync_commit
Signed-off-by: Jonathan Conder <j@skurvy.no-ip.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-18 11:51:31 -05:00
Nagy Gabor eada558e12 Partial fix for the phonon/qt issue
This patch fixes the phonon/qt issue, if all to-be-upgraded packages are
explicit targets (ie. only not-yet-installed packages are pulled by
resolvedeps). This condition covers the most common situations, for example
it should hold with every -Su operation.

After this patch sync405.py passes, but sync406.py doesn't.

The work is inspired by the patch of Henning Garus, thanks for his work:
http://mailman.archlinux.org/pipermail/pacman-dev/2010-February/010429.html
(I moved the alpm_list_diff computation to sync.c in order to compute it
only once.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-18 11:33:00 -05:00
Nagy Gabor 25cd6c2e8d Fix a serious bug in the download code
After commit df99495b82 pacman downloaded files from the first repo only,
and reported corrupted packages for all files from other repos.

The download_size was set to 0 for _all_ transaction packages after
downloading some files from the first repo. This code-block was moved to its
correct place.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-14 15:03:21 -05:00