Commit Graph

1093 Commits

Author SHA1 Message Date
Dan McGee f8b689d48e Merge branch 'maint'
Conflicts:
	lib/libalpm/dload.c
	po/it.po
	scripts/makepkg.sh.in
2009-01-02 22:48:52 -06:00
Dan McGee cc7f3b705e Print proxy information when downloading
May help debug issues we come across with proxy behavior (e.g. those pesky
segfaults) as well as be informative to the user when things aren't working
quite right. Addresses FS#12396.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-12-10 19:45:15 -06:00
Dan McGee 61c6552862 Merge branch 'maint'
Conflicts:
	lib/libalpm/dload.c
2008-12-02 22:15:02 -06:00
Dan McGee b99bebc008 Add regex to delta code so we don't segfault when reading line
If the delta line doesn't match our regex, we won't go and process it,
possibly walking off the end of the string.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-11-30 17:17:00 -06:00
Dan McGee f7192b5958 Minor code cleanups
Mostly noticed when compiling libalpm/pacman with ICC.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-11-17 21:47:55 -06:00
Dan McGee 43f9eb1aa9 Set SIGPIPE handler to SIG_IGN when downloading
We don't want a failed write to kill our whole program when we are
downloading things, so set the SIGPIPE handler to ignore when downloading
and restore any previous signal handler when we complete the download.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-31 19:46:13 -05:00
Dan McGee 8d4e1e6754 Make libfetch the 'native' download library
Use libfetch naming in the code in place of libdownload names. This is in
preparation for dropping support for libdownload at some point as libfetch
can run on Linux.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-31 19:46:13 -05:00
Nagy Gabor 314b4462d2 -Qu rework
From now on -Qu is an "outdated package" filter on local database.
(This is a behaviour change.)

This patch fixes some memleaks and makes the code cleaner, for details see
my comment on FS#7884.

FS#11868 is implemented.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-31 19:46:13 -05:00
Dan McGee cd51abf0c8 Merge branch 'maint' 2008-10-28 22:20:09 -05:00
Lyman Li 2f5d792725 Update Chinese translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-28 22:06:34 -05:00
Dan McGee d1fec15d81 Correctly close the pipe used for scriptlet execution
We never had a call to pclose() in here before, leaving our file descriptor
in some sort of limbo state. In addition, clean up some of the other logic
such as directly calling exit(1) on a popen() failure rather than going to
our cleanup block, and handling and respecting the exit status of the
subprocess correctly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-18 23:59:28 -05:00
Sergey Tereschenko d24592cbcd Minor updates to Russian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-12 23:19:07 -05:00
Dan McGee fa02a71abd Merge branch 'maint' 2008-10-12 21:36:45 -05:00
Dan McGee f0e1846b51 Remove unnecessary unistd.h header inclusion
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-12 21:30:15 -05:00
Dan McGee f9be2334f7 libalpm: handle syscall interruption correctly
It is possible to throw EINTR from a system call such as open(), close(), or
waitpid() if custom signal handlers are set up and they are not initialized
with the SA_RESTART flag. This was noticed by Andreas Radke when ^C (SIGINT)
was given during the call to waitpid(), causing it to throw the EINTR error
and we could not accommodate it.

Simply wrap these calls in a simple loop that allows us to retry the call if
interrupted.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-12 21:28:05 -05:00
Dan McGee da933c223e Remove unnecessary initialization in new functions
We don't need to zero things out, we are already using calloc for this
purpose.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-09-03 09:36:31 -05:00
Dan McGee 1c47500ea6 Merge branch 'maint' 2008-08-26 20:11:25 -05:00
Roman Kyrylych afac773d19 New Ukrainian translation
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-26 20:00:10 -05:00
Xavier Chantry d05882db9e Rename alpm_db_get{pkg,grp}cache to alpm_db_get_{pkg,grp}cache
This is more consistent with the private functions :
_alpm_db_get_{pkg,grp}cache

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-25 18:10:03 -05:00
Xavier Chantry 0701356260 Change checkdeps and checkdbconflicts to be more flexible.
These two functions now take directly a package list rather than a database.

