summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* use bitwise shift operator in enum "bit field"solsTiCe d'Hiver2009-10-11
| | | | | | | | This offers a cleaner way to deal with constant in enum and allow easy maintainance Signed-off-by: solsTiCe d'Hiver <solstice.dhiver@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix "-Sd conflict_pkg" bugNagy Gabor2009-10-11
| | | | | | | | | | | | | | | | | | | If the -d switch was invoked with -S (or -U), the removes list was simply lost, because trans->remove was computed in an "if(!(trans->flags & PM_TRANS_FLAG_NODEPS))" block. I've added a new pactest file, sync045.py (derived from sync043.py) to test this. Additionally, I did some other minor cleanups in sync_prepare: * preferred list is not needed anymore * I removed a needless alpm_list_remove_dupes line (the target list should not contain dupes at all) * I moved alpm_list_free(remove); to cleanup part to eliminate a possible memleak Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* alpm_list : add new alpm_list_diff_sorted functionXavier Chantry2009-10-11
| | | | | | | | | | | | This is more efficient than alpm_list_diff since it assumes the two lists are sorted. And also we get the two sides of the diff. Even sorting should more efficient than the current list_diff. Sorting the two lists should be O(n*log(n)+m*log(m)) while the current list_diff is O(n*m). So I also reimplemented list_diff using list_diff_sorted. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Rework the alpm_unpack functionsXavier Chantry2009-10-11
| | | | | | | Add support to extract a list of entries Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* cygwin fix : use unsigned char for ctype functionXavier Chantry2009-10-11
| | | | | | | | | | | | See http://www.nabble.com/-PATCH-RFA--Distinguish-between-EOF-and-character-with-value-0xff-td23161772.html#a23188494 cygwin 1.7 actually displays a warning when using signed char with the ctype function, so that compilation fails when using -Wall -Werror. So we just cast all arguments to unsigned char. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm: clean up lock functionDan McGee2009-10-11
| | | | | | | We were doing a lot of manual work; leverage the standard library a bit to do more for us. Signed-off-by: Dan McGee <dan@archlinux.org>
* Reduce calls to list_count() in removing packageDan McGee2009-10-11
| | | | | | | | We don't need to count the number of packages left once per file when removing; we only need to do it once per package. Also move a variable into the correct scope. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add missing get_usedelta() methodDan McGee2009-10-11
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* typing: a few more fixes for special int typesDan McGee2009-10-11
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* int typing: s/unsigned short/int/ in libalpmDan McGee2009-10-11
| | | | | | | | | | After our recent screwup with size_t and ssize_t in the download code, I found the `-Wsign-conversion` flag to GCC to see if we were doing anything else boneheaded. I didn't find anything quite as bad, but we did have some goofups- most of our public unsigned methods would return -1 on error, which is a bit odd in an unsigned context. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2009-10-11
|\
| * alpm_list : fix a bug in alpm_list_removeXavier Chantry2009-10-11
| | | | | | | | | | | | | | A NULL list element triggered an infinite loop. Not cool :) Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update Chinese translation甘露(Lu.Gan)2009-10-11
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update Swedish translationChristian Larsson2009-10-07
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update chinese translation甘露(Lu.Gan)2009-10-07
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * New Greek translationXavier Chantry2009-10-07
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update translationsXavier Chantry2009-10-07
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update all pot and po files for 3.3.2 releaseXavier Chantry2009-10-07
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2009-09-29
|\| | | | | | | | | Conflicts: lib/libalpm/dload.c
| * dload : fix infinite download (big type mistake)Xavier Chantry2009-09-29
| | | | | | | | | | | | | | | | | | | | | | fetchIO_read returns -1 in case of error, and the return type is ssize_t, not size_t ! So we converted -1 to an unsigned, which led to huge file write. The rest is just changing the error return a bit. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2009-09-22
|\|
| * Clean up translation file headersDan McGee2009-09-22
| | | | | | | | | | | | | | Get them a bit more standardized across the board, as they were quite a mess. Also note the two new translations we received for 3.3.1. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Add Swedish translationLaszlo Papp2009-09-22
| | | | | | | | | | | | | | | | | | | | This is for 3.3.0, not for 3.3.1. But since there are only like 10 messages missing, it seems worth including now. Signed-off-by: Christian Larsson <congacx@gmail.com> Signed-off-by: Laszlo Papp <djszapi2@archlinux.us> [Dan: fix some busted translation strings] Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update Czech translationOndrej Kucera2009-09-23
| | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * Update Brazilian translationRodrigo Flores2009-09-22
| | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * Add Norwegian translationLaszlo Papp2009-09-21
| | | | | | | | | | | | Signed-off-by: Hans-Kristian Arntzen <maister@archlinux.us> Signed-off-by: Laszlo Papp <djszapi@archlinux.us> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update Polish translationMateusz Herych2009-09-20
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
* | Fully implement database lazy loadingDan McGee2009-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 34e1413d75 attempted to implement lazy loading of package databases. Although it took care of my main complaint (creating the database directory if it didn't exist), it didn't allow sync repos to be registered before alpm_option_set_dbpath() had been called. With this patch, we no longer compute the individual repository DB paths until necessary, allowing full lazy loading to work as intended, and allowing us to drop the extra setlibpath() calls from the frontend. This allows the changes introduced in a2cd48960 (but later reverted) to be added back in again. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2009-09-20
|\| | | | | | | | | | | | | | | Message updates made this one a bit messy, but nothing too bad. Conflicts: lib/libalpm/add.c lib/libalpm/remove.c
| * Update Italian translationGiovanni Scafora2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update Ukrainian translationRoman Kyrylych2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update Turkish translationSamed Beyribey2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update Spanish translationJuan Pablo González Tognarelli2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update Russian translationSergey Tereschenko2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update Romanian translationVolodia Macovei2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update Kazakh translationBaurzhan Muftakhidinov2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update Hungarian translationNagy Gabor2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update German translationMatthias Gorissen2009-09-18
| | | | | | | | Signed-off-by: Giovanni Scafora <giovanni@archlinux.org>
| * Update en_GB translationDan McGee2009-09-16
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update french translationXavier Chantry2009-09-16
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Update all pot and po files for 3.3.1 releaseXavier Chantry2009-09-16
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * String improvementsXavier Chantry2009-09-16
| | | | | | | | | | | | | | Add more untranslated strings, improve consistency, etc. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Catch an untranslated warning in lib/remove.cNagy Gabor2009-09-15
| | | | | | | | | | Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | delta : simple code refactoringXavier Chantry2009-09-20
| | | | | | | | | | | | | | This will make the code re-usable for other purpose. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | sync.c : duplicate the target before modifying itXavier Chantry2009-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was probably a bad idea to modify the target directly in case of repo/pkg syntax. Duplicating it also allows us to keep the original target string, which is more informative when printing errors. Also remove a duplicated error message from libalpm, and improve the message already returned to the frontend. $ pacman -S foo/bar before error: repository 'foo' not found error: 'bar': no such repository after error: 'foo/bar': could not find repository for target Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2009-09-14
|\|
| * Add makepkgopt to be_package.cNagy Gabor2009-09-14
| | | | | | | | | | | | | | | | | | After commit 774c252 the --debug output shows 5-6 "syntax error..." lines for each package. After this patch pacman recognizes makepkgopt as a valid key, but doesn't do anything. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Change the interface for target loadingXavier Chantry2009-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -int alpm_trans_sysupgrade(int enable_downgrade); -int alpm_trans_sync(char *target); -int alpm_trans_add(char *target); -int alpm_trans_remove(char *target); +int alpm_sync_sysupgrade(int enable_downgrade); +int alpm_sync_target(char *target); +int alpm_sync_dbtarget(char *db, char *target); +int alpm_add_target(char *target); +int alpm_remove_target(char *target); * functions renaming * add new sync_dbtarget which allows to specify the db * repo/ syntax handling is moved to frontend ( should implement FS#15141) * group handling is moved to backend ( see http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html )
* | Remove transaction typeXavier Chantry2009-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This basically started with this change : /* Transaction */ struct __pmtrans_t { - pmtranstype_t type; pmtransflag_t flags; pmtransstate_t state; - alpm_list_t *packages; /* list of (pmpkg_t *) */ + alpm_list_t *add; /* list of (pmpkg_t *) */ + alpm_list_t *remove; /* list of (pmpkg_t *) */ And then I have to modify all the code accordingly.
* | Use sync.c for upgrade transaction prepare and commitNagy Gabor2009-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch utilizes the power of sync.c to fix FS#3492 and FS#5798. Now an upgrade transaction is just a sync transaction internally (in alpm), so all sync features are available with -U as well: * conflict resolving * sync dependencies from sync repos * remove unresolvable targets See http://www.archlinux.org/pipermail/pacman-dev/2009-June/008725.html for the concept. We use "mixed" target list, where PKG_FROM_FILE origin indicates local package file, PKG_FROM_CACHE indicates sync package. The front-end can add only one type of packages (depending on transaction type) atm, but if alpm resolves dependencies for -U, we may get a real mixed trans->packages list. _alpm_pkg_free_trans() was modified so that it can handle both target types _alpm_add_prepare() was removed, we use _alpm_sync_prepare() instead _alpm_add_commit() was renamed to _alpm_upgrade_targets() sync.c (and deps.c) was modified slightly to handle mixed target lists, the modifications are straightforward. There is one notable change here: We don't create new upgrade trans in sync.c, we replace the pkgcache entries with the loaded package files in the target list (this is a bit hackish) and call _alpm_upgrade_targets(). This implies a TODO (pkg->origin_data.db is not accessible anymore), but it doesn't hurt anything with pacman front-end, so it will be fixed later (otherwise this patch would be huge). I updated the documentation of -U and I added a new pactest, upgrade090.py, to test the syncdeps feature of -U. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>