Fix double filelist issue when upgrading a package
Due to the way we funk around with package data loading, we had a condition
where the filelist got doubled up because it was loaded twice.
Packages are originally loaded with INFRQ_BASE. In a upgrade/sync, the
package is checked for file conflicts next, leaving us in INFRQ_BASE |
INFRQ_FILES state. Later, when committing a single package, we have an
explicit call to pkg_load() with INFRQ_ALL as the level. Because the
packages' level did not match this, we skipped over our previous "does the
incoming level match where I'm at" shortcut, and continued to load things
again, because of a lack of fine-grained checking for each of DESC, FILES,
Fix the problem by doing a bit more bitmasking logic throughout the load
method, and also fix the sanity check at the beginning of the function- this
should *only* be used for local packages as opposed to the "not a package"
check that was there before.
A debug log message was added to upgraderemove as well to match the one
already in the normal remove codepath.
/* copy the remove skiplist over */
- skip_remove =
+ skip_remove = alpm_list_join(
/* Add files in the NEW backup array to the skip_remove array
* so this removal operation doesn't kill them */
/* old package backup list */
@@ -340,6 +343,9 @@ int _alpm_upgraderemove_package(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *tra