checkdbconflicts was renamed to checkconflicts.

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

* Finally, delete all unused translations.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-25 17:54:22 -05:00
Hugo Doria 81853893a5 Update Portuguese (Brazil) translation
Xav : alignment fixes
2008-08-25 19:55:45 +02:00
Samed Beyribey eeb3c6868c Update Turkish translation 2008-08-25 19:36:01 +02:00
甘露(Lu.Gan) cfc52dad98 Update Chinese Simplified translation 2008-08-25 08:34:16 +02:00
Vojtěch Gondžala 49c58ce9db Update Czech translation 2008-08-24 14:10:17 +02:00
Matthias Gorissen 08b0fb856d Update German translation 2008-08-24 14:10:16 +02:00
Sergey Tereschenko 6f38cedd8d Update Russian translation
[Xav: one minor fix to libalpm po file]
2008-08-24 02:04:39 +02:00
Dan McGee a4100b3847 Merge branch 'maint' 2008-08-23 18:28:58 -05:00
Xavier Chantry 68e59ecbaf Update British English translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-08-23 23:38:40 +02:00
Xavier Chantry 91eeee08de Update French translation
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-08-23 23:36:12 +02:00
Nagy Gabor 05d23059fd Update Hungarian translation 2008-08-23 23:36:12 +02:00
Juan Pablo González Tognarelli f56d763547 Update Spanish translation
Xav : one minor fix (a missing %s in the downgrading message).
2008-08-23 23:35:21 +02:00
Mateusz Herych 8f99f75e6e Update Polish translation 2008-08-23 23:15:55 +02:00
Giovanni Scafora 4b4ad18348 Update Italian translation 2008-08-23 23:13:12 +02:00
Dan McGee b0b5dabf1b Update translation files for pending 3.2.1 release
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 11:21:28 -05:00
Nagy Gabor baf5852555 Move -Sp implementation to the front-end
This patch kills one of our hackish pseudo transactions: PRINTURIS.
(The other one is -Sw)

From now on, front-end must not call trans_commit in case of -Sp,
it should print the uris of target packages "by hand" instead.

PRINTURIS flag was removed, NOCONFLICTS flag can be passed to skip
conflict checks.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 09:50:40 -05:00
Nagy Gabor 8146f6f1c6 New public alpm_pkg_get_db function
This function returns with the origin database of a package.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 09:44:47 -05:00
Nagy Gabor 3ff7701e89 Pass the old package with PM_TRANS_EVT_UPGRADE_START
This is more rational and coherent with PM_TRANS_EVT_UPGRADE_DONE.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 09:20:32 -05:00
Xavier Chantry 5b51dbb11e Cleanup of _alpm_pkg_compare_versions.
* Change the return values to be more informative.

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

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

* Remove the verbose output from _alpm_pkg_compare_versions.

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

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

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

* Add a new alpm_pkg_has_force function

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

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

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

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

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-19 18:42:51 -05:00
Dan McGee d8f8a12665 Fix segfault on x86_64 when using UseSyslog
Due to differences in handling va_list between i686 and x86_64, this bug
can only be seen on x86_64. va_list usage is not allowed but we had been
getting away with it. See
http://lists.opensuse.org/opensuse-programming/2008-02/msg00005.html
for details and explanation.

This fixes FS#11096.

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

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

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

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

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

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

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

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-05 09:58:52 -05:00
Xavier Chantry 115dcf0911 Final update of all translations.
Two recent commits slightly broke the translations, so this fixes all of
them.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-30 07:24:32 -05:00
Giovanni Scafora 20a0b8e201 Small fix to Italian translation
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-25 07:14:55 -05:00
Xavier Chantry b8e306b73e Implement AND based package searching.
This fixes FS#2334.

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

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

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-24 22:16:28 -05:00