summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2011-06-27Ensure a file can be replaced by a directoryDan McGee
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>
2011-06-27File conflict code cleanupsDan McGee
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>
2011-06-07Remove incorrect output when downloading onlyAllan McRae
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>
2011-05-24alpm_list: fix typo in doxygen commentPang Yan Han
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-05-19Bail early if we don't have a valid lockfile pathDan McGee
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>
2011-05-16Fix segfault when uninstalling broken backed-up symlinkDan McGee
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>
2011-05-16trans.c: create transaction prior to checking DB versionDave Reisner
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>
2011-05-05Ensure populate error return codes are consistentDan McGee
It must be -1 to differentiate it from a number of packages loaded count. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-183.5.2 translation updates from TransifexDan McGee
And also a POT version and package version update. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-13alpm.h: fix typos in documentationRémy Oudompheng
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
2011-04-12Remove Korean language translation filesDan McGee
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>
2011-04-09alpm.h: document transaction flagsRémy Oudompheng
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
2011-04-09More documentation for option getters/setters.Rémy Oudompheng
2011-04-09alpm.h: more documentation for pkgreason, depend and errno.Rémy Oudompheng
2011-04-09Move documentation for public package function to alpm.hRémy Oudompheng
2011-04-09alpm.h: organize doxygen documentation in groupsRémy Oudompheng
2011-04-09Move documentation of public database functions to alpm.hRémy Oudompheng
2011-04-09alpm.h: add documentation for package property accessorsRémy Oudompheng
2011-04-09Move documentation of public transaction functions to alpm.hRémy Oudompheng
2011-04-09Fix broken documentation for alpm_trans_prepare()Rémy Oudompheng
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>
2011-04-09libalpm: set pm_errno correctly in alpm_trans_get_flags()Rémy Oudompheng
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-06diskspace: add the actually used statfs type in ifdefsRémy Oudompheng
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>
2011-04-04libalpm/be_local.c: unused variable entXavier Chantry
spotted by clang analyzer Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
2011-04-04libalpm/pkghash.c: unused variable ptrXavier Chantry
spotted by clang analyzer Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
2011-04-04db.c: set pm_errno appropriately in alpm_db_set_pkgreason()Rémy Oudompheng
Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-02util.c: include limits.h for PATH_MAX macroRémy Oudompheng
Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-02Fix compatibility with older versions of libarchive.Rémy Oudompheng
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>
2011-04-01Add default changelog functions to pkg_operationsDan McGee
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>
2011-04-01Ensure dbpath is not null when populating sync databaseDan McGee
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>
2011-04-01Ignore upcoming new values in sync backendDan McGee
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>
2011-03-29alpm/handle.c: ensure handle is not NULL before proceedingRémy Oudompheng
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>
2011-03-29Fix an outdated commentDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-25Ensure reported missing dependencies show correct version comparisonDan McGee
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>
2011-03-25Mark various functions in deps.c staticDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-25Move alpm_find_dbs_satisfier() function down in deps.cDan McGee
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>
2011-03-25Rework find_requiredby() to not use _alpm_dep_edge()Dan McGee
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>
2011-03-25Don't include version in dep string if mod == ANYDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-24alpm/db: do not close local DB in alpm_db_unregister_allDave Reisner
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>
2011-03-23Updated 3.5.1 translations from TransifexDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Add new Serbian translation from TransifexSlobodan Terzić
Thanks! Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21Minor code cleanupsDan McGee
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>
2011-03-21Ensure package removal list does not contain duplicatesDan McGee
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>
2011-03-21Fix line_offset not being reset in _alpm_archive_fgets()Dan McGee
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>
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-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-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-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>