summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* New public alpm_pkg_get_db functionNagy Gabor2008-08-23
| | | | | | | 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>
* Pass the old package with PM_TRANS_EVT_UPGRADE_STARTNagy Gabor2008-08-23
| | | | | | | 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>
* Cleanup of _alpm_pkg_compare_versions.Xavier Chantry2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Remove an usused variable from alpm/util.c/_alpm_lckmk()Nagy Gabor2008-08-19
| | | | | | | | | | | 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>
* libalpm/add.c : ensure the old pkg was fully loaded.Xavier Chantry2008-08-19
| | | | | | | This fixes FS#11218. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix segfault on x86_64 when using UseSyslogDan McGee2008-08-08
| | | | | | | | | | | | 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>
* Fix variable naming issues in _alpm_db_cmpDan McGee2008-08-08
| | | | | | | | | 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>
* Avoid double slashes in URLs given to libdownload.Xavier Chantry2008-08-05
| | | | | | | | | | | | | | | | 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>
* dload.c : drop the specific handling of file: url.Xavier Chantry2008-08-05
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Final update of all translations.Xavier Chantry2008-07-30
| | | | | | | | 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>
* Small fix to Italian translationGiovanni Scafora2008-07-25
| | | | | Signed-off-by: Giovanni Scafora <linuxmania@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Implement AND based package searching.Xavier Chantry2008-07-24
| | | | | | | | 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>
* Remove unused strverscmp substituteDan McGee2008-07-24
| | | | | | | 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>
* libalpm/package.c : fix infolevel bug in pkg_dupXavier Chantry2008-07-24
| | | | | | | | | | 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>
* Fix vercmp and add additional testsDan McGee2008-07-24
| | | | | | | | | | | | | | | | | | | | | | This vercmp issue has been a sticking point but this should resolve many of the issues that have come up. Only a few minor code changes were necessary to get the behavior we desired, and this version appears to beat any other vercmp rendition on a few more cases added in this commit. This commit passes all 58 vercmp tests currently out there. Other 'fixes' still fail on a few tests, namely these ones: test: ver1: 1.5.a ver2: 1.5 ret: -1 expected: 1 ==> FAILURE test: ver1: 1.5 ver2: 1.5.a ret: 1 expected: -1 ==> FAILURE test: ver1: 1.5-1 ver2: 1.5.b ret: 1 expected: -1 ==> FAILURE test: ver1: 1.5.b ver2: 1.5-1 ret: -1 expected: 1 ==> FAILURE 4 of 58 tests failed Signed-off-by: Dan McGee <dan@archlinux.org>
* Update Portuguese (Brazil) translationHugo Doria2008-07-22
| | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* Update Polish translationMateusz Herych2008-07-22
| | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* Update Russian translationSergey Tereschenko2008-07-22
| | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* Update Czech translationVojtěch Gondžala2008-07-22
| | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* Update British English translationJeff Bailes2008-07-22
| | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* Update Turkish translationSamed Beyribey2008-07-22
| | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* Update Chinese Simplified translation甘露(Lu.Gan)2008-07-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update Hungarian translationNagy Gabor2008-07-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update Spanish translationJuan Pablo González Tognarelli2008-07-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update Italian translationGiovanni Scafora2008-07-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update German translationMatthias Gorissen2008-07-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update French translationXavier Chantry2008-07-22
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Update pot files.Xavier Chantry2008-07-22
| | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* Rephrase some debug messages in alpm/sync.cNagy Gabor2008-07-19
| | | | | | | | | | | Debug messages were removed from _alpm_sync_find, because it is a general purpose function; debug messages should be placed in the caller function. I inserted "adding package foo-1.0-1 to the transaction targets" debug message to find_replacements and sync_sysupgrade. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Use NULL instead of "" as no causingpkgNagy Gabor2008-07-19
| | | | | | | Our STRDUP macro (used in _alpm_depmiss_new) is NULL safe. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm_list_remove treat NULL needle as "nothing"Nagy Gabor2008-07-17
| | | | | | | | So if you want to remove NULL needle from a list, alpm_list_remove will return with "not found". Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix a possible segfault in alpm/remove.cNagy Gabor2008-07-17
| | | | | | | | Before removing a package from target list (in remove_prepare_keep_needed), we should check whether we have already removed it. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* _alpm_db_add_pkgincache reworkNagy Gabor2008-07-15
| | | | | | | | | | | | | | | | | | | | | Commit 8240da6cb3ff95ad480efe3e1876104024398fae broke some alpm hierarchy and introduced a new memleak (trans->packages was never freed in case of add transaction, even if the transaction wasn't committed), so it is reverted now. We follow a different approach to reduce memory usage: _alpm_db_add_pkgincache doesn't duplicate the whole package before adding it to the cache, only the package name and version (INFRQ_BASE). This method needs very small extra memory (compared to the reverted method), and after transaction commit we use less memory than before (since the big 'files' fields are not copied to cache), this is useful in GUIs. Note: The old add_pkgincache was a bit broken, since pkg->origin wasn't filled in correctly. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Acked-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix some memleaks in alpm/add.cNagy Gabor2008-07-15
| | | | | | | | In case of error some allocated memory wasn't freed in commit_single_pkg. Note: The return value of this function is not used. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix a wrong FREELIST usage in add.cNagy Gabor2008-07-15
| | | | | | | The dynamic pmconflict_t must be freed with _alpm_conflict_free. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* sync_addtarget reworkNagy Gabor2008-07-13
| | | | | | | | | | | | | | | | | | | | | | Now '-S provision' handling is done in the back-end. In case of multiple providers, the first one is selected (behavior change: deleted provision002.py). The old processing order was: literal, group, provision; the new one: literal, provision, group. This is more rational, but "pacman -S group" will be slower now. "pacman -S repo/provision" also works. Provision was generalized to dependencies, so you can resolve deps by hand: "pacman -S 'bash>2.0'" or "pacman -S 'core/bash>2.0'" etc. This can be useful in makepkg dependency resolving. The changes were documented in pacman manual. alpm_find_pkg_satisfiers and _alpm_find_dep_satisfiers functions were removed, since they are no longer needed. I added some verbosity to "select provider instead of literal" and "fallback to group". Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2008-07-07
|\
| * Fix a bogus message in Hungarian translationNagy Gabor2008-07-07
| | | | | | | | | | Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Resolvedeps reworkNagy Gabor2008-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I divided resolvedeps into 2 functions. The new _alpm_resolvedep function will resolve one dependency, for example the 'foo>=1.0-1' dependency. It can be useful in sync_addtarget refactoring. The resolvedeps parameters were changed, to be coherent with recursedeps: * the target-list is an alpm_list* instead of alpm_list**. This is OK, because alpm_list_add == alpm_list_add_last * syncpkg param was removed. list contains the to-be-installed packages, resolvedeps will add the required dependencies into this list * trans param was removed, it was used in QUESTION() only, which can be used on the main (handle->trans) transaction only (because the front-end cannot access our pseudo-transactions at all!). The patch fixes some wrong dynamic pmdepmissing_t usage. I did a behavior change (and sync1003.py was modified accordingly), which needs some explanation: The old resolvedeps didn't elect packages from 'remove' list. I've dropped this because I don't want that 2nd excluding list param. In fact, in real life, we ~never need this rule. Resolvedeps is called before checkconflicts, so only -Su's %REPLACES% packages are sitting in 'remove' list. This means, that we have the replacement packages in our target list. Usually "foo replaces bar" means, that bar isn't in our repos any more, so resolvedeps *cannot* elect it; but usually it won't try it at all, because foo is in the target list, and it is expected to satisfy 'bar>=1.0-1'-like dependencies too. Since checkdeps and checkconflicts is done after resolvedeps, this cannot cause any harm. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Swap parameters on PM_TRANS_CONV_INSTALL_IGNOREPKG callback functionNagy Gabor2008-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PM_TRANS_CONV_INSTALL_IGNOREPKG callback function can get 2 params: foo, bar in this order (packages), bar can be NULL. Old API: foo, NULL: Do you want to install foo from IgnorePkg? foo, bar: foo requires bar from IgnorePkg. Do you want to install bar? New API: foo, bar: Do you want to install foo from IgnorePkg? (If bar!=NULL:) bar requires it. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | New _alpm_find_dep_satisfier functionNagy Gabor2008-07-07
| | | | | | | | | | | | | | | | | | | | This function finds the first satisfier package in a pkglist. Using it instead of _alpm_find_dep_satisfiers eliminates some memleaks and it is faster. (_alpm_find_dep_satisfiers and _alpm_find_pkg_satisfiers will be removed soon.) Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | New _alpm_dep_edge functionNagy Gabor2008-07-07
| | | | | | | | | | | | | | | | The function is introduced to kill some code duplication. The function name uses the 'dependency graph' terminology. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Don't duplicate packages in requiredby listNagy Gabor2008-07-07
| | | | | | | | | | | | | | | | | | This is a "fix" for FS#10226. I think that multiple versioned dependencies are quite common now, and the old behavior is quite annoying there. This patch won't cause any slow-down. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-06-19
|\|
| * Add libalpm Türkçe (Turkish) translationAlper KANAT2008-06-19
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Use access() instead of stat() when possibleDan McGee2008-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using the stat() system call in quite a few places when we didn't actually need anything the stat struct returned- we were simply checking for file existence. access() will be more efficient in those cases. Before (strace pacman -Ss pacman): % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 33.16 0.005987 0 19016 stat64 After: % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 34.85 0.003863 0 12633 1 access 7.95 0.000881 0 6391 7 stat64 Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-06-12
|\|
| * Minor fix to German translationThomas Bächler2008-06-07
| | | | | | | | | | Signed-off-by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Spanish translation updatesJuan Pablo González Tognarelli2008-06-12
| | | | | | | | | | | | Fixes to old translations and new strings for upcoming 3.2 release. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Various updates needed prior to a new releaseDan McGee2008-06-08
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>