summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* libalpm: Set ret correctly in download_internal()Lukas Fleischer2011-07-25
| | | | | | | | | Immediately jump to the cleanup code after setting the return code to -1 in case rename() fails. Otherwise, it will be reset to 0 right after we leave the if branch. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
* Ensure a file can be replaced by a directoryDan McGee2011-06-27
| | | | | | | | | | | | This addresses FS#24904. In a normal upgrade case, this replacement seems to work just fine. However, when doing a sync "replace" type upgrade, we weren't properly handling this edge case due to path comparison not ignoring trailing slashes. Fix this by pruning any trailing slashes past a certain point of file conflict resolution where we no longer need them, which allows us to safely detect cases such as now tested in the new pactest. Signed-off-by: Dan McGee <dan@archlinux.org>
* File conflict code cleanupsDan McGee2011-06-27
| | | | | | | | While researching the root cause of FS#24904, I couldn't help but clean up some of the cruft in here. A few whitespace/line-wrapping issues, but also fix shadowed variables and add some const where applicable. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove incorrect output when downloading onlyAllan McRae2011-06-07
| | | | | | | | | | | | | When only downloading a package, pacman can produce some incorrect output. > pacman -Sddw nvidia-utils warning: nvidia-utils-270.41.19-1 is up to date -- reinstalling This line is now now silenced when using -Sw. Signed-off-by: Allan McRae <allan@archlinux.org> 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>
* 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>
* 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>
* 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>
* 3.5.2 translation updates from TransifexDan McGee2011-04-18
| | | | | | And also a POT version and package version update. Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm.h: fix typos in documentationRémy Oudompheng2011-04-13
| | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
* Remove Korean language translation filesDan McGee2011-04-12
| | | | | | | There is no actual translation done here yet, just a dormant Transifex language with nothing checked in. Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm.h: document transaction flagsRémy Oudompheng2011-04-09
| | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
* More documentation for option getters/setters.Rémy Oudompheng2011-04-09
|
* alpm.h: more documentation for pkgreason, depend and errno.Rémy Oudompheng2011-04-09
|
* Move documentation for public package function to alpm.hRémy Oudompheng2011-04-09
|
* alpm.h: organize doxygen documentation in groupsRémy Oudompheng2011-04-09
|
* Move documentation of public database functions to alpm.hRémy Oudompheng2011-04-09
|
* alpm.h: add documentation for package property accessorsRémy Oudompheng2011-04-09
|
* Move documentation of public transaction functions to alpm.hRémy Oudompheng2011-04-09
|
* Fix broken documentation for alpm_trans_prepare()Rémy Oudompheng2011-04-09
| | | | | | | The current state of the code does not allow to see immediately that it returns a list of pmdepmissing_t structures. Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm: set pm_errno correctly in alpm_trans_get_flags()Rémy Oudompheng2011-04-09
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* diskspace: add the actually used statfs type in ifdefsRémy Oudompheng2011-04-06
| | | | | | | | | | Some systems, like FreeBSD might define both statfs and statvfs: however if statvfs exists whereas getmntinfo() uses a statfs struct, the current ifdefs would select the wrong line of code. Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm/be_local.c: unused variable entXavier Chantry2011-04-04
| | | | | | spotted by clang analyzer Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* libalpm/pkghash.c: unused variable ptrXavier Chantry2011-04-04
| | | | | | spotted by clang analyzer Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
* db.c: set pm_errno appropriately in alpm_db_set_pkgreason()Rémy Oudompheng2011-04-04
| | | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* util.c: include limits.h for PATH_MAX macroRémy Oudompheng2011-04-02
| | | | | Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix compatibility with older versions of libarchive.Rémy Oudompheng2011-04-02
| | | | | | | | | There is no reason to not support versions of libarchive that lack ARCHIVE_COMPRESSION_UU. Distributions should work properly without this. Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add default changelog functions to pkg_operationsDan McGee2011-04-01
| | | | | | | | So we don't segfault when calling this on be_sync loaded packages. They return logical values as much as possible for indicating there is no changelog available. Signed-off-by: Dan McGee <dan@archlinux.org>
* Ensure dbpath is not null when populating sync databaseDan McGee2011-04-01
| | | | | | | | | | | | | | | | | | | | | | We didn't do this sanity check before trying to open an archive. If the alpm dbpath wasn't set, the sync database dbpath would be NULL, causing us to hang indefinitely in archive_read_open_filename() rather than erroring out. We already have a corresponding check in local_db_populate(). The following program will test this case, and hangs before this patch without the call to set_dbpath: int main(int argc, char *argv[]) { alpm_initialize(); // alpm_option_set_dbpath("/var/lib/pacman/"); pmdb_t *core = alpm_db_register_sync("core"); pmpkg_t *pkg = alpm_db_get_pkg(core, "pacman"); return 0; } Signed-off-by: Dan McGee <dan@archlinux.org>
* Ignore upcoming new values in sync backendDan McGee2011-04-01
| | | | | | | PGPSIG and SHA256SUM are new and we can safely ignore them for now if we come across them. Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm/handle.c: ensure handle is not NULL before proceedingRémy Oudompheng2011-03-29
| | | | | | | | | Many alpm_option_get/set_*() functions already check this and set pm_errno to the right value, but not all, so this improves consistency. Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix an outdated commentDan McGee2011-03-29
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Ensure reported missing dependencies show correct version comparisonDan McGee2011-03-25
| | | | | | | | | | | | This addresses FS#23424. The -dd backend code was introduced in commit b6ec9019d77, and unfortunately the munged depend used for comparison did not carry through to the eventual display of this version. To fix this, we undo some of the depcmp_tolerant() business introduced, and instead make a new pmdepend_t object if necessary when the no dependency version flag is set. This results in the correct depend being copied to the missing depend passed onto the frontend. Signed-off-by: Dan McGee <dan@archlinux.org>
* Mark various functions in deps.c staticDan McGee2011-03-25
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Move alpm_find_dbs_satisfier() function down in deps.cDan McGee2011-03-25
| | | | | | | This will make sense for a later commit when static/non-static properties of other functions are changed. Signed-off-by: Dan McGee <dan@archlinux.org>
* Rework find_requiredby() to not use _alpm_dep_edge()Dan McGee2011-03-25
| | | | | | | And move the sort after the final loop; we don't need to sort once for each database we look at. Signed-off-by: Dan McGee <dan@archlinux.org>
* Don't include version in dep string if mod == ANYDan McGee2011-03-25
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm/db: do not close local DB in alpm_db_unregister_allDave Reisner2011-03-24
| | | | | | | | | pacman 3.5.0 removed alpm_db_register_local, so calling alpm_db_unregister_all leaves the front end in a position where there's no local db, and no way to re-register it. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Updated 3.5.1 translations from TransifexDan McGee2011-03-23
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add new Serbian translation from TransifexSlobodan Terzić2011-03-23
| | | | | | Thanks! Signed-off-by: Dan McGee <dan@archlinux.org>
* Minor code cleanupsDan McGee2011-03-21
| | | | | | | Wrap lines of long length, noticed while creating and messing around with some of the other maint branch patches. Signed-off-by: Dan McGee <dan@archlinux.org>
* Ensure package removal list does not contain duplicatesDan McGee2011-03-21
| | | | | | | | | Noticed with the openoffice/libreoffice replacement scheme where many packages are listed as replacements to one package, thus electing it for removal multiple times. Ensure a given package is not already present before placing it in the removal list. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix line_offset not being reset in _alpm_archive_fgets()Dan McGee2011-03-21
| | | | | | | | | | This is a rather serious data corruption issue that luckily manifested itself today in a noticable way. A package in testing had replaces entries read in as ["%RE pkgname", "%RE"] which was clearly wrong. This happens when we hit the end of an archive block, do not have a newline, and have to continue reading from the next block to complete the line. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update source translation files in prep for 3.5.1Dan McGee2011-03-20
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix comparison to 0 rather than NULLDan McGee2011-03-20
| | | | | | Another fix found by Coccinelle example semantic patches. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix assignment before NULL checkDan McGee2011-03-20
| | | | | | Easy fix, found using null_ref.cocci example Coccinelle script. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add missing include for size_tDan McGee2011-03-20
| | | | | | Needed for things like our strndup() substitute function. Signed-off-by: Dan McGee <dan@archlinux.org>
* Use sane umask for repo db downloadsAllan McRae2011-03-20
| | | | | | | Fixes FS#23343. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Correctly parse %DELTAS% entries in sync DBtuxce2011-03-17
| | | | | | | 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>