pacman/lib/libalpm
Nagy Gabor 0da96abc90 Use sync.c for upgrade transaction prepare and commit
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>
2009-09-08 22:04:14 -05:00
..
po Update Brazilian Portuguese translation 2009-08-01 15:51:57 -05:00
.gitignore Remove unnecessary entries from .gitignore files 2007-07-16 16:49:28 -04:00
Makefile.am Refactor pkg_load/parse_descfile into a new backend file 2008-05-11 20:07:55 -05:00
add.c Use sync.c for upgrade transaction prepare and commit 2009-09-08 22:04:14 -05:00
add.h Use sync.c for upgrade transaction prepare and commit 2009-09-08 22:04:14 -05:00
alpm.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
alpm.h Add a new reason field to pmconflict_t struct 2009-09-08 21:58:52 -05:00
alpm_list.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
alpm_list.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
backup.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
backup.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
be_files.c Fix non-C style comments in libalpm 2009-05-11 20:26:49 -05:00
be_package.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
cache.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
cache.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
conflict.c Add a new reason field to pmconflict_t struct 2009-09-08 21:58:52 -05:00
conflict.h Add a new reason field to pmconflict_t struct 2009-09-08 21:58:52 -05:00
db.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
db.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
delta.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
delta.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
deps.c Use sync.c for upgrade transaction prepare and commit 2009-09-08 22:04:14 -05:00
deps.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
dload.c Merge branch 'maint' 2009-08-18 20:49:25 -05:00
dload.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
error.c Check package arch before installing 2009-09-06 15:51:25 -05:00
graph.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
group.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
group.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
handle.c Add Architecture and --arch option 2009-09-06 15:50:42 -05:00
handle.h Add Architecture and --arch option 2009-09-06 15:50:42 -05:00
log.c Update copyright headers and messages 2009-07-01 02:08:33 -05:00
log.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
md5.c Fix compile warning fail on older versions of GCC 2009-06-30 23:14:18 -05:00
md5.h libalpm/md5: Fix license header 2008-06-03 21:31:31 -05:00
package.c Use sync.c for upgrade transaction prepare and commit 2009-09-08 22:04:14 -05:00
package.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
remove.c Fix a minor memleak 2009-07-21 21:45:07 -05:00
remove.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
sync.c Use sync.c for upgrade transaction prepare and commit 2009-09-08 22:04:14 -05:00
sync.h Introduce -Suu 2009-07-22 20:16:52 -05:00
trans.c Use sync.c for upgrade transaction prepare and commit 2009-09-08 22:04:14 -05:00
trans.h Update copyright headers and messages 2009-07-01 02:08:33 -05:00
util.c libalpm/util.c : remove _alpm_strreplace 2009-09-06 19:09:45 -05:00
util.h libalpm/util.c : remove _alpm_strreplace 2009-09-06 19:09:45 -05:00