summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2011-03-21Merge branch 'maint'Dan McGee
Conflicts due to change in return calling style. Conflicts: src/pacman/pacman.c src/pacman/sync.c
2011-03-21Don't initialize progress to zero before calling curl_easy_perform().Lukas Fleischer
Drawing progress bars before calling curl_easy_perform() is needless as the curl progress callback is called with zero progress before actually downloading the file anyways. Fixes display of "0%" progress bars when sync'ing package databases that are already up to date. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21Ensure dlcb is defined before calling itDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Update source translation files in prep for 3.5.1Dan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Fix comparison to 0 rather than NULLDan McGee
Another fix found by Coccinelle example semantic patches. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Fix assignment before NULL checkDan McGee
Easy fix, found using null_ref.cocci example Coccinelle script. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Style change: return(x) --> return xDan McGee
This was discussed and more or less agreed upon on the mailing list. A huge checkin, but if we just do it and let people adjust the pain will end soon enough. Rebasing should be relatively straighforward for anyone that sees conflicts; just be sure you use the new return style if possible. The following semantic patch was used to do the change, along with some hand-massaging in order to preserve parenthesis where appropriate: The semantic match that finds this problem is as follows, although some hand-massaging was done in order to keep parenthesis where appropriate: (http://coccinelle.lip6.fr/) // <smpl> @@ expression a; @@ - return(a); + return a; // </smpl> A macros_file was also provided with the following content: Additional steps taken, mainly for ASSERT() macros: $ sed -i -e 's#return(NULL)#return NULL#' lib/libalpm/*.c $ sed -i -e 's#return(-1)#return -1#' lib/libalpm/*.c Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20lib/dload.c: fix opening braces to conform with coding styleDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Merge branch 'maint'Dan McGee
2011-03-20Add missing include for size_tDan McGee
Needed for things like our strndup() substitute function. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20lib/dload.c: remove lingering libfetch specific headersDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Use sane umask for repo db downloadsAllan McRae
Fixes FS#23343. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17Correctly parse %DELTAS% entries in sync DBtuxce
We erroniously dropped the call to _alpm_delta_parse() when macro-izing, causing segfaults for repos that provide deltas. Addresses FS#23314. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17Fix triple progress bars on downloadDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17Ensure we have a root partition when checking spaceDan McGee
Partially addresses the "why doesn't CheckSpace work in a chroot" issue. We can't make it work, but we can at least detect when it won't work by checking for a partition for our given installation root. If we can't determine the mountpoint for this, bail out with an error. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16Merge branch 'maint'Dan McGee
2011-03-16alpm_list: fix typo in doxygen commentDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16Update translations for message with added newlineDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16Add missing newline to warning messageAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16Merge branch 'download'Dan McGee
2011-03-16Updated translations for 3.5.0 from TransifexDan McGee
Thanks to all translators that contributed! Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-09Remove all traces of libfetchDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-03-09dload: temp patch to allow curl/fetch coexistanceDave Reisner
this is just some debuggery to allow pacman to operate with both fetch and curl at the same time. use the PACMANDL variable to control which library is used. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-03-09dload.c: add curl_download_internalDave Reisner
This is a feature complete re-implementation of the fetch based internal downloader, with a few improvements: * support for SSL * gzip and deflate compression on HTTP connections * reuses a single connection over the entire session for lower resource usage. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-03-09handle error case for PM_ERR_LIBCURLDave Reisner
Add PM_ERR_LIBCURL to error enum and handle case in error.c by returning curl_easy_strerror() based on the error number carried by the gloabl alpm handle. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-03-09share code between libfetch and libcurlDave Reisner
no actual code changes here. change preprocessor logic to include get_tempfile, get_destfile, signal handler enum, and the interrupt handler logic when either HAVE_LIBCURL or HAVE_LIBFETCH are defined. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-03-09prefix fetch based functions with fetch_Dave Reisner
Do this in preparation for implementing similar curl based functionality. We want the ability to test these side by side. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-03-09handle: Add CURL* and CURLcode vars to structDave Reisner
Adding the CURLcode is necessary in order to return an error string from pm_error. Unlike libfetch, curl returns numerical error numbers and does not maintain a staticly allocated string with the last error generated. Adding the curl object itself to the handle is advantageous (and encouraged by curl_easy_perform(3)) because the handle is reusable for successive operations. This cuts back on overhead when downloading multiple files in a single transaction. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-03-09add curl to alpm initialization and teardown routinesDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-03-07Do not print warning with files entry in sync dbAllan McRae
repo-add can add a "files" entry into the sync db. Currently we do nothing with this file, so explicitly skip it to prevent unknown database file warnings. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-03Fix gettext plural detectionDan McGee
Our keywords were all screwed up in this regard. Fix it so our ngettext() shortcut calls are actually recognized and respected. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-01libalpm/diskspace.c: remove bogus parenthesisXavier Chantry
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-01Ensure d_type is not DT_UNKNOWN before relying on itDan McGee
Fixes FS#23090, a rather serious problem where the user was completely unable to read the local database. Even if entry->d_type is available, the given filesystem providing it may not fill the contents, in which case we should fall back to a stat() as we did before. In this case, the filesystem was XFS but there may be others. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-28Fix some easy to find double translationsDan McGee
A lot of these were places that should have used the same message but didn't, or were very easy to convert to using the same message and letting some of the burden off of the translators. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-28Update translation template filesDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-28Check local DB version before continuing transactionDan McGee
Ensure we have a local DB version that is up to par with what we expect before we go down any road that might modify it. This should prevent stupid mistakes with the 3.5.X upgrade and people not running pacman-db-upgrade after the transaction as they will need to. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-28Move locking functions to where they are neededDan McGee
We only call these from the transaction init and teardown, so move them to that file, mark them static, and push more of the logic of handle manipulation into these functions. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-28Fix trans no-argument function definitionsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-27Fix double close of the lock fileJonathan Conder
According to FOPEN(3), using fclose on an fdopen'd file stream also closes the underlying file descriptor. This happened in _alpm_lckmk (util.c), which meant that when alpm_trans_release closed it again, the log file (which reused the original file descriptor) was closed instead. Signed-off-by: Jonathan Conder <jonno.conder@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-25alpm: alpm_db_get_pkgcache_list => alpm_db_get_pkgcacheDave Reisner
This avoids needless breakage of the public API. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-25alpm: remove public visibility of pmpkghash_tDave Reisner
There's no API functions exposed which allow manipulation of this type, so remove it from public view. Also, rename the public and private alpm_db_get_pkgcache symbol to alpm_db_get_pkgcache_has. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-25Continue resolving dependencies rather than bailing on first errorDan McGee
This allows error messages emitted by the frontend to be a bit more descriptive and not have the annoying "well why didn't you tell me that the first time" problem. If a package had multiple missing deps, we would bail on the first one before rather than finish processing all missing dependencies, and only print one error message. Instead, continue through this entire set of missing deps and append all eventual errors. The added pactest tests this case, as the to be installed package has two missing dependencies. However, pactest does not actually test or see the difference in output from before and after, so it passes in both cases, but it is clearly visible in the logs. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-25Various small spelling fixes and small tweaksDan McGee
Nothing that changes behavior here. Spelling fixes and pushing a variable down to the scope it is used. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-24Mark log callback format string constDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-22Remove trans->skip_addDan McGee
This is old code that has since gone stale; we no longer ever add anything to this list so no need to keep it around and check the contents during extraction. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-16Don't generate filelist unless we are going to use itDan McGee
We throw it away if !full, so no need to waste time creating the list in the first place. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-16Conflict checking code cleanupDan McGee
* Make conflict_isin() static; it is used nowhere else. * Remove does_conflict(): it turns out to be replaceable by a single call to _alpm_depcmp(). By pushing it up, we can reduce calls to _alpm_splitdep() from 60,368 to 16,940 during one test -Su operation I ran. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-15Fix some database size estimation problemsDan McGee
* Use stat() and not lstat(); we don't care for the size of the symlink if it is one, we want the size of the reference file. * FS#22896, fix local database estimation on platforms that don't abide by the nlink assumption for number of children. * Fix a missing newline on an error message. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-15Use CALLOC for _alpm_graph_new()Pang Yan Han
Change _alpm_graph_new() to use CALLOC to avoid explicit zeroing out of fields in pmgraph_t. Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-11diskspace: allow used flag to be toggled for both remove and installDan McGee
Turn it into an enum rather than a boolean, and use a bitmask like we do for reading DB entries. The relevant flag is turned on in our two calculate loops, and anything reading the used flag later can decided which flag (or either) is relevant. This will allow the read-only partition code to be triggered on a remove-only operation, e.g. if /boot was read-only and one tried to remove grub in a sync transaction. Of course, right now, we don't actually run the diskspace check code in the '-R' codepath. Signed-off-by: Dan McGee <dan@archlinux.org>