summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Add cachedirs one-by-one in set_cachedirs()Dan McGee2011-06-07
| | | | | | | This addresses the issue where calling set_cachedirs() didn't canonicalize the passed-in paths. Signed-off-by: Dan McGee <dan@archlinux.org>
* Be consistent with memory treatment for plural option settersDan McGee2011-06-07
| | | | | | | In all cases we should duplicate the passed-in list so the caller is free to do with it as it pleases. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add helper methods for setting directory optionsDan McGee2011-06-07
| | | | | | | This keeps duplicate code to a minimum. This will come in more handy as we refactor some of these option setters away. Signed-off-by: Dan McGee <dan@archlinux.org>
* Use standard errno codes in return from _alpm_archive_fgetsDan McGee2011-06-03
| | | | | | | | | | | | | This allows us to not require the context (e.g. handle) when calling this function. Also beef up the checks in the two callers of this function to bail if the last return code is not ARCHIVE_EOF, which is the expected value. This requires a change to one of the pactest return codes and the overall result of the test, but results in a much safer operating condition whereby invalid database entries will stop the operation. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove global handle dependencies from sync/upgrade pathsDan McGee2011-06-03
| | | | | | | | | This kills a lot more global handle business off. sync.c still requires the handle declaration for one reference that can't be changed yet; it will be removed in a future patch which isolates all of the necesary API changes. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove global handle from remove.cDan McGee2011-06-03
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove global handle from some package and db codeDan McGee2011-06-03
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove global handle from diskspace.cDan McGee2011-06-03
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove global handle from util.cDan McGee2011-06-03
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Push down extern handle variable to files that need itDan McGee2011-06-03
| | | | | | | This will make the patching process less invasive as we start to remove this variable from all source files. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add handle attribute to pmpkg_t structDan McGee2011-06-03
| | | | | | | Similar to what we just did for the database; this will make it easy to always know what handle a given package originated from. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add handle attribute to pmdb_t structDan McGee2011-06-03
| | | | | | | | This is the first step in a long process to remove our dependence on the global handle variable we currently share in libalpm, with the goal to make things a bit more thread-safe and re-entrant. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unnecessary handle != NULL assertsDan McGee2011-06-03
| | | | | | | These are simple accessor functions for a struct; the handle never even comes into play when calling these functions. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove ALPM_LOG_FUNC macroDan McGee2011-06-03
| | | | | | | | | The usefulness of this is rather limited due to it not being compiled into production builds. When you do choose to see the output, it is often overwhelming and not helpful. The best bet is to use a debugger and/or well-placed fprintf() statements. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-06-02
|\ | | | | | | | | Conflicts: src/pacman/callback.c
| * 3.5.3 release preparationDan McGee2011-06-02
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * repo-add: anchor exclusion pattern when generating filelistDan McGee2011-06-02
| | | | | | | | | | | | | | | | | | Fixes FS#24534. Dotfiles, such as /etc/skel/.bash_profile, were not being included in generated files entries. bsdtar --exclude option supports anchors on the pattern, so using "^.*" instead of ".*" solves our problem and still excludes all root-level dotfiles (e.g. .PKGINFO). Signed-off-by: Dan McGee <dan@archlinux.org>
| * Ensure list_display works on outputs of unknown widthDan McGee2011-06-01
| | | | | | | | | | | | | | | | | | | | | | | | If getcols() returns 0, we were getting stuck before in a loop of no return. Teach getcols() to take a default value to return if the width is unknown, and use this everywhere as appropriate. Also make a few other cleanups while diagnosing this issue, such as const-ifying some variables. Noticed-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Show net upgrade size on -U/-S operationsDan McGee2011-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If it is different than the raw installed size metric we already show, compute the net upgrade size. For some sync operations, this can even be negative if newer packages are smaller than the ones they replace locally. Implements FS#12566. Example: Targets (1): telepathy-glib-0.14.7-1 Total Download Size: 1.07 MiB Total Installed Size: 15.72 MiB Net Upgrade Size: -0.29 MiB Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add two currently failing test cases from bug reportsDan McGee2011-06-02
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | lib/dload.c: remove assumption in continuation logicDave Reisner2011-06-01
| | | | | | | | | | | | | | | | Callers to curl_download_internal now tell us if its okay to continue a transfer, so obey this instead of using a heuristic. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | dload: abort transfer on CURLOPT_LOW_SPEED_LIMITDave Reisner2011-06-01
| | | | | | | | | | | | | | | | | | | | If a connection drops below 1kb/s for 10s, curl will kill the transfer and we'll report failure. This is the average transfer speed over the delta defined by CURLOPT_LOW_SPEED_TIME, so setting a low value here shouldn't bother folks using 14.4k dial-up. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | doc: monospace attribute escape fixesDan McGee2011-06-01
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | pacman-key: print default gpgdir in usagePang Yan Han2011-06-01
| | | | | | | | | | Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-06-01
|\|
| * doc: fix attribute substitution in monospaced textDan McGee2011-06-01
| | | | | | | | | | | | | | | | When I switched all paths to use `` formatting, I didn't realize substitution didn't work in these quote marks. Use ++ instead to ensure attributes are substituted where appropriate. Signed-off-by: Dan McGee <dan@archlinux.org>
| * doc: update Makefile for new asciidoc resource locationDan McGee2011-06-01
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * doc: add a few more escapes and fix usage of {}Dan McGee2011-06-01
| | | | | | | | | | | | | | | | These addditional attributes come from the git asciidoc.conf file. Also, fix a place where we used {treename} without escaping the braces, causing the generated manpage to be missing text. Signed-off-by: Dan McGee <dan@archlinux.org>
| * alpm_list: fix typo in doxygen commentPang Yan Han2011-05-24
| | | | | | | | | | Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Bail early if we don't have a valid lockfile pathDan McGee2011-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses FS#24292. If one does the bad thing of not checking pm_errno after calling set_dbpath(), you may not realize the initialization process went wrong and calling trans_init() resulted in a segfault. If we don't have a lockfile path, bail out and have trans_init() fail. Also remove a ALPM_LOG_FUNC call that was causing pm_errno to return "no handle"; this was due to a log call in the handle setup (whereby the log attempts to use a callback attached to the handle). Signed-off-by: Dan McGee <dan@archlinux.org>
* | Update pacman manpage and pacman.conf for gpgdirPang Yan Han2011-06-01
| | | | | | | | | | | | | | | | | | pacman.8.txt --gpgdir section is updated based on the pacman.conf manpage pacman.conf is updated to include the default GPGDir Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Let pacman -v print GPG DirPang Yan Han2011-06-01
| | | | | | | | | | | | Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-05-19
|\| | | | | | | | | | | Conflicts: lib/libalpm/trans.c src/pacman/query.c
| * Coding style cleanups; add a null checkDan McGee2011-05-19
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Ensure --print doesn't enable --noconfirm when not expectedDan McGee2011-05-16
| | | | | | | | | | | | | | | | This is at best a hack around the way we currently do our --print magic, but at least prevents someone from shooting themselves in the foot as indicated in FS#24287. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Fix segfault when uninstalling broken backed-up symlinkDan McGee2011-05-16
| | | | | | | | | | | | | | | | | | Issue FS#24230. If a symlink is broken and included in the removal process of a package, we blew up and segfaulted due to alpm_compute_md5sum() returning NULL and then performing a strcmp() operation. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Add test for FS#24230, dead backup symlink removalDan McGee2011-05-16
| | | | | | | | | | | | This currently causes a segfault, which is bad news. Signed-off-by: Dan McGee <dan@archlinux.org>
| * pactest: treat symlinks with more respectDan McGee2011-05-16
| | | | | | | | | | | | | | | | Don't call os.stat() when we should be using os.lstat(); this allows us to actually test dead symlinks that don't have a corresponding file. Add a new LINK_EXIST rule that complements FILE_EXIST for a similar purpose. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Transifex updatesDan McGee2011-05-16
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * trans.c: create transaction prior to checking DB versionDave Reisner2011-05-16
| | | | | | | | | | | | | | | | | | | | | | The addition of the DB version check introduces a lag time between the lockfile creation and the transaction initialization. In cases where the local DB is large enough and/or the user's disk is slow enough, this time is significant enough that its possible for a user to send a SIGINT and leave behind a db.lck file. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Don't balk on .sig files being invalid in package cacheDan McGee2011-05-10
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove sync DB reregister checkDan McGee2011-05-05
| | | | | | | | | | | | | | It's your own damn fault if you do this, and this code is remnants from an old time when we weren't very good at coding. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Rework config parsing to reduce variable duplicationDan McGee2011-05-05
| | | | | | | | | | | | | | | | This removes the need to strdup() the section name at every decent into an Include statement, as well as having duplicate DB pointers around that are never used independently. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Refactor VerifySig option value parsing into standalone methodDan McGee2011-05-05
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-05-05
|\|
| * Ensure populate error return codes are consistentDan McGee2011-05-05
| | | | | | | | | | | | | | It must be -1 to differentiate it from a number of packages loaded count. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Don't null-check handle lists before settingDan McGee2011-05-05
| | | | | | | | | | | | | | This needlessly prevents the easiest way available of clearing any of these values. We can also do the same for the 'arch' value. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Improve database server APIDan McGee2011-05-05
| | | | | | | | | | | | | | | | | | Currently we have one call that has all sorts of crazy behavior and doesn't make a whole lot of sense. Go from one method to the normal four methods we have for all of our other lists we use in the library to make it a lot easier for a frontend to manipulate server lists. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Logging changes during DB loadDan McGee2011-05-05
| | | | | | | | | | | | | | | | The switch from FUNCTION to DEBUG was ill-advised inside the local database load. Instead, add a DEBUG level logger to both local and sync database loads that shows the number of packages processed. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make config parsing a two-part affairDan McGee2011-05-05
| | | | | | | | | | | | | | | | | | | | | | | | This ensures we call any alpm_option type functions before registering databases, making sure all paths and other defaults (e.g. sig verification levels) have been set first. This will ensure we can continue to allow crazy config files where [options] doesn't come first. The diffstat on this commit is misleading; view with -w/--ignore-all-space to get a better idea of what needed to be touched. Signed-off-by: Dan McGee <dan@archlinux.org>